debuggers.hg

changeset 22695:39194f457534

relax vCPU pinned checks

Both writing of certain MSRs and VCPUOP_get_physid make sense also for
dynamically (perhaps temporarily) pinned vcpus.

Likely a couple of other MSR writes (MSR_K8_HWCR, MSR_AMD64_NB_CFG,
MSR_FAM10H_MMIO_CONF_BASE) would make sense to be restricted by an
is_pinned() check too, possibly also some MSR reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir@xen.org>
date Wed Jan 05 09:57:15 2011 +0000 (2011-01-05)
parents 41a259d7a33d
children 180ad8c642ab
files xen/arch/x86/domain.c xen/arch/x86/traps.c xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Jan 05 09:52:54 2011 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Jan 05 09:57:15 2011 +0000
     1.3 @@ -1036,7 +1036,7 @@ arch_do_vcpu_op(
     1.4          struct vcpu_get_physid cpu_id;
     1.5  
     1.6          rc = -EINVAL;
     1.7 -        if ( !v->domain->is_pinned )
     1.8 +        if ( !is_pinned_vcpu(v) )
     1.9              break;
    1.10  
    1.11          cpu_id.phys_id =
     2.1 --- a/xen/arch/x86/traps.c	Wed Jan 05 09:52:54 2011 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Wed Jan 05 09:57:15 2011 +0000
     2.3 @@ -2336,7 +2336,7 @@ static int emulate_privileged_op(struct 
     2.4          case MSR_IA32_ENERGY_PERF_BIAS:
     2.5              if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
     2.6                  goto fail;
     2.7 -            if ( (v->domain->domain_id != 0) || !v->domain->is_pinned )
     2.8 +            if ( (v->domain->domain_id != 0) || !is_pinned_vcpu(v) )
     2.9                  break;
    2.10              if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
    2.11                  goto fail;
     3.1 --- a/xen/include/xen/sched.h	Wed Jan 05 09:52:54 2011 +0000
     3.2 +++ b/xen/include/xen/sched.h	Wed Jan 05 09:57:15 2011 +0000
     3.3 @@ -634,6 +634,8 @@ void watchdog_domain_destroy(struct doma
     3.4  
     3.5  #define is_hvm_domain(d) ((d)->is_hvm)
     3.6  #define is_hvm_vcpu(v)   (is_hvm_domain(v->domain))
     3.7 +#define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
     3.8 +                           cpus_weight((v)->cpu_affinity) == 1)
     3.9  #define need_iommu(d)    ((d)->need_iommu)
    3.10  
    3.11  void set_vcpu_migration_delay(unsigned int delay);