diff options
author | Keir Fraser <keir@xen.org> | 2011-01-05 10:01:11 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-01-05 10:01:11 +0000 |
commit | 46d23dbcf0a087c99be9c88f8fc082393e766aa1 (patch) | |
tree | 508e31d06a54b2e1e0f9b2950e59989ac93027f0 | |
parent | 317090f2918f14ef5e774572ec8bfa1392dbfc5e (diff) | |
download | xen-46d23dbcf0a087c99be9c88f8fc082393e766aa1.tar.gz xen-46d23dbcf0a087c99be9c88f8fc082393e766aa1.tar.bz2 xen-46d23dbcf0a087c99be9c88f8fc082393e766aa1.zip |
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>
xen-unstable changeset: 22649:39194f457534
xen-unstable date: Wed Jan 05 09:57:15 2011 +0000
-rw-r--r-- | xen/arch/x86/domain.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/traps.c | 2 | ||||
-rw-r--r-- | xen/include/xen/sched.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 48db6363cf..3143c62b9b 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -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 = diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index a4fd8c6b28..ce5edf564a 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -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; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 08ce46df81..ea8de89f87 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -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); |