xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Matt Wilson <msw@amazon.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Keir Fraser <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] xen: schedule: allow dom0 vCPUs to be re-pinned when dom0_vcpus_pin is set
Date: Mon, 10 Dec 2012 14:01:10 -0800	[thread overview]
Message-ID: <20121210220108.GA11695@u109add4315675089e695.ant.amazon.com> (raw)
In-Reply-To: <50C0850402000078000AE77F@nat28.tlf.novell.com>

On Thu, 6 Dec 2012 10:44:04 +0000, Jan Beulich <JBeulich@suse.com> wrote:
> On Wed, 5 Dec 2012 09:06:20 -0800, Matt Wilson <msw@amazon.com> wrote:
> > On Wed, 5 Dec 2012 16:25:36 +0000, Jan Beulich <JBeulich@suse.com> wrote:
> > > On Wed, 5 Dec 2012 07:59:08 -0800, Matt Wilson <msw@amazon.com> wrote:
> > > > 
> > > > If this is true, the existing is_pinned_vcpu() test is broken:
> > > > 
> > > >    #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
> > > >                               cpumask_weight((v)->cpu_affinity) == 1)
> > > > 
> > > > It's && not ||. So if someone pins dom0 vCPUs to pCPUs 1:1 after boot,
> > > > the MSR traps will suddenly start working.
> > > > 
> > > > See commit: 
> > > >   http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=cc0854dd 
> > > 
> > > I don't see what's wrong here. Certain things merely require the
> > > pCPU that a vCPU runs on to be stable, which is what the test
> > > above is for.
> > 
> > Me either. That said, are you willing to Ack and commit my patch that
> > started this thread?
> 
> In no case without Andrew's concerns addressed. Beyond that,
> I'd be hesitant to ack it as I'm myself suspecting side effects that
> we don't want and/or aren't aware of, and in no case could I
> commit it without Keir's ack.

Jan,

So today if I boot Xen without dom0_vcpus_pin set, dom0's vCPUs will
be allowed to run on any pCPU. Xen will block attempts to write
certain MSRs (MSR_AMD64_NB_CFG, MSR_FAM10H_MMIO_CONF_BASE and
MSR_IA32_ENERGY_PERF_BIAS). The VCPUOP_get_physid subop of the vcpu_op
hypercall will not return the initial APIC ID or ACPI ID for dom0.

Also today, if I run "xl vcpu-pin 0 0", suddenly those MSR writes and
the VCPUOP_get_physid hypercall will start working for vCPU 0. For
what it's worth, only legacy XenoLinux-derived kernels appear to use
this hypercall during SMP boot. Upstream Linux does not.

I think that the real risk is in the XenoLinux SMP booting code on AMD
processors where sometimes initial APIC ID != ACPI ID. If the CPU
pinning changes, the ACPI ID to APIC ID mapping will be wrong. This
broke PowerNow! when it ran in dom0.

But PowerNow! is handled by the hypervisor now. So what's the real
danger here?

Andrew, your thoughts?

Thanks,

Matt

  reply	other threads:[~2012-12-10 22:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05  6:02 [PATCH] xen: schedule: allow dom0 vCPUs to be re-pinned when dom0_vcpus_pin is set Matt Wilson
2012-12-05 10:44 ` Andrew Cooper
2012-12-05 15:59   ` Matt Wilson
2012-12-05 16:04     ` Matt Wilson
2012-12-05 16:06     ` Andrew Cooper
2012-12-05 16:25     ` Jan Beulich
2012-12-05 17:06       ` Matt Wilson
2012-12-05 17:16         ` George Dunlap
2012-12-06 10:44         ` Jan Beulich
2012-12-10 22:01           ` Matt Wilson [this message]
2012-12-11 10:43             ` Jan Beulich

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=20121210220108.GA11695@u109add4315675089e695.ant.amazon.com \
    --to=msw@amazon.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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).