From: "Jan Beulich" <JBeulich@novell.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] relax vCPU pinned checks
Date: Wed, 05 Jan 2011 09:01:32 +0000 [thread overview]
Message-ID: <4D24417C020000780002A68B@vpn.id2.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1614 bytes --]
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>
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1036,7 +1036,7 @@ arch_do_vcpu_op(
struct vcpu_get_physid cpu_id;
rc = -EINVAL;
- if ( !v->domain->is_pinned )
+ if ( !is_pinned(v) )
break;
cpu_id.phys_id =
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2335,7 +2335,7 @@ static int emulate_privileged_op(struct
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(v) )
break;
if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
goto fail;
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -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(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);
[-- Attachment #2: relax-pinned-checks.patch --]
[-- Type: text/plain, Size: 1608 bytes --]
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>
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1036,7 +1036,7 @@ arch_do_vcpu_op(
struct vcpu_get_physid cpu_id;
rc = -EINVAL;
- if ( !v->domain->is_pinned )
+ if ( !is_pinned(v) )
break;
cpu_id.phys_id =
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2335,7 +2335,7 @@ static int emulate_privileged_op(struct
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(v) )
break;
if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
goto fail;
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -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(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);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2011-01-05 9:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D24417C020000780002A68B@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).