[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86: fix wait code asm() constraints


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Fri, 03 Aug 2012 13:08:43 +0100
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 03 Aug 2012 12:09:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac1xcLm89wyAfWE0V0CPs2ReDjOCcQ==
  • Thread-topic: [Xen-devel] [PATCH] x86: fix wait code asm() constraints

On 03/08/2012 12:36, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

>> I'm confused. The registers have the same values at the start and the end of
>> the asm statement. How can it possibly matter, even in theory, whether they
>> temporarily change in the middle? Is this fairly strong assumption written
>> down in the gcc documentation anywhere?
> 
> It's in the specification of the & modifier:
> 
> "?&¹ Means (in a particular alternative) that this operand is an
>  earlyclobber operand, which is modified before the instruction
>  is finished using the input operands. Therefore, this operand
>  may not lie in a register that is used as an input operand or as
>  part of any memory address."
> 
> Of course, here we're not having any other operands, which
> is why at least at present getting this wrong does no harm.

Yep, okay, that makes sense. Especially the use of an input operand to form
a memory address, although of course that cannot happen in our specific case
here. I have acked your patch, although I'd like an update to the patch
comment.

 Thanks,
 -- Keir



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.