xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 8/18 V2]: PVH xen: domain creation code changes
Date: Tue, 26 Mar 2013 14:04:23 -0700	[thread overview]
Message-ID: <20130326140423.4fe6d5e8@mantra.us.oracle.com> (raw)
In-Reply-To: <51515ED702000078000C8665@nat28.tlf.novell.com>

On Tue, 26 Mar 2013 07:39:51 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 26.03.13 at 02:29, Mukesh Rathor <mukesh.rathor@oracle.com>
> >>> wrote:
> > On Mon, 18 Mar 2013 11:57:43 +0000
> > "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> >> >>> On 16.03.13 at 01:36, Mukesh Rathor <mukesh.rathor@oracle.com>
> >> >>> 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;                                                        \
})

  reply	other threads:[~2013-03-26 21:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16  0:36 [PATCH 8/18 V2]: PVH xen: domain creation code changes Mukesh Rathor
2013-03-18 11:57 ` Jan Beulich
2013-03-21 16:16   ` Tim Deegan
2013-03-26  1:29   ` Mukesh Rathor
2013-03-26  7:39     ` Jan Beulich
2013-03-26 21:04       ` Mukesh Rathor [this message]
2013-03-27  7:30         ` Jan Beulich
2013-03-18 15:54 ` Konrad Rzeszutek Wilk

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=20130326140423.4fe6d5e8@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=JBeulich@suse.com \
    --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).