x86/vvmx: fix I/O and MSR bitmaps mapping
authorSergey Dyasli <sergey.dyasli@citrix.com>
Wed, 14 Nov 2018 10:23:23 +0000 (10:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Nov 2018 18:42:48 +0000 (18:42 +0000)
commit5dbbaa0fe121716e868294ac67a3712007843352
tree414842bafef51b880d8f84bf93ca804d32ddf32c
parent8885ac7f1833ff54c1d4119d0242e89fb282e294
x86/vvmx: fix I/O and MSR bitmaps mapping

Currently Xen tries to map bitmaps during emulation of vmptrld and
vmwrite. This is wrong: a guest can store arbitrary values in those
fields.

Make bitmaps mapping happen only during a nested vmentry and only if
the appropriate execution controls are turned on by L1 hypervisor.

For performance reasons, Xen maps bitmaps only:

    1. During the first nested vmentry
    2. After L1 has changed an appropriate vmcs field
    3. After nvmx_purge_vvmcs() was previously called

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vvmx.c