]> xenbits.xensource.com Git - xen.git/commit
x86/vmx: implement Notify VM Exit
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 19 Dec 2022 10:24:14 +0000 (11:24 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Dec 2022 10:24:14 +0000 (11:24 +0100)
commit573279cde1c4e752d4df34bc65ffafa17573148e
tree3fd2ff9ff3fd3d3c4d50b6a2f3dbe65708e03773
parentd329b37d12132164c3894d0b6284be72576ef950
x86/vmx: implement Notify VM Exit

Under certain conditions guests can get the CPU stuck in an unbounded
loop without the possibility of an interrupt window to occur on
instruction boundary.  This was the case with the scenarios described
in XSA-156.

Make use of the Notify VM Exit mechanism, that will trigger a VM Exit
if no interrupt window occurs for a specified amount of time.  Note
that using the Notify VM Exit avoids having to trap #AC and #DB
exceptions, as Xen is guaranteed to get a VM Exit even if the guest
puts the CPU in a loop without an interrupt window, as such disable
the intercepts if the feature is available and enabled.

Setting the notify VM exit window to 0 is safe because there's a
threshold added by the hardware in order to have a sane window value.

Note the handling of EXIT_REASON_NOTIFY in the nested virtualization
case is passed to L0, and hence a nested guest being able to trigger a
notify VM exit with an invalid context would be able to crash the L1
hypervisor (by L0 destroying the domain).  Since we don't expose VM
Notify support to L1 it should already enable the required
protections in order to prevent VM Notify from triggering in the first
place.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
docs/misc/xen-command-line.pandoc
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/arch/x86/include/asm/hvm/vmx/vmcs.h
xen/arch/x86/include/asm/hvm/vmx/vmx.h
xen/arch/x86/include/asm/perfc_defn.h