* [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits
@ 2024-11-14 20:36 Babu Moger
2024-11-14 20:36 ` [PATCH v4 1/5] target/i386: Update EPYC CPU model " Babu Moger
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Babu Moger @ 2024-11-14 20:36 UTC (permalink / raw)
To: pbonzini; +Cc: davydov-max, qemu-devel, kvm
This series addresses the following issues with EPYC CPU models.
1. Update the L1, L2, L3 cache properties to match the actual hardware (PPR).
This needs to be updated on all the EPYC models.
2. RAS feature bits (SUCCOR, McaOverflowRecov).
3. Add SVM feature bits which are required in nested guests.
4. Add perfmon-v2 on Genoa.
5. Add missing feature bit fs-gs-base-ns(WRMSR to {FS,GS,KERNEL_G}S_BASE
is non-serializing).
Dropped EPYC-Turin model for now. Some of the feature bits
(srso-user-kernel-no, eraps, rapsize) are still work in progress in
the kernel. Will post them later.
Link: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zip
---
v4: Some of the patches in v3 are already merged. Posting the rest of the patches.
Dropped EPYC-Turin model for now. Will post them later.
Added SVM feature bit as discussed in
https://lore.kernel.org/kvm/b4b7abae-669a-4a86-81d3-d1f677a82929@redhat.com/
Fixed the cache property details as discussed in
https://lore.kernel.org/kvm/20230504205313.225073-8-babu.moger@amd.com/
Thanks to Maksim and Paolo for their feedback.
v3: Added SBPB, IBPB_BRTYPE, SRSO_USER_KERNEL_NO, ERAPS and RAPSIZE bits
to EPYC-Turin.
v2: Fixed couple of typos.
Added Reviewed-by tag from Zhao.
Rebased on top of 6d00c6f98256 ("Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging")
v3: https://lore.kernel.org/kvm/cover.1729807947.git.babu.moger@amd.com/
v2: https://lore.kernel.org/kvm/cover.1723068946.git.babu.moger@amd.com/
v1: https://lore.kernel.org/qemu-devel/cover.1718218999.git.babu.moger@amd.com/
Babu Moger (5):
target/i386: Update EPYC CPU model for Cache property, RAS, SVM
feature bits
target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM
feature bits
target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM
feature bits
target/i386: Add feature that indicates WRMSR to BASE reg is
non-serializing
target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and
SVM feature bits
target/i386/cpu.c | 299 +++++++++++++++++++++++++++++++++++++++++++++-
target/i386/cpu.h | 2 +
2 files changed, 300 insertions(+), 1 deletion(-)
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 1/5] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
@ 2024-11-14 20:36 ` Babu Moger
2024-11-14 20:36 ` [PATCH v4 2/5] target/i386: Update EPYC-Rome " Babu Moger
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Babu Moger @ 2024-11-14 20:36 UTC (permalink / raw)
To: pbonzini; +Cc: davydov-max, qemu-devel, kvm
Found that some of the cache properties are not set correctly for EPYC models.
l1d_cache.no_invd_sharing should not be true.
l1i_cache.no_invd_sharing should not be true.
L2.self_init should be true.
L2.inclusive should be true.
L3.inclusive should not be true.
L3.no_invd_sharing should be true.
Fix the cache properties.
Also add the missing RAS and SVM features bits on AMD
EPYC CPU models. The SVM feature bits are used in nested guests.
succor : Software uncorrectable error containment and recovery capability.
overflow-recov : MCA overflow recovery support.
lbrv : LBR virtualization
tsc-scale : MSR based TSC rate control
vmcb-clean : VMCB clean bits
flushbyasid : Flush by ASID
pause-filter : Pause intercept filter
pfthreshold : PAUSE filter threshold
v-vmsave-vmload : Virtualized VMLOAD and VMSAVE
vgif : Virtualized GIF
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 58c96eafea..a632c8030c 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2181,6 +2181,60 @@ static CPUCaches epyc_v4_cache_info = {
},
};
+static CPUCaches epyc_v5_cache_info = {
+ .l1d_cache = &(CPUCacheInfo) {
+ .type = DATA_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l1i_cache = &(CPUCacheInfo) {
+ .type = INSTRUCTION_CACHE,
+ .level = 1,
+ .size = 64 * KiB,
+ .line_size = 64,
+ .associativity = 4,
+ .partitions = 1,
+ .sets = 256,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l2_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 2,
+ .size = 512 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 1024,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .inclusive = true,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l3_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 3,
+ .size = 8 * MiB,
+ .line_size = 64,
+ .associativity = 16,
+ .partitions = 1,
+ .sets = 8192,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .no_invd_sharing = true,
+ .complex_indexing = false,
+ .share_level = CPU_TOPOLOGY_LEVEL_DIE,
+ },
+};
+
static const CPUCaches epyc_rome_cache_info = {
.l1d_cache = &(CPUCacheInfo) {
.type = DATA_CACHE,
@@ -5053,6 +5107,25 @@ static const X86CPUDefinition builtin_x86_defs[] = {
},
.cache_info = &epyc_v4_cache_info
},
+ {
+ .version = 5,
+ .props = (PropValue[]) {
+ { "overflow-recov", "on" },
+ { "succor", "on" },
+ { "lbrv", "on" },
+ { "tsc-scale", "on" },
+ { "vmcb-clean", "on" },
+ { "flushbyasid", "on" },
+ { "pause-filter", "on" },
+ { "pfthreshold", "on" },
+ { "v-vmsave-vmload", "on" },
+ { "vgif", "on" },
+ { "model-id",
+ "AMD EPYC-v5 Processor" },
+ { /* end of list */ }
+ },
+ .cache_info = &epyc_v5_cache_info
+ },
{ /* end of list */ }
}
},
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 2/5] target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM feature bits
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
2024-11-14 20:36 ` [PATCH v4 1/5] target/i386: Update EPYC CPU model " Babu Moger
@ 2024-11-14 20:36 ` Babu Moger
2024-11-14 20:36 ` [PATCH v4 3/5] target/i386: Update EPYC-Milan " Babu Moger
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Babu Moger @ 2024-11-14 20:36 UTC (permalink / raw)
To: pbonzini; +Cc: davydov-max, qemu-devel, kvm
Found that some of the cache properties are not set correctly for EPYC models.
l1d_cache.no_invd_sharing should not be true.
l1i_cache.no_invd_sharing should not be true.
L2.self_init should be true.
L2.inclusive should be true.
L3.inclusive should not be true.
L3.no_invd_sharing should be true.
Fix these cache properties.
Also add the missing RAS and SVM features bits on AMD EPYC-Rome. The SVM
feature bits are used in nested guests.
succor : Software uncorrectable error containment and recovery capability.
overflow-recov : MCA overflow recovery support.
lbrv : LBR virtualization
tsc-scale : MSR based TSC rate control
vmcb-clean : VMCB clean bits
flushbyasid : Flush by ASID
pause-filter : Pause intercept filter
pfthreshold : PAUSE filter threshold
v-vmsave-vmload : Virtualized VMLOAD and VMSAVE
vgif : Virtualized GIF
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a632c8030c..c21b232e75 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2343,6 +2343,60 @@ static const CPUCaches epyc_rome_v3_cache_info = {
},
};
+static const CPUCaches epyc_rome_v5_cache_info = {
+ .l1d_cache = &(CPUCacheInfo) {
+ .type = DATA_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l1i_cache = &(CPUCacheInfo) {
+ .type = INSTRUCTION_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l2_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 2,
+ .size = 512 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 1024,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .inclusive = true,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l3_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 3,
+ .size = 16 * MiB,
+ .line_size = 64,
+ .associativity = 16,
+ .partitions = 1,
+ .sets = 16384,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .no_invd_sharing = true,
+ .complex_indexing = false,
+ .share_level = CPU_TOPOLOGY_LEVEL_DIE,
+ },
+};
+
static const CPUCaches epyc_milan_cache_info = {
.l1d_cache = &(CPUCacheInfo) {
.type = DATA_CACHE,
@@ -5264,6 +5318,25 @@ static const X86CPUDefinition builtin_x86_defs[] = {
{ /* end of list */ }
},
},
+ {
+ .version = 5,
+ .props = (PropValue[]) {
+ { "overflow-recov", "on" },
+ { "succor", "on" },
+ { "lbrv", "on" },
+ { "tsc-scale", "on" },
+ { "vmcb-clean", "on" },
+ { "flushbyasid", "on" },
+ { "pause-filter", "on" },
+ { "pfthreshold", "on" },
+ { "v-vmsave-vmload", "on" },
+ { "vgif", "on" },
+ { "model-id",
+ "AMD EPYC-Rome-v5 Processor" },
+ { /* end of list */ }
+ },
+ .cache_info = &epyc_rome_v5_cache_info
+ },
{ /* end of list */ }
}
},
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 3/5] target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM feature bits
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
2024-11-14 20:36 ` [PATCH v4 1/5] target/i386: Update EPYC CPU model " Babu Moger
2024-11-14 20:36 ` [PATCH v4 2/5] target/i386: Update EPYC-Rome " Babu Moger
@ 2024-11-14 20:36 ` Babu Moger
2024-11-14 20:36 ` [PATCH v4 4/5] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing Babu Moger
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Babu Moger @ 2024-11-14 20:36 UTC (permalink / raw)
To: pbonzini; +Cc: davydov-max, qemu-devel, kvm
Found that some of the cache properties are not set correctly for EPYC models.
l1d_cache.no_invd_sharing should not be true.
l1i_cache.no_invd_sharing should not be true.
L2.self_init should be true.
L2.inclusive should be true.
L3.inclusive should not be true.
L3.no_invd_sharing should be true.
Fix these cache properties.
Also add the missing RAS and SVM features bits on AMD EPYC-Milan model.
The SVM feature bits are used in nested guests.
succor : Software uncorrectable error containment and recovery capability.
overflow-recov : MCA overflow recovery support.
lbrv : LBR virtualization
tsc-scale : MSR based TSC rate control
vmcb-clean : VMCB clean bits
flushbyasid : Flush by ASID
pause-filter : Pause intercept filter
pfthreshold : PAUSE filter threshold
v-vmsave-vmload : Virtualized VMLOAD and VMSAVE
vgif : Virtualized GIF
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index c21b232e75..4a4e9b81d8 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2505,6 +2505,60 @@ static const CPUCaches epyc_milan_v2_cache_info = {
},
};
+static const CPUCaches epyc_milan_v3_cache_info = {
+ .l1d_cache = &(CPUCacheInfo) {
+ .type = DATA_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l1i_cache = &(CPUCacheInfo) {
+ .type = INSTRUCTION_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l2_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 2,
+ .size = 512 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 1024,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .inclusive = true,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l3_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 3,
+ .size = 32 * MiB,
+ .line_size = 64,
+ .associativity = 16,
+ .partitions = 1,
+ .sets = 32768,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .no_invd_sharing = true,
+ .complex_indexing = false,
+ .share_level = CPU_TOPOLOGY_LEVEL_DIE,
+ },
+};
+
static const CPUCaches epyc_genoa_cache_info = {
.l1d_cache = &(CPUCacheInfo) {
.type = DATA_CACHE,
@@ -5412,6 +5466,25 @@ static const X86CPUDefinition builtin_x86_defs[] = {
},
.cache_info = &epyc_milan_v2_cache_info
},
+ {
+ .version = 3,
+ .props = (PropValue[]) {
+ { "overflow-recov", "on" },
+ { "succor", "on" },
+ { "lbrv", "on" },
+ { "tsc-scale", "on" },
+ { "vmcb-clean", "on" },
+ { "flushbyasid", "on" },
+ { "pause-filter", "on" },
+ { "pfthreshold", "on" },
+ { "v-vmsave-vmload", "on" },
+ { "vgif", "on" },
+ { "model-id",
+ "AMD EPYC-Milan-v3 Processor" },
+ { /* end of list */ }
+ },
+ .cache_info = &epyc_milan_v3_cache_info
+ },
{ /* end of list */ }
}
},
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 4/5] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
` (2 preceding siblings ...)
2024-11-14 20:36 ` [PATCH v4 3/5] target/i386: Update EPYC-Milan " Babu Moger
@ 2024-11-14 20:36 ` Babu Moger
2024-11-14 20:36 ` [PATCH v4 5/5] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits Babu Moger
2024-11-15 13:11 ` [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, " Maksim Davydov
5 siblings, 0 replies; 7+ messages in thread
From: Babu Moger @ 2024-11-14 20:36 UTC (permalink / raw)
To: pbonzini; +Cc: davydov-max, qemu-devel, kvm
Add the CPUID bit indicates that a WRMSR to MSR_FS_BASE, MSR_GS_BASE, or
MSR_KERNEL_GS_BASE is non-serializing.
CPUID_Fn80000021_EAX
Bit Feature description
1 FsGsKernelGsBaseNonSerializing.
WRMSR to FS_BASE, GS_BASE and KernelGSbase are non-serializing.
Link: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zip
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
target/i386/cpu.c | 2 +-
target/i386/cpu.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 4a4e9b81d8..107ecd2bde 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1235,7 +1235,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
[FEAT_8000_0021_EAX] = {
.type = CPUID_FEATURE_WORD,
.feat_names = {
- "no-nested-data-bp", NULL, "lfence-always-serializing", NULL,
+ "no-nested-data-bp", "fs-gs-base-ns", "lfence-always-serializing", NULL,
NULL, NULL, "null-sel-clr-base", NULL,
"auto-ibrs", NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index b65eedb617..12dafc9b32 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1032,6 +1032,8 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w);
/* Processor ignores nested data breakpoints */
#define CPUID_8000_0021_EAX_NO_NESTED_DATA_BP (1U << 0)
+/* WRMSR to FS_BASE, GS_BASE, or KERNEL_GS_BASE is non-serializing */
+#define CPUID_8000_0021_EAX_FS_GS_BASE_NS (1U << 1)
/* LFENCE is always serializing */
#define CPUID_8000_0021_EAX_LFENCE_ALWAYS_SERIALIZING (1U << 2)
/* Null Selector Clears Base */
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 5/5] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
` (3 preceding siblings ...)
2024-11-14 20:36 ` [PATCH v4 4/5] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing Babu Moger
@ 2024-11-14 20:36 ` Babu Moger
2024-11-15 13:11 ` [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, " Maksim Davydov
5 siblings, 0 replies; 7+ messages in thread
From: Babu Moger @ 2024-11-14 20:36 UTC (permalink / raw)
To: pbonzini; +Cc: davydov-max, qemu-devel, kvm
Found that some of the cache properties are not set correctly for EPYC models.
l1d_cache.no_invd_sharing should not be true.
l1i_cache.no_invd_sharing should not be true.
L2.self_init should be true.
L2.inclusive should be true.
L3.inclusive should not be true.
L3.no_invd_sharing should be true.
Fix these cache properties.
Also add the missing RAS and SVM features bits on AMD EPYC-Genoa model.
The SVM feature bits are used in nested guests.
perfmon-v2 : Allow guests to make use of the PerfMonV2 features.
succor : Software uncorrectable error containment and recovery capability.
overflow-recov : MCA overflow recovery support.
lbrv : LBR virtualization
tsc-scale : MSR based TSC rate control
vmcb-clean : VMCB clean bits
flushbyasid : Flush by ASID
pause-filter : Pause intercept filter
pfthreshold : PAUSE filter threshold
v-vmsave-vmload: Virtualized VMLOAD and VMSAVE
vgif : Virtualized GIF
fs-gs-base-ns : WRMSR to {FS,GS,KERNEL_GS}_BASE is non-serializing
The feature details are available in APM listed below [1].
[1] AMD64 Architecture Programmer's Manual Volume 2: System Programming
Publication # 24593 Revision 3.41.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
target/i386/cpu.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 107ecd2bde..1d241fcd13 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2613,6 +2613,59 @@ static const CPUCaches epyc_genoa_cache_info = {
},
};
+static const CPUCaches epyc_genoa_v2_cache_info = {
+ .l1d_cache = &(CPUCacheInfo) {
+ .type = DATA_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l1i_cache = &(CPUCacheInfo) {
+ .type = INSTRUCTION_CACHE,
+ .level = 1,
+ .size = 32 * KiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 64,
+ .lines_per_tag = 1,
+ .self_init = 1,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l2_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 2,
+ .size = 1 * MiB,
+ .line_size = 64,
+ .associativity = 8,
+ .partitions = 1,
+ .sets = 2048,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .inclusive = true,
+ .share_level = CPU_TOPOLOGY_LEVEL_CORE,
+ },
+ .l3_cache = &(CPUCacheInfo) {
+ .type = UNIFIED_CACHE,
+ .level = 3,
+ .size = 32 * MiB,
+ .line_size = 64,
+ .associativity = 16,
+ .partitions = 1,
+ .sets = 32768,
+ .lines_per_tag = 1,
+ .self_init = true,
+ .no_invd_sharing = true,
+ .complex_indexing = false,
+ .share_level = CPU_TOPOLOGY_LEVEL_DIE,
+ },
+};
/* The following VMX features are not supported by KVM and are left out in the
* CPU definitions:
*
@@ -5559,6 +5612,31 @@ static const X86CPUDefinition builtin_x86_defs[] = {
.xlevel = 0x80000022,
.model_id = "AMD EPYC-Genoa Processor",
.cache_info = &epyc_genoa_cache_info,
+ .versions = (X86CPUVersionDefinition[]) {
+ { .version = 1 },
+ {
+ .version = 2,
+ .props = (PropValue[]) {
+ { "overflow-recov", "on" },
+ { "succor", "on" },
+ { "lbrv", "on" },
+ { "tsc-scale", "on" },
+ { "vmcb-clean", "on" },
+ { "flushbyasid", "on" },
+ { "pause-filter", "on" },
+ { "pfthreshold", "on" },
+ { "v-vmsave-vmload", "on" },
+ { "vgif", "on" },
+ { "fs-gs-base-ns", "on" },
+ { "perfmon-v2", "on" },
+ { "model-id",
+ "AMD EPYC-Genoa-v2 Processor" },
+ { /* end of list */ }
+ },
+ .cache_info = &epyc_genoa_v2_cache_info
+ },
+ { /* end of list */ }
+ }
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
` (4 preceding siblings ...)
2024-11-14 20:36 ` [PATCH v4 5/5] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits Babu Moger
@ 2024-11-15 13:11 ` Maksim Davydov
5 siblings, 0 replies; 7+ messages in thread
From: Maksim Davydov @ 2024-11-15 13:11 UTC (permalink / raw)
To: Babu Moger; +Cc: qemu-devel, kvm, pbonzini
Hi!
On 11/14/24 23:36, Babu Moger wrote:
>
> This series addresses the following issues with EPYC CPU models.
>
> 1. Update the L1, L2, L3 cache properties to match the actual hardware (PPR).
> This needs to be updated on all the EPYC models.
> 2. RAS feature bits (SUCCOR, McaOverflowRecov).
> 3. Add SVM feature bits which are required in nested guests.
> 4. Add perfmon-v2 on Genoa.
> 5. Add missing feature bit fs-gs-base-ns(WRMSR to {FS,GS,KERNEL_G}S_BASE
> is non-serializing).
>
Seems good for me. I've tested cache changes.
If needed, Reviewed-by: Maksim Davydov <davydov-max@yandex-team.ru>
> Dropped EPYC-Turin model for now. Some of the feature bits
> (srso-user-kernel-no, eraps, rapsize) are still work in progress in
> the kernel. Will post them later.
>
> Link: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zip
> ---
> v4: Some of the patches in v3 are already merged. Posting the rest of the patches.
> Dropped EPYC-Turin model for now. Will post them later.
> Added SVM feature bit as discussed in
> https://lore.kernel.org/kvm/b4b7abae-669a-4a86-81d3-d1f677a82929@redhat.com/
> Fixed the cache property details as discussed in
> https://lore.kernel.org/kvm/20230504205313.225073-8-babu.moger@amd.com/
> Thanks to Maksim and Paolo for their feedback.
>
> v3: Added SBPB, IBPB_BRTYPE, SRSO_USER_KERNEL_NO, ERAPS and RAPSIZE bits
> to EPYC-Turin.
>
> v2: Fixed couple of typos.
> Added Reviewed-by tag from Zhao.
> Rebased on top of 6d00c6f98256 ("Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging")
>
> v3: https://lore.kernel.org/kvm/cover.1729807947.git.babu.moger@amd.com/
> v2: https://lore.kernel.org/kvm/cover.1723068946.git.babu.moger@amd.com/
> v1: https://lore.kernel.org/qemu-devel/cover.1718218999.git.babu.moger@amd.com/
>
>
> Babu Moger (5):
> target/i386: Update EPYC CPU model for Cache property, RAS, SVM
> feature bits
> target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM
> feature bits
> target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM
> feature bits
> target/i386: Add feature that indicates WRMSR to BASE reg is
> non-serializing
> target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and
> SVM feature bits
>
> target/i386/cpu.c | 299 +++++++++++++++++++++++++++++++++++++++++++++-
> target/i386/cpu.h | 2 +
> 2 files changed, 300 insertions(+), 1 deletion(-)
>
--
Best regards,
Maksim Davydov
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-15 13:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 20:36 [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits Babu Moger
2024-11-14 20:36 ` [PATCH v4 1/5] target/i386: Update EPYC CPU model " Babu Moger
2024-11-14 20:36 ` [PATCH v4 2/5] target/i386: Update EPYC-Rome " Babu Moger
2024-11-14 20:36 ` [PATCH v4 3/5] target/i386: Update EPYC-Milan " Babu Moger
2024-11-14 20:36 ` [PATCH v4 4/5] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing Babu Moger
2024-11-14 20:36 ` [PATCH v4 5/5] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits Babu Moger
2024-11-15 13:11 ` [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, " Maksim Davydov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).