x86emul: conditionally clear BNDn for branches
authorJan Beulich <jbeulich@suse.com>
Fri, 13 Jan 2017 14:24:45 +0000 (15:24 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 13 Jan 2017 14:24:45 +0000 (15:24 +0100)
commitcb2626c75813be4267b5bc1515e34145ce55f2d5
tree15d2722ab969215ab8ae55fa0a4303e459b71e72
parent37814513bc9dcd46d084d5713eee7f8d6f7f870f
x86emul: conditionally clear BNDn for branches

Considering that we surface MPX to HVM guests, instructions we emulate
should also correctly deal with MPX state. While for now BND*
instructions don't get emulated, the effect of branches (which we do
emulate) without BND prefix should be taken care of.

No need to alter XABORT behavior: While not mentioned in the SDM so
far, this restores BNDn as they were at the XBEGIN, and since we make
XBEGIN abort right away, XABORT in the emulator is only a no-op.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/tests/x86_emulator/x86_emulate.c
xen/arch/x86/domain.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/xstate.c
xen/include/asm-x86/xstate.h