]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
KVM: VMX: Intercept FS/GS_BASE MSR accesses for 32-bit KVM
authorSean Christopherson <seanjc@google.com>
Thu, 22 Apr 2021 02:38:31 +0000 (19:38 -0700)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:43 +0000 (17:46 -0600)
commit200705dfe555eb8e0fd2f7348d1e52b167a5c7a0
tree3a5a69e83a96e730c0e5dc80239e9e7bcd25addf
parentc3a4aa70da4e2fe6409ca885d419dc7712941c03
KVM: VMX: Intercept FS/GS_BASE MSR accesses for 32-bit KVM

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit dbdd096a5a74b94f6b786a47baef2085859b0dce ]

Disable pass-through of the FS and GS base MSRs for 32-bit KVM.  Intel's
SDM unequivocally states that the MSRs exist if and only if the CPU
supports x86-64.  FS_BASE and GS_BASE are mostly a non-issue; a clever
guest could opportunistically use the MSRs without issue.  KERNEL_GS_BASE
is a bigger problem, as a clever guest would subtly be broken if it were
migrated, as KVM disallows software access to the MSRs, and unlike the
direct variants, KERNEL_GS_BASE needs to be explicitly migrated as it's
not captured in the VMCS.

Fixes: 25c5f225beda ("KVM: VMX: Enable MSR Bitmap feature")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210422023831.3473491-1-seanjc@google.com>
[*NOT* for stable kernels. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c