WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] x86-64: don't allow wrmsr to MSR_FAM10H_MMIO_CON

To: Jan Beulich <JBeulich@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] x86-64: don't allow wrmsr to MSR_FAM10H_MMIO_CONF_BASE when Xen itself is using it
From: Keir Fraser <keir@xxxxxxx>
Date: Mon, 10 Jan 2011 08:54:02 +0000
Cc:
Delivery-date: Mon, 10 Jan 2011 00:55:12 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=dFJstKNDF7iDR/BhdXLTen4CWXV9IIvRAs8fioQZnTI=; b=UWi53BJtpw3SPT9ao+BqQLXEONTOFXp44gJ4tUaDi2kFwGe08gm2oVQgoMXgUoFT5s s5uqm4heKHdsXaClr8sPc14egeijUO/B0/PSoad5qtOoNturytSK3Eu0zo0/1Tr9jqmJ ZvKiGMOIlyIj1LaQAtJTAiHCRJypqtuocOKNs=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=CW23Cp9nnWHSg3SwDzKWRkfGo6oShxcBFYjdIFpSpKHsTH61ZIVrLQZjiEX+2sxI/t nG4Vw29vJ49KGulLWn2y0UopqCz6VR3cWrSVz9ZbqeeciaNj7o8bBh10G0VGprQFAO3s QXA8PmjKUr1fL4nQWDoJq/DGCa1XBpT1R4LJE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D26D88F020000780002AEEA@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acuwo+1xq/j3IQOjDUC+HSBqFc9QMA==
Thread-topic: [Xen-devel] [PATCH] x86-64: don't allow wrmsr to MSR_FAM10H_MMIO_CONF_BASE when Xen itself is using it
User-agent: Microsoft-Entourage/12.27.0.100910
Applied, thanks. Is similar needed in 4.0-testing? It doesn't trivially
backport since 4.0-testing does not have other of your patches which also
serves to make variable pci_probe non-static.

 -- Keir

On 07/01/2011 08:10, "Jan Beulich" <JBeulich@xxxxxxxxxx> wrote:

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
> 
> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -1695,6 +1695,10 @@ static int is_cpufreq_controller(struct
>              (d->domain_id == 0));
>  }
>  
> +#ifdef CONFIG_X86_64
> +#include "x86_64/mmconfig.h"
> +#endif
> +
>  static int emulate_privileged_op(struct cpu_user_regs *regs)
>  {
>      struct vcpu *v = current;
> @@ -2289,7 +2293,14 @@ static int emulate_privileged_op(struct
>                  goto fail;
>              if ( !IS_PRIV(v->domain) )
>                  break;
> -            if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) ||
> +            if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) )
> +                goto fail;
> +            if (
> +#ifdef CONFIG_X86_64
> +                 (pci_probe & PCI_PROBE_MMCONF) &&
> +                 (pci_probe & PCI_CHECK_ENABLE_AMD_MMCONF) ?
> +                 val != msr_content :
> +#endif
>                   ((val ^ msr_content) &
>                    ~( FAM10H_MMIO_CONF_ENABLE |
>                      (FAM10H_MMIO_CONF_BUSRANGE_MASK <<
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>