x86emul: correct stub invocation constraints

Stub invocations need to have the space the stub occupies as an input,
to prevent the compiler from re-ordering (or omitting) writes to it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
Jan Beulich committed 2017-04-26 09:49:24 +02:00
1 parent 144aec4140
commit cd91ab08ea
1 file changed
+4 -2
+4 -2
View File
@@ -837,7 +837,8 @@ do{ asm volatile ( \
".popsection\n\t" \
_ASM_EXTABLE(.Lret%=, .Lfix%=) \
: [exn] "+g" (res_), constraints, \
[stub] "rm" (stub.func) ); \
[stub] "rm" (stub.func), \
"m" (*(uint8_t(*)[MAX_INST_LEN + 1])stub.ptr) ); \
if ( unlikely(~res_.raw) ) \
{ \
gprintk(XENLOG_WARNING, \
@@ -853,7 +854,8 @@ do{ asm volatile ( \
#else
# define invoke_stub(pre, post, constraints...) \
asm volatile ( pre "\n\tcall *%[stub]\n\t" post \
: constraints, [stub] "rm" (stub.func) )
: constraints, [stub] "rm" (stub.func), \
"m" (*(uint8_t(*)[MAX_INST_LEN + 1])stub.buf) )
#endif
#define emulate_stub(dst, src...) do { \
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.