vvmx: fixes after CR4 trapping optimizations
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 2 Mar 2018 16:19:29 +0000 (16:19 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Mar 2018 11:20:28 +0000 (11:20 +0000)
commit8b022d0005d5b941cd078f640cae04711f5536c1
tree1b0dee74a2851e4bb0184360b4c5c8e2c3c5b8ba
parent2b0f746d7f63fa8277044a844e0eb5800e565ec3
vvmx: fixes after CR4 trapping optimizations

Commit 40681735502 doesn't update nested VMX code in order to
take into account L1 CR4 host mask when nested guest (L2) writes
to CR4, and thus the mask written to CR4_GUEST_HOST_MASK is
likely not as restrictive as it should be.

Also the VVMCS GUEST_CR4 value should be updated to match the
underlying value when syncing the VVMCS state.

Fixes: 40681735502 ("vmx/hap: optimize CR4 trapping")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c