]> xenbits.xensource.com Git - xen.git/commit
VMX: fix/adjust trap injection
authorJan Beulich <jbeulich@suse.com>
Tue, 15 Dec 2015 14:21:41 +0000 (15:21 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 15 Dec 2015 14:21:41 +0000 (15:21 +0100)
commitb56ae5b48c3890b0c52f5676d0c29e3b4a5545e9
tree10d6ae00f9674995b1a9cd374bc5ef5160a84ace
parent850bcd0f42e4912b6605a2caa42d5c466ed58bd1
VMX: fix/adjust trap injection

In the course of investigating the 4.1.6 backport issue of the XSA-156
patch I realized that #DB injection has always been broken, but with it
now getting always intercepted the problem has got worse: Documentation
clearly states that neither DR7.GD nor DebugCtl.LBR get cleared before
the intercept, so this is something we need to do before reflecting the
intercepted exception.

While adjusting this (and also with 4.1.6's strange use of
X86_EVENTTYPE_SW_EXCEPTION for #DB in mind) I further realized that
the special casing of individual vectors shouldn't be done for
software interrupts (resulting from INT $nn).

And then some code movement: Setting of CR2 for #PF can be done in the
same switch() statement (no need for a separate if()), and reading of
intr_info is better done close the the consumption of the variable
(allowing the compiler to generate better code / use fewer registers
for variables).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
master commit: 81a28f14009f4d8577a81b28dd06f6828112054b
master date: 2015-11-24 12:30:31 +0100
xen/arch/x86/hvm/vmx/vmx.c