x86/svm: Fix handling of ICEBP intercepts
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Feb 2019 14:48:48 +0000 (14:48 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 13 May 2019 09:35:37 +0000 (10:35 +0100)
commit1495b4ff9b4af2b9c0f12cdb6491082cecf34f86
tree7a8aa52c51c5b56552ae74c6afb5bcdc9f723ca8
parent508bc75d9582897d0541aad64b6cdf9fa2ecdf89
x86/svm: Fix handling of ICEBP intercepts

c/s 9338a37d "x86/svm: implement debug events" added support for introspecting
ICEBP debug exceptions, but didn't account for the fact that
svm_get_insn_len() (previously __get_instruction_length) can fail and may
already have raised #GP with the guest.

If svm_get_insn_len() fails, return back to guest context rather than
continuing and mistaking a trap-style VMExit for a fault-style one.

Spotted by Coverity.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/arch/x86/hvm/svm/svm.c