x86: fix asm() constraint in clear_user()
authorJan Beulich <jbeulich@suse.com>
Mon, 19 Dec 2016 16:52:42 +0000 (17:52 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Dec 2016 16:52:42 +0000 (17:52 +0100)
Commit 2fdf5b2554 ("x86: streamline copying to/from user memory")
wrongly used "g" here, when it obviously needs to be a register.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/usercopy.c

index d1303a9874a287b379af1c178e9fb18ca1528859..1d1ef075c963ee71754e938679aac0092fcac75c 100644 (file)
@@ -141,7 +141,7 @@ unsigned clear_user(void __user *to, unsigned n)
             _ASM_EXTABLE(0b,3b)
             _ASM_EXTABLE(1b,2b)
             : [cnt] "=&c" (n), [to] "+D" (to)
-            : [bytes] "g" (n & (BYTES_PER_LONG - 1)),
+            : [bytes] "r" (n & (BYTES_PER_LONG - 1)),
               [longs] "0" (n / BYTES_PER_LONG), "a" (0) );
         clac();
     }