Skip to content

Commit 059e5c3

Browse files
codomaniasuryasaimadhu
authored andcommitted
x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG
The SYSCFG MSR continued being updated beyond the K8 family; drop the K8 name from it. Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Brijesh Singh <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Joerg Roedel <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b81fc74 commit 059e5c3

File tree

14 files changed

+26
-26
lines changed

14 files changed

+26
-26
lines changed

Documentation/virt/kvm/amd-memory-encryption.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ to SEV::
2222
[ecx]:
2323
Bits[31:0] Number of encrypted guests supported simultaneously
2424

25-
If support for SEV is present, MSR 0xc001_0010 (MSR_K8_SYSCFG) and MSR 0xc001_0015
25+
If support for SEV is present, MSR 0xc001_0010 (MSR_AMD64_SYSCFG) and MSR 0xc001_0015
2626
(MSR_K7_HWCR) can be used to determine if it can be enabled::
2727

2828
0xc001_0010:

Documentation/x86/amd-memory-encryption.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ CPUID function 0x8000001f reports information related to SME::
5353
system physical addresses, not guest physical
5454
addresses)
5555

56-
If support for SME is present, MSR 0xc00100010 (MSR_K8_SYSCFG) can be used to
56+
If support for SME is present, MSR 0xc00100010 (MSR_AMD64_SYSCFG) can be used to
5757
determine if SME is enabled and/or to enable memory encryption::
5858

5959
0xc0010010:
@@ -79,7 +79,7 @@ The state of SME in the Linux kernel can be documented as follows:
7979
The CPU supports SME (determined through CPUID instruction).
8080

8181
- Enabled:
82-
Supported and bit 23 of MSR_K8_SYSCFG is set.
82+
Supported and bit 23 of MSR_AMD64_SYSCFG is set.
8383

8484
- Active:
8585
Supported, Enabled and the Linux kernel is actively applying
@@ -89,7 +89,7 @@ The state of SME in the Linux kernel can be documented as follows:
8989
SME can also be enabled and activated in the BIOS. If SME is enabled and
9090
activated in the BIOS, then all memory accesses will be encrypted and it will
9191
not be necessary to activate the Linux memory encryption support. If the BIOS
92-
merely enables SME (sets bit 23 of the MSR_K8_SYSCFG), then Linux can activate
92+
merely enables SME (sets bit 23 of the MSR_AMD64_SYSCFG), then Linux can activate
9393
memory encryption by default (CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=y) or
9494
by supplying mem_encrypt=on on the kernel command line. However, if BIOS does
9595
not enable SME, then Linux will not be able to activate memory encryption, even

arch/x86/include/asm/msr-index.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,9 @@
537537
/* K8 MSRs */
538538
#define MSR_K8_TOP_MEM1 0xc001001a
539539
#define MSR_K8_TOP_MEM2 0xc001001d
540-
#define MSR_K8_SYSCFG 0xc0010010
541-
#define MSR_K8_SYSCFG_MEM_ENCRYPT_BIT 23
542-
#define MSR_K8_SYSCFG_MEM_ENCRYPT BIT_ULL(MSR_K8_SYSCFG_MEM_ENCRYPT_BIT)
540+
#define MSR_AMD64_SYSCFG 0xc0010010
541+
#define MSR_AMD64_SYSCFG_MEM_ENCRYPT_BIT 23
542+
#define MSR_AMD64_SYSCFG_MEM_ENCRYPT BIT_ULL(MSR_AMD64_SYSCFG_MEM_ENCRYPT_BIT)
543543
#define MSR_K8_INT_PENDING_MSG 0xc0010055
544544
/* C1E active bits in int pending message */
545545
#define K8_INTP_C1E_ACTIVE_MASK 0x18000000

arch/x86/kernel/cpu/amd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
593593
*/
594594
if (cpu_has(c, X86_FEATURE_SME) || cpu_has(c, X86_FEATURE_SEV)) {
595595
/* Check if memory encryption is enabled */
596-
rdmsrl(MSR_K8_SYSCFG, msr);
597-
if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT))
596+
rdmsrl(MSR_AMD64_SYSCFG, msr);
597+
if (!(msr & MSR_AMD64_SYSCFG_MEM_ENCRYPT))
598598
goto clear_all;
599599

