Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
xen.4216
585bd5fe-x86-emul-correct-VMFUNC-return-value-h...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 585bd5fe-x86-emul-correct-VMFUNC-return-value-handling.patch of Package xen.4216
# Commit 3ab1876504d409689824e161a8b04e57e1e5dd46 # Date 2016-12-22 13:32:46 +0000 # Author Andrew Cooper <andrew.cooper3@citrix.com> # Committer Andrew Cooper <andrew.cooper3@citrix.com> 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> --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -1646,7 +1646,7 @@ static int hvmemul_vmfunc( if ( !hvm_funcs.altp2m_vcpu_emulate_vmfunc ) return X86EMUL_UNHANDLEABLE; rc = hvm_funcs.altp2m_vcpu_emulate_vmfunc(ctxt->regs); - if ( rc != X86EMUL_OKAY ) + if ( rc == X86EMUL_EXCEPTION ) hvmemul_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE, ctxt); --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -3981,7 +3981,7 @@ x86_emulate( generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx == vex_66), EXC_UD, -1); fail_if(ops->vmfunc == NULL); - if ( (rc = ops->vmfunc(ctxt) != X86EMUL_OKAY) ) + if ( (rc = ops->vmfunc(ctxt)) != X86EMUL_OKAY ) goto done; goto no_writeback; case 0xfc: /* clzero */ {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor