summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2018-03-12 11:28:09 +0000
committerLuiz Souza <luiz@netgate.com>2018-03-14 16:40:56 -0300
commit851221bfbf64757933cfb7b818301961f6aa79b8 (patch)
tree2d814ef844639f2f628335e6f32ab3426af49e5c
parent10a865750fb0cf3fb1d196168b9b720bb32de1bd (diff)
downloadFreeBSD-src-851221bfbf64757933cfb7b818301961f6aa79b8.zip
FreeBSD-src-851221bfbf64757933cfb7b818301961f6aa79b8.tar.gz
fix r297857, do not modify CPU extension bits under virtual machines
r297857 was meant for real hardware only. PR: 213155 Submitted by: mainland@apeiron.net MFC after: 1 week (cherry picked from commit d03e4e760ff99689bd43e90930c3345e12a7bbd8)
-rw-r--r--sys/x86/x86/identcpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c
index 2c0af5f..63cd2cb 100644
--- a/sys/x86/x86/identcpu.c
+++ b/sys/x86/x86/identcpu.c
@@ -1392,7 +1392,8 @@ fix_cpuid(void)
* See BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 15h
* Models 60h-6Fh Processors, Publication # 50742.
*/
- if (cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x15) {
+ if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_AMD &&
+ CPUID_TO_FAMILY(cpu_id) == 0x15) {
msr = rdmsr(MSR_EXTFEATURES);
if ((msr & ((uint64_t)1 << 54)) == 0) {
msr |= (uint64_t)1 << 54;
OpenPOWER on IntegriCloud