]> xenbits.xensource.com Git - xen.git/commit
VMX: fix/adjust trap injection
authorJan Beulich <jbeulich@suse.com>
Tue, 24 Nov 2015 11:30:31 +0000 (12:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 24 Nov 2015 11:30:31 +0000 (12:30 +0100)
commit81a28f14009f4d8577a81b28dd06f6828112054b
tree8e70680d0a9749bcc246851aa041c3dc520541bb
parent2bbe5009f9c7206623d801d13e1dfabda91d5e07
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>
xen/arch/x86/hvm/vmx/vmx.c