Skip to content

Commit

Permalink
x86: Fix hypercall dispatching assembly
Browse files Browse the repository at this point in the history
The macro reads jailhouse_use_vmcall, a bool variable that is mapped on
a byte on x86. Specify the width to avoid that we test more than we
should.

This bug was revealed by adding further global bool variables that
happen to line up after jailhouse_use_vmcall. The current memory layout
may make the issue harmless in practice.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Mar 9, 2015
1 parent 0de3049 commit d7d5ea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hypervisor/arch/x86/include/asm/jailhouse_hypercall.h
Expand Up @@ -17,7 +17,7 @@
* we assume that where VMCALL isn't available, VMMCALL is.
*/
#define JAILHOUSE_CALL_CODE \
"cmp $0x01, %1\n\t"\
"cmpb $0x01, %1\n\t"\
"jnz 1f\n\t"\
"vmcall\n\t"\
"jmp 2f\n\t"\
Expand Down

0 comments on commit d7d5ea9

Please sign in to comment.