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

[Xen-devel] Ping: [PATCH v2 6/6] x86emul: simplify FPU handling asm() constraints



>>> On 08.12.16 at 12:38, <JBeulich@xxxxxxxx> wrote:
> The memory clobber is rather harsh here. However, fic.exn_raised may be
> modified as a side effect, so we need to let the compiler know that all
> of "fic" may be changed (preventing it from moving around accesses to
> the exn_raised field).
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Ping? (The v1 discussion had stalled, so at that point it seemed best
to simply re-send with the updates to the earlier patches.)

> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -759,7 +759,7 @@ do {
>  })
>  
>  struct fpu_insn_ctxt {
> -    uint8_t insn_bytes;
> +    uint8_t insn_bytes; /* Must be first! */
>      int8_t exn_raised;
>  };
>  
> @@ -853,23 +853,21 @@ do {
>          "movb $2f-1f,%0 \n"                             \
>          "1: " _op "     \n"                             \
>          "2:             \n"                             \
> -        : "=m" (fic.insn_bytes) : : "memory" )
> +        : "+m" (fic) )
>  
>  #define emulate_fpu_insn_memdst(_op, _arg)              \
>      asm volatile (                                      \
>          "movb $2f-1f,%0 \n"                             \
>          "1: " _op " %1  \n"                             \
>          "2:             \n"                             \
> -        : "=m" (fic.insn_bytes), "=m" (_arg)            \
> -        : : "memory" )
> +        : "+m" (fic), "=m" (_arg) )
>  
>  #define emulate_fpu_insn_memsrc(_op, _arg)              \
>      asm volatile (                                      \
>          "movb $2f-1f,%0 \n"                             \
>          "1: " _op " %1  \n"                             \
>          "2:             \n"                             \
> -        : "=m" (fic.insn_bytes)                         \
> -        : "m" (_arg) : "memory" )
> +        : "+m" (fic) : "m" (_arg) )
>  
>  #define emulate_fpu_insn_stub(_bytes...)                                \
>  do {                                                                    \




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

 


Rackspace

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