aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2018-02-24 00:18:20 +0100
committerRadim Krčmář <rkrcmar@redhat.com>2018-03-01 19:00:28 +0100
commitd1d93fa90f1afa926cb060b7f78ab01a65705b4d (patch)
tree7457ea6cfaa712675dfada0cbf11ea650c7f605c /arch/x86/kvm/x86.c
parentKVM: x86: Add a framework for supporting MSR-based features (diff)
downloadlinux-dev-d1d93fa90f1afa926cb060b7f78ab01a65705b4d.tar.xz
linux-dev-d1d93fa90f1afa926cb060b7f78ab01a65705b4d.zip
KVM: SVM: Add MSR-based feature support for serializing LFENCE
In order to determine if LFENCE is a serializing instruction on AMD processors, MSR 0xc0011029 (MSR_F10H_DECFG) must be read and the state of bit 1 checked. This patch will add support to allow a guest to properly make this determination. Add the MSR feature callback operation to svm.c and add MSR 0xc0011029 to the list of MSR-based features. If LFENCE is serializing, then the feature is supported, allowing the hypervisor to set the value of the MSR that guest will see. Support is also added to write (hypervisor only) and read the MSR value for the guest. A write by the guest will result in a #GP. A read by the guest will return the value as set by the host. In this way, the support to expose the feature to the guest is controlled by the hypervisor. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to '')
-rw-r--r--arch/x86/kvm/x86.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 239fc1fd7845..54b4ed55945b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1054,6 +1054,7 @@ static unsigned num_emulated_msrs;
* can be used by a hypervisor to validate requested CPU features.
*/
static u32 msr_based_features[] = {
+ MSR_F10H_DECFG,
};
static unsigned int num_msr_based_features;