x86/vmx: Fixup removals of MSR load/save list entries
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Thu, 4 Apr 2019 16:25:10 +0000 (17:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 9 Apr 2019 09:58:18 +0000 (10:58 +0100)
commite28c0ee3356f52f589bbae54e89aaed25c1f599d
tree76c0a35f894f8a684dd191f2dcbb6d8fe041338d
parent66491f450e7f96e298a0e0d4686b3a6daaed9f4d
x86/vmx: Fixup removals of MSR load/save list entries

Commit 540d5422 ("x86/vmx: Support removing MSRs from the host/guest
load/save lists") introduced infrastructure finally exposed by
commit fd32dcfe ("x86/vmx: Don't leak EFER.NXE into guest context")
that led to a functional regression on Harpertown and earlier cores
(Gen 1 VT-x) due to MSR count being incorrectly set in VMCS.
As the result, as soon as guest EFER becomes equal to Xen EFER
(which eventually happens in almost every 64-bit VM) and its MSR
entry is supposed to be removed, a stale version of EFER is loaded
into a guest instead causing almost immediate guest failure.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmcs.c