[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 08/17] x86: move stac()/clac() from {get,put}_unsafe_asm() ...
... to {get,put}_unsafe_size(). There's no need to have the macros expanded once per case label in the latter. This also makes the former well-formed single statements again. No change in generated code. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/include/asm-x86/uaccess.h +++ b/xen/include/asm-x86/uaccess.h @@ -155,7 +155,6 @@ struct __large_struct { unsigned long bu * aliasing issues. */ #define put_unsafe_asm(x, addr, GUARD, err, itype, rtype, ltype, errret) \ - stac(); \ __asm__ __volatile__( \ GUARD( \ " guest_access_mask_ptr %[ptr], %[scr1], %[scr2]\n" \ @@ -170,11 +169,9 @@ struct __large_struct { unsigned long bu : [ret] "+r" (err), [ptr] "=&r" (dummy_) \ GUARD(, [scr1] "=&r" (dummy_), [scr2] "=&r" (dummy_)) \ : [val] ltype (x), "m" (__m(addr)), \ - "[ptr]" (addr), [errno] "i" (errret)); \ - clac() + "[ptr]" (addr), [errno] "i" (errret)) #define get_unsafe_asm(x, addr, GUARD, err, rtype, ltype, errret) \ - stac(); \ __asm__ __volatile__( \ GUARD( \ " guest_access_mask_ptr %[ptr], %[scr1], %[scr2]\n" \ @@ -191,12 +188,12 @@ struct __large_struct { unsigned long bu [ptr] "=&r" (dummy_) \ GUARD(, [scr1] "=&r" (dummy_), [scr2] "=&r" (dummy_)) \ : "m" (__m(addr)), "[ptr]" (addr), \ - [errno] "i" (errret)); \ - clac() + [errno] "i" (errret)) #define put_unsafe_size(x, ptr, size, grd, retval, errret) \ do { \ retval = 0; \ + stac(); \ switch ( size ) \ { \ long dummy_; \ @@ -214,6 +211,7 @@ do { break; \ default: __put_user_bad(); \ } \ + clac(); \ } while ( false ) #define put_guest_size(x, ptr, size, retval, errret) \ @@ -222,6 +220,7 @@ do { #define get_unsafe_size(x, ptr, size, grd, retval, errret) \ do { \ retval = 0; \ + stac(); \ switch ( size ) \ { \ long dummy_; \ @@ -231,6 +230,7 @@ do { case 8: get_unsafe_asm(x, ptr, grd, retval, "", "=r", errret); break; \ default: __get_user_bad(); \ } \ + clac(); \ } while ( false ) #define get_guest_size(x, ptr, size, retval, errret) \
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |