Author: jhb
Date: Fri Nov  6 17:52:04 2020
New Revision: 367424
URL: https://svnweb.freebsd.org/changeset/base/367424

Log:
  MFC 365642: Add constant for the DE_CFG MSR on AMD CPUs.

Modified:
  stable/12/sys/amd64/amd64/initcpu.c
  stable/12/sys/x86/include/specialreg.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/initcpu.c
==============================================================================
--- stable/12/sys/amd64/amd64/initcpu.c Fri Nov  6 16:33:42 2020        
(r367423)
+++ stable/12/sys/amd64/amd64/initcpu.c Fri Nov  6 17:52:04 2020        
(r367424)
@@ -103,7 +103,7 @@ init_amd(void)
        case 0x10:
        case 0x12:
                if ((cpu_feature2 & CPUID2_HV) == 0)
-                       wrmsr(0xc0011029, rdmsr(0xc0011029) | 1);
+                       wrmsr(MSR_DE_CFG, rdmsr(MSR_DE_CFG) | 1);
                break;
        }
 
@@ -152,9 +152,9 @@ init_amd(void)
        if (CPUID_TO_FAMILY(cpu_id) == 0x17 && CPUID_TO_MODEL(cpu_id) == 0x1 &&
            (cpu_feature2 & CPUID2_HV) == 0) {
                /* 1021 */
-               msr = rdmsr(0xc0011029);
+               msr = rdmsr(MSR_DE_CFG);
                msr |= 0x2000;
-               wrmsr(0xc0011029, msr);
+               wrmsr(MSR_DE_CFG, msr);
 
                /* 1033 */
                msr = rdmsr(MSR_LS_CFG);

Modified: stable/12/sys/x86/include/specialreg.h
==============================================================================
--- stable/12/sys/x86/include/specialreg.h      Fri Nov  6 16:33:42 2020        
(r367423)
+++ stable/12/sys/x86/include/specialreg.h      Fri Nov  6 17:52:04 2020        
(r367424)
@@ -1091,6 +1091,7 @@
 #define        MSR_EXTFEATURES 0xc0011005      /* Extended CPUID Features 
override */
 #define        MSR_LS_CFG      0xc0011020
 #define        MSR_IC_CFG      0xc0011021      /* Instruction Cache 
Configuration */
+#define        MSR_DE_CFG      0xc0011029      /* Decode Configuration */
 
 /* MSR_VM_CR related */
 #define        VM_CR_SVMDIS            0x10    /* SVM: disabled by BIOS */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to