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
This commit is contained in:
Andriy Gapon 2018-03-12 11:28:09 +00:00
parent 12c080e613
commit 7471a3fae8

View File

@ -1395,7 +1395,8 @@ fix_cpuid(void)
* See BIOS and Kernel Developers 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;