From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 8/18 V2]: PVH xen: domain creation code changes Date: Mon, 25 Mar 2013 18:29:03 -0700 Message-ID: <20130325182903.18e6af3e@mantra.us.oracle.com> References: <20130315173658.53f402b3@mantra.us.oracle.com> <51470F4702000078000C652D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51470F4702000078000C652D@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: xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 18 Mar 2013 11:57:43 +0000 "Jan Beulich" wrote: > >>> On 16.03.13 at 01:36, Mukesh Rathor > >>> wrote: > > --- a/xen/include/asm-x86/system.h > > +++ b/xen/include/asm-x86/system.h > > @@ -4,9 +4,15 @@ > > #include > > #include > > > > +/* We need vcpu because during context switch, going from pure PV > > to PVH, > > + * in save_segments(), current has been updated to next, and no > > longer pointing > > + * to the pure PV. Note: for PVH, we update regs->selectors on > > each vmexit */ #define read_segment_register(vcpu, regs, > > name) \ ({ u16 > > __sel; \ > > - asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) ); \ > > + if (is_pvh_vcpu(vcpu)) > > \ > > + __sel = regs->name; \ > > + else \ > > + asm volatile ( "movw %%" STR(name) ",%0" : > > "=r" (__sel) ); \ > > __sel; \ }) > > In a generic macro like this, please make sure you evaluate each > argument exactly once, and you properly parenthesize all uses of > macro arguments. Hmm... at a loss. The only think I'm able to come up with here is paranthesis around regs, and spaces in the if statement. Both vcpu and regs are used only once.