x86/emul: Correct the return value handling of VMFUNC
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 9 Dec 2016 18:40:11 +0000 (18:40 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Dec 2016 13:32:46 +0000 (13:32 +0000)
commit3ab1876504d409689824e161a8b04e57e1e5dd46
tree6148c7135c44e2e856afcf1822e37e797d681969
parent1226317351b4154ed6460b778f2490614f47b9d4
x86/emul: Correct the return value handling of VMFUNC

The bracketing of x86_emulate() calling the ops->vmfunc() hook is wrong with
respect to the assignment to rc, which can trip the new assertions in
x86_emulate_wrapper().

The hvmemul_vmfunc() hook should only raise #UD if X86EMUL_EXCEPTION is
returned.  This is only a latent bug at the moment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/x86_emulate/x86_emulate.c