OSDN Git Service

KVM: vmx: always initialize HOST_{FS,GS}_BASE to zero during setup
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 23 Jul 2018 19:32:48 +0000 (12:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Aug 2018 15:59:16 +0000 (17:59 +0200)
commitf3bbc0dcedf50d29d2d6fdfb16c5ec3e2368837f
tree2d2d58a649b9db40b605e2c1a72015611f21127e
parentd7ee039e2bab6341cdabf42d3036063cf91b40ea
KVM: vmx: always initialize HOST_{FS,GS}_BASE to zero during setup

The HOST_{FS,GS}_BASE fields are guaranteed to be written prior to
VMENTER, by way of vmx_prepare_switch_to_guest().  Initialize the
fields to zero for 64-bit kernels instead of pulling the base values
from their respective MSRs.  In addition to eliminating two RDMSRs,
vmx_prepare_switch_to_guest() can safely assume the initial value of
the fields is zero in all cases.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c