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

[xen staging] x86: move stac()/clac() from {get,put}_unsafe_asm() ...



commit e0d42bdbbde39522c5730730f18722e5452b700c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Feb 25 15:38:35 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Feb 25 15:38:35 2021 +0100

    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>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Release-Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 xen/include/asm-x86/uaccess.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-x86/uaccess.h b/xen/include/asm-x86/uaccess.h
index 4ca9bfc478..684fccd95c 100644
--- a/xen/include/asm-x86/uaccess.h
+++ b/xen/include/asm-x86/uaccess.h
@@ -154,7 +154,6 @@ struct __large_struct { unsigned long buf[100]; };
  * 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" \
@@ -169,11 +168,9 @@ struct __large_struct { unsigned long buf[100]; };
                : [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" \
@@ -190,12 +187,12 @@ struct __large_struct { unsigned long buf[100]; };
                  [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_;                                                           \
@@ -213,6 +210,7 @@ do {                                                        
               \
         break;                                                             \
     default: __put_user_bad();                                             \
     }                                                                      \
+    clac();                                                                \
 } while ( false )
 
 #define put_guest_size(x, ptr, size, retval, errret) \
@@ -221,6 +219,7 @@ do {                                                        
               \
 #define get_unsafe_size(x, ptr, size, grd, retval, errret)                 \
 do {                                                                       \
     retval = 0;                                                            \
+    stac();                                                                \
     switch ( size )                                                        \
     {                                                                      \
     long dummy_;                                                           \
@@ -230,6 +229,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)                       \
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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