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: Tue, 26 Mar 2013 14:04:23 -0700 Message-ID: <20130326140423.4fe6d5e8@mantra.us.oracle.com> References: <20130315173658.53f402b3@mantra.us.oracle.com> <51470F4702000078000C652D@nat28.tlf.novell.com> <20130325182903.18e6af3e@mantra.us.oracle.com> <51515ED702000078000C8665@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51515ED702000078000C8665@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 Tue, 26 Mar 2013 07:39:51 +0000 "Jan Beulich" wrote: > >>> On 26.03.13 at 02:29, Mukesh Rathor > >>> wrote: > > On Mon, 18 Mar 2013 11:57:43 +0000 > > "Jan Beulich" wrote: > > > >> >>> On 16.03.13 at 01:36, Mukesh Rathor > >> >>> wrote: > > 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. > > Not really - vcpu is, but regs has one path where it gets evaluated, > and one path where it doesn't get used. > > Btw, no matter whether there are other precedents, I do think that > the use of STR() here is misguided too - #name seems like the way > to go to me. STR() really is needed when you want the argument to > be further macro expanded before getting converted to a string, > but here you want the exact opposite - the guarantee that no > macro expansion happens (or else the "regs->name" use would > break). Got it, thanks a lot. #define read_segment_register(vcpu, regs, name) \ ({ u16 __sel; \ struct cpu_user_regs *_regs = (regs); \ \ if ( is_pvh_vcpu(vcpu) ) \ __sel = _regs->name; \ else \ asm volatile ( "movw %%" #name ",%0" : "=r" (__sel) ); \ __sel; \ })