[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] relax vCPU pinned checks



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1294221435 0
# Node ID 39194f457534e07e5d5cc54376c4df28e0acb63c
# Parent  41a259d7a33dfbea6296cbeaae178823e09b91db
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@xxxxxxxxxx>
---
 xen/arch/x86/domain.c   |    2 +-
 xen/arch/x86/traps.c    |    2 +-
 xen/include/xen/sched.h |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff -r 41a259d7a33d -r 39194f457534 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Jan 05 09:52:54 2011 +0000
+++ b/xen/arch/x86/domain.c     Wed Jan 05 09:57:15 2011 +0000
@@ -1036,7 +1036,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 =
diff -r 41a259d7a33d -r 39194f457534 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Wed Jan 05 09:52:54 2011 +0000
+++ b/xen/arch/x86/traps.c      Wed Jan 05 09:57:15 2011 +0000
@@ -2336,7 +2336,7 @@ static int emulate_privileged_op(struct 
         case MSR_IA32_ENERGY_PERF_BIAS:
             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, msr_content) != 0 )
                 goto fail;
diff -r 41a259d7a33d -r 39194f457534 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Wed Jan 05 09:52:54 2011 +0000
+++ b/xen/include/xen/sched.h   Wed Jan 05 09:57:15 2011 +0000
@@ -634,6 +634,8 @@ void watchdog_domain_destroy(struct doma
 
 #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);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.