x86/vmx: Fix injection of #DB traps following XSA-156
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 4 Jan 2016 09:59:38 +0000 (09:59 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 5 Jan 2016 11:28:56 +0000 (11:28 +0000)
commit0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
treecb2dce1aae32065c9c334e858f89a0c0e43cb041
parentdcdb6588779ac8a0cab513d9a2d5ee0bb1dda1cd
x86/vmx: Fix injection of #DB traps following XSA-156

Most #DB exceptions are traps rather than faults, meaning that the instruction
pointer in the exception frame points after the instruction rather than at it.

However, VMX intercepts all have fault semantics, even when intercepting a
trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
the guest, by re-executing the same trapping instruction repeatedly.  This
breaks debugging inside the guest.

Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
use it to mirror the intercepted interrupt back to the guest.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c