View | Details | Raw Unified | Return to bug 186061 | Differences between
and this patch

Collapse All | Expand All

(-)amd64/amd64/pmap.c (-5 / +11 lines)
Lines 1008-1019 pmap_init(void) Link Here
1008
	}
1008
	}
1009
1009
1010
	/*
1010
	/*
1011
	 * If the kernel is running in a virtual machine on an AMD Family 10h
1011
	 * If the kernel is running on a virtual machine, then it must assume
1012
	 * processor, then it must assume that MCA is enabled by the virtual
1012
	 * that MCA is enabled by the hypervisor.  Moreover, the kernel must
1013
	 * machine monitor.
1013
	 * be prepared for the hypervisor changing the vendor and family that
1014
	 * are reported by CPUID.  Consequently, the workaround for AMD Family
1015
	 * 10h Erratum 383 is enabled if the processor's feature set does not
1016
	 * include at least one feature that is only supported by older Intel
1017
	 * or newer AMD processors.
1014
	 */
1018
	 */
1015
	if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD &&
1019
	if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 &&
1016
	    CPUID_TO_FAMILY(cpu_id) == 0x10)
1020
	    (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI |
1021
	    CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP |
1022
	    AMDID2_FMA4)) == 0)
1017
		workaround_erratum383 = 1;
1023
		workaround_erratum383 = 1;
1018
1024
1019
	/*
1025
	/*
(-)i386/i386/pmap.c (-5 / +11 lines)
Lines 752-763 pmap_init(void) Link Here
752
	pv_entry_high_water = 9 * (pv_entry_max / 10);
752
	pv_entry_high_water = 9 * (pv_entry_max / 10);
753
753
754
	/*
754
	/*
755
	 * If the kernel is running in a virtual machine on an AMD Family 10h
755
	 * If the kernel is running on a virtual machine, then it must assume
756
	 * processor, then it must assume that MCA is enabled by the virtual
756
	 * that MCA is enabled by the hypervisor.  Moreover, the kernel must
757
	 * machine monitor.
757
	 * be prepared for the hypervisor changing the vendor and family that
758
	 * are reported by CPUID.  Consequently, the workaround for AMD Family
759
	 * 10h Erratum 383 is enabled if the processor's feature set does not
760
	 * include at least one feature that is only supported by older Intel
761
	 * or newer AMD processors.
758
	 */
762
	 */
759
	if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD &&
763
	if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 &&
760
	    CPUID_TO_FAMILY(cpu_id) == 0x10)
764
	    (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI |
765
	    CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP |
766
	    AMDID2_FMA4)) == 0)
761
		workaround_erratum383 = 1;
767
		workaround_erratum383 = 1;
762
768
763
	/*
769
	/*

Return to bug 186061