600600
/*

arch/x86/kernel/cpu/mtrr/cleanup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ int __init amd_special_default_mtrr(void)
836836
if (boot_cpu_data.x86 < 0xf)
837837
return 0;
838838
/* In case some hypervisor doesn't pass SYSCFG through: */
839-
if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
839+
if (rdmsr_safe(MSR_AMD64_SYSCFG, &l, &h) < 0)
840840
return 0;
841841
/*
842842
* Memory between 4GB and top of mem is forced WB by this magic bit.

arch/x86/kernel/cpu/mtrr/generic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ static inline void k8_check_syscfg_dram_mod_en(void)
5353
(boot_cpu_data.x86 >= 0x0f)))
5454
return;
5555

56-
rdmsr(MSR_K8_SYSCFG, lo, hi);
56+
rdmsr(MSR_AMD64_SYSCFG, lo, hi);
5757
if (lo & K8_MTRRFIXRANGE_DRAM_MODIFY) {
5858
pr_err(FW_WARN "MTRR: CPU %u: SYSCFG[MtrrFixDramModEn]"
5959
" not cleared by BIOS, clearing this bit\n",
6060
smp_processor_id());
6161
lo &= ~K8_MTRRFIXRANGE_DRAM_MODIFY;
62-
mtrr_wrmsr(MSR_K8_SYSCFG, lo, hi);
62+
mtrr_wrmsr(MSR_AMD64_SYSCFG, lo, hi);
6363
}
6464
}
6565

arch/x86/kernel/mmconf-fam10h_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void get_fam10h_pci_mmconf_base(void)
9595
return;
9696

9797
/* SYS_CFG */
98-
address = MSR_K8_SYSCFG;
98+
address = MSR_AMD64_SYSCFG;
9999
rdmsrl(address, val);
100100

101101
/* TOP_MEM2 is not enabled? */

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,8 @@ static __init void svm_adjust_mmio_mask(void)
858858
return;
859859

860860
/* If memory encryption is not enabled, use existing mask */
861-
rdmsrl(MSR_K8_SYSCFG, msr);
862-
if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT))
861+
rdmsrl(MSR_AMD64_SYSCFG, msr);
862+
if (!(msr & MSR_AMD64_SYSCFG_MEM_ENCRYPT))
863863
return;
864864

865865
enc_bit = cpuid_ebx(0x8000001f) & 0x3f;

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3402,7 +3402,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
34023402
case MSR_IA32_LASTBRANCHTOIP:
34033403
case MSR_IA32_LASTINTFROMIP:
34043404
case MSR_IA32_LASTINTTOIP:
3405-
case MSR_K8_SYSCFG:
3405+
case MSR_AMD64_SYSCFG:
34063406
case MSR_K8_TSEG_ADDR:
34073407
case MSR_K8_TSEG_MASK:
34083408
case MSR_VM_HSAVE_PA:

arch/x86/mm/mem_encrypt_identity.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ void __init sme_enable(struct boot_params *bp)
529529
/*
530530
* No SME if Hypervisor bit is set. This check is here to
531531
* prevent a guest from trying to enable SME. For running as a
532-
* KVM guest the MSR_K8_SYSCFG will be sufficient, but there
532+
* KVM guest the MSR_AMD64_SYSCFG will be sufficient, but there
533533
* might be other hypervisors which emulate that MSR as non-zero
534534
* or even pass it through to the guest.
535535
* A malicious hypervisor can still trick a guest into this
@@ -542,8 +542,8 @@ void __init sme_enable(struct boot_params *bp)
542542
return;
543543

544544
/* For SME, check the SYSCFG MSR */
545-
msr = __rdmsr(MSR_K8_SYSCFG);
546-
if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT))
545+
msr = __rdmsr(MSR_AMD64_SYSCFG);
546+
if (!(msr & MSR_AMD64_SYSCFG_MEM_ENCRYPT))
547547
return;
548548
} else {
549549
/* SEV state cannot be controlled by a command line option */

0 commit comments

Comments
 (0)