Add a constant for the LS config MSR on AMD CPUs.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D19506
This commit is contained in:
John Baldwin 2019-05-23 23:37:11 +00:00
parent 540a97e342
commit bebcdc0073
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348210
2 changed files with 7 additions and 6 deletions

View File

@ -124,9 +124,9 @@ init_amd(void)
*/
if (CPUID_TO_FAMILY(cpu_id) == 0x16 && CPUID_TO_MODEL(cpu_id) <= 0xf) {
if ((cpu_feature2 & CPUID2_HV) == 0) {
msr = rdmsr(0xc0011020);
msr = rdmsr(MSR_LS_CFG);
msr |= (uint64_t)1 << 15;
wrmsr(0xc0011020, msr);
wrmsr(MSR_LS_CFG, msr);
}
}
@ -139,9 +139,9 @@ init_amd(void)
wrmsr(0xc0011029, msr);
/* 1033 */
msr = rdmsr(0xc0011020);
msr = rdmsr(MSR_LS_CFG);
msr |= 0x10;
wrmsr(0xc0011020, msr);
wrmsr(MSR_LS_CFG, msr);
/* 1049 */
msr = rdmsr(0xc0011028);
@ -149,9 +149,9 @@ init_amd(void)
wrmsr(0xc0011028, msr);
/* 1095 */
msr = rdmsr(0xc0011020);
msr = rdmsr(MSR_LS_CFG);
msr |= 0x200000000000000;
wrmsr(0xc0011020, msr);
wrmsr(MSR_LS_CFG, msr);
}
/*

View File

@ -1098,6 +1098,7 @@
#define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */
#define MSR_AMD_CPUID07 0xc0011002 /* CPUID 07 %ebx override */
#define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */
#define MSR_LS_CFG 0xc0011020
#define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */
/* MSR_VM_CR related */