[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.6] x86/SVM: don't deliver #GP without error code
commit 49e6fcd85d82f5dc7a5cfba640f80b6dab173d50 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Wed Jan 18 10:19:32 2017 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Jan 18 10:19:32 2017 +0100 x86/SVM: don't deliver #GP without error code Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> master commit: 647c7bd4453c224d9ccdfdb37491544f797fdc48 master date: 2016-11-25 09:46:32 +0100 --- xen/arch/x86/hvm/svm/svm.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index b5f95f9..63c0189 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2013,7 +2013,7 @@ svm_vmexit_do_vmrun(struct cpu_user_regs *regs, if ( !nestedsvm_vmcb_map(v, vmcbaddr) ) { gdprintk(XENLOG_ERR, "VMRUN: mapping vmcb failed, injecting #GP\n"); - hvm_inject_hw_exception(TRAP_gp_fault, HVM_DELIVER_NO_ERROR_CODE); + hvm_inject_hw_exception(TRAP_gp_fault, 0); return; } @@ -2052,7 +2052,6 @@ svm_vmexit_do_vmload(struct vmcb_struct *vmcb, struct cpu_user_regs *regs, struct vcpu *v, uint64_t vmcbaddr) { - int ret; unsigned int inst_len; struct page_info *page; @@ -2062,8 +2061,8 @@ svm_vmexit_do_vmload(struct vmcb_struct *vmcb, if ( !nsvm_efer_svm_enabled(v) ) { gdprintk(XENLOG_ERR, "VMLOAD: nestedhvm disabled, injecting #UD\n"); - ret = TRAP_invalid_op; - goto inject; + hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE); + return; } page = nsvm_get_nvmcb_page(v, vmcbaddr); @@ -2071,8 +2070,8 @@ svm_vmexit_do_vmload(struct vmcb_struct *vmcb, { gdprintk(XENLOG_ERR, "VMLOAD: mapping failed, injecting #GP\n"); - ret = TRAP_gp_fault; - goto inject; + hvm_inject_hw_exception(TRAP_gp_fault, 0); + return; } svm_vmload_pa(page_to_maddr(page)); @@ -2082,11 +2081,6 @@ svm_vmexit_do_vmload(struct vmcb_struct *vmcb, v->arch.hvm_svm.vmcb_in_sync = 0; __update_guest_eip(regs, inst_len); - return; - - inject: - hvm_inject_hw_exception(ret, HVM_DELIVER_NO_ERROR_CODE); - return; } static void @@ -2094,7 +2088,6 @@ svm_vmexit_do_vmsave(struct vmcb_struct *vmcb, struct cpu_user_regs *regs, struct vcpu *v, uint64_t vmcbaddr) { - int ret; unsigned int inst_len; struct page_info *page; @@ -2104,8 +2097,8 @@ svm_vmexit_do_vmsave(struct vmcb_struct *vmcb, if ( !nsvm_efer_svm_enabled(v) ) { gdprintk(XENLOG_ERR, "VMSAVE: nestedhvm disabled, injecting #UD\n"); - ret = TRAP_invalid_op; - goto inject; + hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE); + return; } page = nsvm_get_nvmcb_page(v, vmcbaddr); @@ -2113,18 +2106,13 @@ svm_vmexit_do_vmsave(struct vmcb_struct *vmcb, { gdprintk(XENLOG_ERR, "VMSAVE: mapping vmcb failed, injecting #GP\n"); - ret = TRAP_gp_fault; - goto inject; + hvm_inject_hw_exception(TRAP_gp_fault, 0); + return; } svm_vmsave_pa(page_to_maddr(page)); put_page(page); __update_guest_eip(regs, inst_len); - return; - - inject: - hvm_inject_hw_exception(ret, HVM_DELIVER_NO_ERROR_CODE); - return; } static void svm_vmexit_ud_intercept(struct cpu_user_regs *regs) -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.6 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |