x86emul: simplify DstBitBase handling code
authorJan Beulich <jbeulich@suse.com>
Wed, 23 Nov 2016 14:27:17 +0000 (15:27 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 23 Nov 2016 14:27:17 +0000 (15:27 +0100)
commit0af1b466c4489fca6640de4c49cc9efaad51538e
tree6222bd7ee0fd9b4a56ace13c4d54c1e5ccb2f111
parent13a8f97d421ba9e90ba9d69a137bd29c35383297
x86emul: simplify DstBitBase handling code

..., at once making it more obvious that even in the negative bit
offset case the resulting bit offset to be used by the inlined
instructions will always be constrained to the operand size of the
original instruction.

Also add a test case which would have failed without the XSA-195 fix.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
tools/tests/x86_emulator/test_x86_emulator.c
xen/arch/x86/x86_emulate/x86_emulate.c