x86/HVM: restrict permitted instructions during special purpose emulation
authorJan Beulich <jbeulich@suse.com>
Wed, 11 Jan 2017 12:40:49 +0000 (13:40 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Jan 2017 12:40:49 +0000 (13:40 +0100)
commit3dd00f7b566b09c7c9fe4af3caf3085b0cd53aab
treea1fc8916285bf4bb44e7eeb25fb9d61344db000e
parentfb12d2569614f0d4876196b5993e3a78dbca9fa2
x86/HVM: restrict permitted instructions during special purpose emulation

Most invocations of the instruction emulator are for VM exits where the
set of legitimate instructions (i.e. ones capable of causing the
respective exit) is rather small. Restrict the permitted sets via a new
callback, at once eliminating the abuse of handle_mmio() for non-MMIO
operations.

A seemingly unrelated comment adjustment is being done here to keep
x86_emulate() in sync with x86_insn_is_mem_write() (in the context of
which this was found to be wrong).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
12 files changed:
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/io.c
xen/arch/x86/hvm/ioreq.c
xen/arch/x86/hvm/svm/emulate.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/realmode.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h
xen/include/asm-x86/hvm/emulate.h
xen/include/asm-x86/hvm/io.h