debuggers.hg

changeset 22739:08bb0eefe871

x86-64: don't allow wrmsr to MSR_FAM10H_MMIO_CONF_BASE when Xen itself is using it

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir@xen.org>
date Mon Jan 10 08:42:32 2011 +0000 (2011-01-10)
parents 66e806289464
children 9b5d121c8805
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Mon Jan 10 08:40:32 2011 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Mon Jan 10 08:42:32 2011 +0000
     1.3 @@ -1694,6 +1694,10 @@ static int is_cpufreq_controller(struct 
     1.4              (d->domain_id == 0));
     1.5  }
     1.6  
     1.7 +#ifdef CONFIG_X86_64
     1.8 +#include "x86_64/mmconfig.h"
     1.9 +#endif
    1.10 +
    1.11  static int emulate_privileged_op(struct cpu_user_regs *regs)
    1.12  {
    1.13      struct vcpu *v = current;
    1.14 @@ -2288,7 +2292,14 @@ static int emulate_privileged_op(struct 
    1.15                  goto fail;
    1.16              if ( !IS_PRIV(v->domain) )
    1.17                  break;
    1.18 -            if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) ||
    1.19 +            if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) )
    1.20 +                goto fail;
    1.21 +            if (
    1.22 +#ifdef CONFIG_X86_64
    1.23 +                 (pci_probe & PCI_PROBE_MMCONF) &&
    1.24 +                 (pci_probe & PCI_CHECK_ENABLE_AMD_MMCONF) ?
    1.25 +                 val != msr_content :
    1.26 +#endif
    1.27                   ((val ^ msr_content) &
    1.28                    ~( FAM10H_MMIO_CONF_ENABLE |
    1.29                      (FAM10H_MMIO_CONF_BUSRANGE_MASK <<