From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Wilson Subject: Re: [PATCH] xen: schedule: allow dom0 vCPUs to be re-pinned when dom0_vcpus_pin is set Date: Wed, 5 Dec 2012 09:06:20 -0800 Message-ID: <20121205170618.GC32088@u109add4315675089e695.ant.amazon.com> References: <2614dd8be3a01247230c.1354687327@u109add4315675089e695> <50BF2574.6080702@citrix.com> <20121205155906.GA32088@u109add4315675089e695.ant.amazon.com> <50BF839002000078000AE3DF@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <50BF839002000078000AE3DF@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , Andrew Cooper , Keir Fraser , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, Dec 05, 2012 at 04:25:36PM +0000, Jan Beulich wrote: > >>> On 05.12.12 at 16:59, Matt Wilson wrote: > > On Wed, Dec 05, 2012 at 10:44:04AM +0000, Andrew Cooper wrote: > >> On 05/12/12 06:02, Matt Wilson wrote: > >> > An administrator may want Xen to pin dom0 vCPUs to pCPUs 1:1 at boot, > >> > but still have the flexibility to change the configuration later. > >> > There's no logic that keys off of domain->is_pinned outside of > >> > sched_init_vcpu() and vcpu_set_affinity(). By adjusting the > >> > is_pinned_vcpu() macro to only check for a single CPU set in the > >> > cpu_affinity mask, dom0 vCPUs can safely be re-pinned after the system > >> > boots. > >> > >> Sadly this patch will break things. There are certain callers of > >> is_pinned_vcpu() which rely on the value to allow access to certain > >> power related MSRs, which is where the requirement for never permitting > >> an update of the affinity mask comes from. > > > > 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? Thanks, Matt