* [PATCH] x86: fix asm() constraint in clear_user()
@ 2016-12-19 16:44 Jan Beulich
2016-12-19 16:46 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2016-12-19 16:44 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]
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>
--- a/xen/arch/x86/usercopy.c
+++ b/xen/arch/x86/usercopy.c
@@ -141,7 +141,7 @@ unsigned clear_user(void __user *to, uns
_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();
}
[-- Attachment #2: x86-usercopy-constraint.patch --]
[-- Type: text/plain, Size: 725 bytes --]
x86: fix asm() constraint in clear_user()
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>
--- a/xen/arch/x86/usercopy.c
+++ b/xen/arch/x86/usercopy.c
@@ -141,7 +141,7 @@ unsigned clear_user(void __user *to, uns
_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();
}
[-- Attachment #3: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-19 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-19 16:44 [PATCH] x86: fix asm() constraint in clear_user() Jan Beulich
2016-12-19 16:46 ` Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).