]> xenbits.xensource.com Git - xen.git/commit
VMX: fix/adjust trap injection
authorJan Beulich <jbeulich@suse.com>
Tue, 15 Dec 2015 14:53:12 +0000 (15:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 15 Dec 2015 14:53:12 +0000 (15:53 +0100)
commitf70eaf9f0784297831bea168d416b9c834d667db
treec7189d262233f487728efb8e7fe848e2a6cea3ae
parent52f7217a10ffb692ae0e320830c17dcfeb7f6810
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