x86/vm_event: block interrupt injection for sync vm_events
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Mon, 21 Jan 2019 11:13:22 +0000 (12:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 21 Jan 2019 11:13:22 +0000 (12:13 +0100)
commitff9b9d540f1bddab278daa103291a217270cc587
tree2908fcc8194f863053da9bb06dbd4cd681a98d5b
parent1912f1220cf87aee28349469893f101980714a05
x86/vm_event: block interrupt injection for sync vm_events

Block interrupts (in vmx_intr_assist()) for the duration of
processing a sync vm_event (similarly to the strategy
currently used for single-stepping). Otherwise, attempting
to emulate an instruction when requested by a vm_event
reply may legitimately need to call e.g.
hvm_inject_page_fault(), which then overwrites the active
interrupt in the VMCS.

The sync vm_event handling path on x86/VMX is (roughly):
monitor_traps() -> process vm_event -> vmx_intr_assist()
(possibly writing VM_ENTRY_INTR_INFO) ->
hvm_vm_event_do_resume() -> hvm_emulate_one_vm_event()
(possibly overwriting the VM_ENTRY_INTR_INFO value).

This patch may also be helpful for the future removal
of may_defer in hvm_set_cr{0,3,4} and hvm_set_msr().

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/svm/intr.c
xen/arch/x86/hvm/vm_event.c
xen/arch/x86/hvm/vmx/intr.c
xen/arch/x86/vm_event.c
xen/common/monitor.c
xen/include/asm-arm/vm_event.h
xen/include/asm-x86/vm_event.h