]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: SVM: Add MSR-based feature support for serializing LFENCE
authorTom Lendacky <thomas.lendacky@amd.com>
Fri, 23 Feb 2018 23:18:20 +0000 (00:18 +0100)
committerBrian Maly <brian.maly@oracle.com>
Tue, 19 Feb 2019 18:43:48 +0000 (13:43 -0500)
commit351ff7a273f566e1efed1be14f01fc9510ad9002
tree42d854d4da04d3f42f51107da07b2f3d13ef63e6
parent84e0abceac3ef924f67657f4423521485f306474
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>
(cherry picked from commit d1d93fa90f1afa926cb060b7f78ab01a65705b4d)

Orabug: 29335274

Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
arch/x86/kvm/svm.c
arch/x86/kvm/x86.c
Contextual

Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kvm/svm.c
arch/x86/kvm/x86.c