rpms/kernel/F-7 linux-2.6-amd-disabled-svm-detect.patch, NONE, 1.1 kernel-2.6.spec, 1.3236, 1.3237
Chuck Ebbert (cebbert)
fedora-extras-commits at redhat.com
Wed Jun 27 22:10:59 UTC 2007
Author: cebbert
Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8941
Modified Files:
kernel-2.6.spec
Added Files:
linux-2.6-amd-disabled-svm-detect.patch
Log Message:
* Wed Jun 27 2007 Chuck Ebbert <cebbert at redhat.com>
- detect AMD svm disabled by BIOS (BZ #242765)
linux-2.6-amd-disabled-svm-detect.patch:
--- NEW FILE linux-2.6-amd-disabled-svm-detect.patch ---
commit cfc329b216bc3e54fe1107e8f714c7b3bc133224
Author: Joerg Roedel <joerg.roedel at amd.com>
Date: Fri Jun 22 12:29:50 2007 +0300
KVM: SVM: Reliably detect if SVM was disabled by BIOS
This patch adds an implementation to the svm is_disabled function to
detect reliably if the BIOS disabled the SVM feature in the CPU. This
fixes the issues with kernel panics when loading the kvm-amd module on
machines where SVM is available but disabled.
Signed-off-by: Joerg Roedel <joerg.roedel at amd.com>
Signed-off-by: Avi Kivity <avi at qumranet.com>
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 62ec38c..a0d4428 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1735,6 +1735,12 @@ static void svm_inject_page_fault(struct kvm_vcpu *vcpu,
static int is_disabled(void)
{
+ u64 vm_cr;
+
+ rdmsrl(MSR_VM_CR, vm_cr);
+ if (vm_cr & (1 << SVM_VM_CR_SVM_DISABLE))
+ return 1;
+
return 0;
}
diff --git a/drivers/kvm/svm.h b/drivers/kvm/svm.h
index 5e93814..005a9c5 100644
--- a/drivers/kvm/svm.h
+++ b/drivers/kvm/svm.h
@@ -175,8 +175,11 @@ struct __attribute__ ((__packed__)) vmcb {
#define SVM_CPUID_FUNC 0x8000000a
#define MSR_EFER_SVME_MASK (1ULL << 12)
+#define MSR_VM_CR 0xc0010114ULL
#define MSR_VM_HSAVE_PA 0xc0010117ULL
+#define SVM_VM_CR_SVM_DISABLE 4
+
#define SVM_SELECTOR_S_SHIFT 4
#define SVM_SELECTOR_DPL_SHIFT 5
#define SVM_SELECTOR_P_SHIFT 7
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3236
retrieving revision 1.3237
diff -u -r1.3236 -r1.3237
--- kernel-2.6.spec 25 Jun 2007 15:40:15 -0000 1.3236
+++ kernel-2.6.spec 27 Jun 2007 22:10:24 -0000 1.3237
@@ -440,6 +440,7 @@
Patch206: linux-2.6-x86-fsc-interrupt-controller-quirk.patch
Patch207: linux-2.6-x86-dell-hpet.patch
Patch209: linux-2.6-x86-64_pmtrace.patch
+Patch210: linux-2.6-amd-disabled-svm-detect.patch
# 300 - 399 ppc(64)
Patch300: linux-2.6-g5-therm-shutdown.patch
@@ -1134,6 +1135,8 @@
%patch207 -p1
# Add x86-64 PM_TRACE support.
%patch209 -p1
+# Detect if AMD svm was disabled by BIOS
+%patch210 -p1
#
# PowerPC
@@ -2453,6 +2456,9 @@
%endif
%changelog
+* Wed Jun 27 2007 Chuck Ebbert <cebbert at redhat.com>
+- detect AMD svm disabled by BIOS (BZ #242765)
+
* Mon Jun 25 2007 Chuck Ebbert <cebbert at redhat.com>
- update to latest utrace (16 patches)
More information about the scm-commits
mailing list