All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/7] x86emul: don't special case fetching the immediate of PUSH
Date: Thu, 11 Aug 2016 07:26:29 -0600	[thread overview]
Message-ID: <57AC992502000078001051A1@prv-mh.provo.novell.com> (raw)
In-Reply-To: <8b0a20e0-09c3-8cda-fda3-d5da5ddac117@citrix.com>

>>> On 11.08.16 at 14:58, <andrew.cooper3@citrix.com> wrote:
> On 11/08/16 13:03, Jan Beulich wrote:
>> These immediates follow the standard patterns in all modes, so they're
>> better fetched by the generic source operand handling code.
>>
>> To facilitate testing, instead of adding yet another of these pretty
>> convoluted individual test cases, simply introduce another blowfish run
>> with -mno-accumulate-outgoing-args (the additional -Dstatic is to
>> keep the compiler from converting the calling convention to
>> "regparm(3)", which I did observe it does).
>>
>> To make this introduction of a new blowfish pass (and potential further
>> ones later one) have less impact on the readability of the final code,
>> abstract all such "binary blob" executions via a table to iterate
>> through.
>>
>> The resulting native code execution adjustment also uncovered a lack of
>> clobbers on the asm() in the 64-bit case, which is being fixed at once.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> It would be helpful if the blob refactoring was in a separate patch to
> the emulator bugfix.

There's no bug fix here really, which is why I didn't think splitting
it was strictly necessary. Can be done, but if at all possible I'd
prefer not to spend extra time on disentangling the two, the more
that in this case I'm convinced the reviewing of the split changes
wouldn't be any easier than that of them being lumped together.

>> @@ -983,20 +993,27 @@ int main(int argc, char **argv)
>>               (regs.eax != 2) || (regs.edx != 1) )
>>              goto fail;
>>          printf("okay\n");
>> -    }
>>  
>> -    printf("%-40s", "Testing blowfish native execution...");    
>> -    asm volatile (
>> +        if ( ctxt.addr_size != sizeof(void *) * CHAR_BIT )
>> +            continue;
> 
> This wants to be at the top of the loop, or we will attempt to emulate
> 64bit code in a 32bit build of the test before hitting this condition.

Certainly not: We do want to test 32-bit code in a 64-bit build,
and 64-bit code simply mustn't be included in a 32-bit build (hence
the __x86_64__ conditionals inside the blobs[] initializer). Quite
the opposite - not running 32-bit code natively here on a 64-bit
system is solely because that would require extra setup (but not
much value), not because it's impossible.

And btw., I did run the changed test on both 64-bit and 32-bit
setups, so it is proven in practice that what you think needs to
be prevented can't happen.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-11 13:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 11:53 [PATCH 0/7] x86emul: misc small adjustments Jan Beulich
2016-08-11 12:03 ` [PATCH 1/7] x86emul: don't special case fetching the immediate of PUSH Jan Beulich
2016-08-11 12:58   ` Andrew Cooper
2016-08-11 13:26     ` Jan Beulich [this message]
2016-08-11 17:33       ` Andrew Cooper
2016-08-11 12:04 ` [PATCH 2/7] x86emul: don't special case fetching immediates of near and short branches Jan Beulich
2016-08-11 13:19   ` Andrew Cooper
2016-08-11 13:27     ` Jan Beulich
2016-08-11 12:04 ` [PATCH 3/7] x86emul: all push flavors are data moves Jan Beulich
2016-08-11 13:40   ` Andrew Cooper
2016-08-11 12:05 ` [PATCH 4/7] x86emul: fold SrcImmByte fetching Jan Beulich
2016-08-11 13:41   ` Andrew Cooper
2016-08-11 14:09     ` Jan Beulich
2016-08-11 15:06       ` Andrew Cooper
2016-08-11 12:06 ` [PATCH 5/7] x86emul: don't special case fetching unsigned 8-bit immediates Jan Beulich
2016-08-11 16:32   ` Andrew Cooper
2016-08-11 16:44     ` Jan Beulich
2016-08-11 17:38       ` Andrew Cooper
2016-08-12 10:50         ` Jan Beulich
2016-08-12 11:47           ` Andrew Cooper
2016-08-11 12:06 ` [PATCH 6/7] x86emul: use DstEax where possible Jan Beulich
2016-08-11 16:41   ` Andrew Cooper
2016-08-11 12:07 ` [PATCH 7/7] x86emul: introduce SrcImm16 Jan Beulich
2016-08-11 17:23   ` Andrew Cooper

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=57AC992502000078001051A1@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.