From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86emul: use unambiguous register names
Date: Tue, 03 Jan 2017 07:12:56 -0700 [thread overview]
Message-ID: <586BBF78020000780012CA9B@prv-mh.provo.novell.com> (raw)
In-Reply-To: <f63d7399-1817-f3cf-5894-5bc4d4d9e8cc@citrix.com>
>>> On 03.01.17 at 14:30, <andrew.cooper3@citrix.com> wrote:
> On 03/01/17 13:01, Jan Beulich wrote:
>> --- a/xen/arch/x86/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate.c
>> @@ -21,6 +21,8 @@
>> #undef cpuid
>> #undef wbinvd
>>
>> +#define r(name) r ## name
>> +
>
> Hmm. I am no overwhelmed with this syntax, but I can't propose an
> alternative, so ok.
I kind of suspected such a response.
>> @@ -2716,36 +2716,36 @@ x86_emulate(
>> struct segment_register cs, sreg;
>>
>> case 0x00 ... 0x05: add: /* add */
>> - emulate_2op_SrcV("add", src, dst, _regs.eflags);
>> + emulate_2op_SrcV("add", src, dst, _regs.r(flags));
>> break;
>>
>
> All of these types of operations only adjust the arithmetic flags, so
> could legitimately use eflags alone. Is it worth reducing?
Yes, but not now and here: Using _eflags breaks the inline asm which
these macros resolve to.
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.h
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.h
>> @@ -583,41 +583,9 @@ x86_emulate(
>> const struct x86_emulate_ops *ops);
>>
>> #ifndef NDEBUG
>> -/*
>> - * In debug builds, wrap x86_emulate() with some assertions about its expected
>> - * behaviour.
>> - */
>
> I'd leave this comment here as well.
Hmm, in that case I'd drop it at the definition site. I don't think we
need to have the comment in both places. What do you think?
> Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Thanks (but I'll wait for your feedback to the above),
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-01-03 14:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 13:01 [PATCH] x86emul: use unambiguous register names Jan Beulich
2017-01-03 13:30 ` Andrew Cooper
2017-01-03 14:12 ` Jan Beulich [this message]
2017-01-03 14:21 ` Andrew Cooper
2017-01-03 14:54 ` 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=586BBF78020000780012CA9B@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.