]> xenbits.xensource.com Git - xen.git/commitdiff
relax vCPU pinned checks
authorKeir Fraser <keir@xen.org>
Wed, 5 Jan 2011 10:01:11 +0000 (10:01 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 5 Jan 2011 10:01:11 +0000 (10:01 +0000)
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>
xen-unstable changeset:   22649:39194f457534
xen-unstable date:        Wed Jan 05 09:57:15 2011 +0000

xen/arch/x86/domain.c
xen/arch/x86/traps.c
xen/include/xen/sched.h

index 48db6363cf81d9e3cfb9a9920c12d8653a81127a..3143c62b9b53a502a12f44d55a2922c9549aec38 100644 (file)
@@ -1005,7 +1005,7 @@ arch_do_vcpu_op(
         struct vcpu_get_physid cpu_id;
 
         rc = -EINVAL;
-        if ( !v->domain->is_pinned )
+        if ( !is_pinned_vcpu(v) )
             break;
 
         cpu_id.phys_id =
index a4fd8c6b28ec7e58ebc095ffd06afd3494206d43..ce5edf564ac566f9a82fdaccf50761d66088c718 100644 (file)
@@ -2292,7 +2292,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case MSR_IA32_THERM_CONTROL:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;
-            if ( (v->domain->domain_id != 0) || !v->domain->is_pinned )
+            if ( (v->domain->domain_id != 0) || !is_pinned_vcpu(v) )
                 break;
             if ( wrmsr_safe(regs->ecx, eax, edx) != 0 )
                 goto fail;
index 08ce46df810c57313633edfdf2b37ebca79695f7..ea8de89f879c8c30319f60e2869ac88888721b20 100644 (file)
@@ -586,6 +586,8 @@ uint64_t get_cpu_idle_time(unsigned int cpu);
 
 #define is_hvm_domain(d) ((d)->is_hvm)
 #define is_hvm_vcpu(v)   (is_hvm_domain(v->domain))
+#define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
+                           cpus_weight((v)->cpu_affinity) == 1)
 #define need_iommu(d)    ((d)->need_iommu)
 
 void set_vcpu_migration_delay(unsigned int delay);