target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature and add EPYC-Turin CPU model
v5 cover target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature and add EPYC-Turin CPU model
Following changes are implemented in this series.
1. Fixed the cache(L2,L3) property details in all the EPYC models.
2. Add RAS feature bits (SUCCOR, McaOverflowRecov) on all EPYC models
3. Add missing SVM feature bits required for nested guests on all EPYC models
4. Add the missing feature bit fs-gs-base-ns(WRMSR to {FS,GS,KERNEL_G}S_BASE is non-serializing). This bit is added in EPYC-Genoa and EPYC-Turin models.
5. Add RAS, SVM, fs-gs-base-ns and perfmon-v2 on EPYC-Genoa and EPYC-Turin models.
6. Add support for EPYC-Turin.
(Add all the above feature bits and few additional bits movdiri, movdir64b,
avx512-vp2intersect, avx-vnni, sbpb, ibpb-brtype, srso-user-kernel-no).
---
v5: Add EPYC-Turin CPU model
Dropped ERAPS and RAPSIZE bits from EPYC-Turin models as kernel support for these bits are not done yet. Users can still use the options +eraps,+rapsize to test these featers.
Add Reviewed-by tag from Maksim for the patches already reviewed.
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/[email protected]/
Fixed the cache property details as discussed in
https://lore.kernel.org/kvm/[email protected]/
Thanks to Maksim and Paolo for their feedback.
v3: Added SBPB, IBPB_BRTYPE, SRSO_USER_KERNEL_NO, ERAPS and RAPSIZE bits
to EPYC-Turin.
Added new patch(1) to fix a minor typo.
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")
Previous revisions:
v4: https://lore.kernel.org/kvm/[email protected]/
v3: https://lore.kernel.org/kvm/[email protected]/
v2: https://lore.kernel.org/kvm/[email protected]/
v1: https://lore.kernel.org/qemu-devel/[email protected]/
Babu Moger (6):
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: Add support for EPYC-Turin model
target/i386/cpu.c | 437 +++++++++++++++++++++++++++++++++++++++++++++- target/i386/cpu.h | 2 + 2 files changed, 438 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
PATCH v5 1/6 target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits
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
--- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
target/i386/cpu.c +73 -0
@@ -2180,6 +2180,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 ,
@@ -5207,6 +5261,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 */ } } },
Signature · 1 line
2.34.1
PATCH v5 2/6 target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM feature bits
In reply to Babu MogerFound 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
--- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
target/i386/cpu.c +73 -0
@@ -2342,6 +2342,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 ,
@@ -5418,6 +5472,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 */ } } },
Signature · 1 line
2.34.1
PATCH v5 3/6 target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM feature bits
In reply to Babu MogerFound 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
--- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
target/i386/cpu.c +73 -0
@@ -2504,6 +2504,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 ,
@@ -5566,6 +5620,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 */ } } },
Signature · 1 line
2.34.1
PATCH v5 4/6 target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing
In reply to Babu MogerAdd 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.
--- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
target/i386/cpu.c +1 -1
@@ -1234,7 +1234,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,
target/i386/cpu.h +2 -0
@@ -1074,6 +1074,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 */
Signature · 1 line
2.34.1
PATCH v5 5/6 target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits
In reply to Babu MogerFound 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.
--- target/i386/cpu.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)
target/i386/cpu.c +78 -0
@@ -2612,6 +2612,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: *
@@ -5713,6 +5766,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 */ } + } }, };
Signature · 1 line
2.34.1
PATCH v5 6/6 target/i386: Add support for EPYC-Turin model
In reply to Babu MogerAdd the support for AMD EPYC zen 5 processors (EPYC-Turin).
Add the following new feature bits on top of the feature bits from the previous generation EPYC models.
movdiri : Move Doubleword as Direct Store Instruction
movdir64b : Move 64 Bytes as Direct Store Instruction
avx512-vp2intersect : AVX512 Vector Pair Intersection to a Pair
of Mask Register
avx-vnni : AVX VNNI Instruction
sbpb : Selective Branch Predictor Barrier
ibpb-brtype : IBPB includes branch type prediction flushing
srso-user-kernel-no : Not vulnerable to SRSO at the user-kernel boundary
--- target/i386/cpu.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+)
target/i386/cpu.c +138 -0
@@ -2665,6 +2665,61 @@ static const CPUCaches epyc_genoa_v2_cache_info = { .share_level = CPU_TOPOLOGY_LEVEL_DIE, }, }; + +static const CPUCaches epyc_turin_cache_info = { + .l1d_cache = &(CPUCacheInfo ) { + .type =DATA_CACHE , + .level =1 , + .size =48 * KiB, + .line_size =64 , + .associativity =12 , + .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 =16 , + .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 , + }, +}; +/* The following VMX features are not supported by KVM and are left out in the * CPU definitions: *
@@ -5792,6 +5847,89 @@ static const X86CPUDefinition builtin_x86_defs[] = { {/* end of list */ } } }, + { + .name = "EPYC-Turin", + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 26, + .model = 0, + .stepping = 0, + .features[FEAT_1_ECX ] = +CPUID_EXT_RDRAND |CPUID_EXT_F16C |CPUID_EXT_AVX | +CPUID_EXT_XSAVE |CPUID_EXT_AES |CPUID_EXT_POPCNT | +CPUID_EXT_MOVBE |CPUID_EXT_SSE42 |CPUID_EXT_SSE41 | +CPUID_EXT_PCID |CPUID_EXT_CX16 |CPUID_EXT_FMA | +CPUID_EXT_SSSE3 |CPUID_EXT_MONITOR |CPUID_EXT_PCLMULQDQ | + CPUID_EXT_SSE3, + .features[FEAT_1_EDX ] = +CPUID_SSE2 |CPUID_SSE |CPUID_FXSR |CPUID_MMX |CPUID_CLFLUSH | +CPUID_PSE36 |CPUID_PAT |CPUID_CMOV |CPUID_MCA |CPUID_PGE | +CPUID_MTRR |CPUID_SEP |CPUID_APIC |CPUID_CX8 |CPUID_MCE | +CPUID_PAE |CPUID_MSR |CPUID_TSC |CPUID_PSE |CPUID_DE | + CPUID_VME | CPUID_FP87, + .features[FEAT_6_EAX ] = + CPUID_6_EAX_ARAT, + .features[FEAT_7_0_EBX ] = +CPUID_7_0_EBX_FSGSBASE |CPUID_7_0_EBX_BMI1 |CPUID_7_0_EBX_AVX2 | +CPUID_7_0_EBX_SMEP |CPUID_7_0_EBX_BMI2 |CPUID_7_0_EBX_ERMS | +CPUID_7_0_EBX_INVPCID |CPUID_7_0_EBX_AVX512F | +CPUID_7_0_EBX_AVX512DQ |CPUID_7_0_EBX_RDSEED |CPUID_7_0_EBX_ADX | +CPUID_7_0_EBX_SMAP |CPUID_7_0_EBX_AVX512IFMA | +CPUID_7_0_EBX_CLFLUSHOPT |CPUID_7_0_EBX_CLWB | +CPUID_7_0_EBX_AVX512CD |CPUID_7_0_EBX_SHA_NI | + CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512VL, + .features[FEAT_7_0_ECX ] = +CPUID_7_0_ECX_AVX512_VBMI |CPUID_7_0_ECX_UMIP |CPUID_7_0_ECX_PKU | +CPUID_7_0_ECX_AVX512_VBMI2 |CPUID_7_0_ECX_GFNI | +CPUID_7_0_ECX_VAES |CPUID_7_0_ECX_VPCLMULQDQ | +CPUID_7_0_ECX_AVX512VNNI |CPUID_7_0_ECX_AVX512BITALG | +CPUID_7_0_ECX_AVX512_VPOPCNTDQ |CPUID_7_0_ECX_LA57 | +CPUID_7_0_ECX_RDPID |CPUID_7_0_ECX_MOVDIRI | + CPUID_7_0_ECX_MOVDIR64B, + .features[FEAT_7_0_EDX ] = + CPUID_7_0_EDX_FSRM | CPUID_7_0_EDX_AVX512_VP2INTERSECT, + .features[FEAT_7_1_EAX ] = + CPUID_7_1_EAX_AVX_VNNI | CPUID_7_1_EAX_AVX512_BF16, + .features[FEAT_8000_0001_ECX ] = +CPUID_EXT3_OSVW |CPUID_EXT3_3DNOWPREFETCH | +CPUID_EXT3_MISALIGNSSE |CPUID_EXT3_SSE4A |CPUID_EXT3_ABM | +CPUID_EXT3_CR8LEG |CPUID_EXT3_SVM |CPUID_EXT3_LAHF_LM | + CPUID_EXT3_TOPOEXT | CPUID_EXT3_PERFCORE, + .features[FEAT_8000_0001_EDX ] = +CPUID_EXT2_LM |CPUID_EXT2_RDTSCP |CPUID_EXT2_PDPE1GB | +CPUID_EXT2_FFXSR |CPUID_EXT2_MMXEXT |CPUID_EXT2_NX | + CPUID_EXT2_SYSCALL, + .features[FEAT_8000_0007_EBX ] = + CPUID_8000_0007_EBX_OVERFLOW_RECOV | CPUID_8000_0007_EBX_SUCCOR, + .features[FEAT_8000_0008_EBX ] = +CPUID_8000_0008_EBX_CLZERO |CPUID_8000_0008_EBX_XSAVEERPTR | +CPUID_8000_0008_EBX_WBNOINVD |CPUID_8000_0008_EBX_IBPB | +CPUID_8000_0008_EBX_IBRS |CPUID_8000_0008_EBX_STIBP | +CPUID_8000_0008_EBX_STIBP_ALWAYS_ON | + CPUID_8000_0008_EBX_AMD_SSBD | CPUID_8000_0008_EBX_AMD_PSFD, + .features[FEAT_8000_0021_EAX ] = +CPUID_8000_0021_EAX_NO_NESTED_DATA_BP | +CPUID_8000_0021_EAX_FS_GS_BASE_NS | +CPUID_8000_0021_EAX_LFENCE_ALWAYS_SERIALIZING | +CPUID_8000_0021_EAX_NULL_SEL_CLR_BASE | +CPUID_8000_0021_EAX_AUTO_IBRS |CPUID_8000_0021_EAX_SBPB | +CPUID_8000_0021_EAX_IBPB_BRTYPE | + CPUID_8000_0021_EAX_SRSO_USER_KERNEL_NO, + .features[FEAT_8000_0022_EAX ] = + CPUID_8000_0022_EAX_PERFMON_V2, + .features[FEAT_XSAVE ] = +CPUID_XSAVE_XSAVEOPT |CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1 | CPUID_XSAVE_XSAVES, + .features[FEAT_SVM ] = +CPUID_SVM_NPT |CPUID_SVM_LBRV |CPUID_SVM_NRIPSAVE | +CPUID_SVM_TSCSCALE |CPUID_SVM_VMCBCLEAN |CPUID_SVM_FLUSHASID | +CPUID_SVM_PAUSEFILTER |CPUID_SVM_PFTHRESHOLD | +CPUID_SVM_V_VMSAVE_VMLOAD |CPUID_SVM_VGIF | + CPUID_SVM_VNMI | CPUID_SVM_SVME_ADDR_CHK, + .xlevel = 0x80000022, + .model_id = "AMD EPYC-Turin Processor", + .cache_info = &epyc_turin_cache_info, + }, };/*
Signature · 1 line
2.34.1
Re: [PATCH v5 1/6] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits
In reply to Babu MogerReview
Quoted 11 lines
(quoted diff) +11
-0+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,
For consistency as the below parts, it's better to code true for all boolean types.
Review
Quoted 12 lines
(quoted diff) +12
-0+ .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,
ditto.
Others are fine for me, so,
And one more thing :-) ...
Review static const X86CPUDefinition builtin_x86_defs[] = { · line 5268
Quoted 12 lines
static const CPUCaches
epyc_rome_cache_info= {
.l1d_cache = &(CPUCacheInfo) {
.type =DATA_CACHE,(quoted diff) +5
-0@@ -5207,6 +5261,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, .cache_info = &epyc_v4_cache_info }, + { + .version = 5, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" },
When I checks the "overflow-recov" and "succor" enabling, I find these 2 bits are set unconditionally.
I'm not sure if all AMD platforms support both bits, do you think it's necessary to check the host support?
target/i386/kvm/kvm.c +4 -1
@@ -555,7 +555,10 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, cpuid_1_edx =kvm_arch_get_supported_cpuid (s,1 ,0 ,R_EDX ); ret |= cpuid_1_edx &CPUID_EXT2_AMD_ALIASES ; }else if (function ==0x80000007 && reg ==R_EBX ) { - ret |=CPUID_8000_0007_EBX_OVERFLOW_RECOV |CPUID_8000_0007_EBX_SUCCOR ; +uint32_t ebx; +host_cpuid (0x80000007 ,0 , &unused, &ebx, &unused, &unused); + + ret |= ebx & (CPUID_8000_0007_EBX_OVERFLOW_RECOV |CPUID_8000_0007_EBX_SUCCOR ); }else if (function ==KVM_CPUID_FEATURES && reg ==R_EAX ) {/* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't * be enabled without the in-kernel irqchip
Thanks,
Zhao
Re: [PATCH v5 2/6] target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM feature bits
In reply to Babu MogerQuoted 48 lines · Babu Moger
Date: Thu, 6 Feb 2025 13:28:35 -0600
From: Babu Moger <[email protected]>
Subject: [PATCH v5 2/6] target/i386: Update EPYC-Rome CPU model for Cache
property, RAS, SVM feature bits
X-Mailer: git-send-email 2.34.1Found 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 GIFSigned-off-by Babu Moger <[email protected]>Reviewed-by Maksim Davydov <[email protected]>--- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)target/i386/cpu.c +1
-0@@ -2342,6 +2342,60 @@ static const CPUCaches epyc_rome_v3_cache_info = { }, }; +static const CPUCaches epyc_rome_v5_cache_info = {
target/i386/cpu.c static const CPUCaches epyc_rome_v3_cache_info = { · line 2355
Quoted 10 lines
target/i386/cpu.c +10
-0+ .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 ,
This field could be true,
target/i386/cpu.c static const CPUCaches epyc_rome_v3_cache_info = { · line 2367
Quoted 12 lines
target/i386/cpu.c +12
-0+ .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 ,
ditto,
Compared to the previous cache model version, the differences can be checked. I feel that in the future, when we introduce a new cache model, it's better to avoid omitting items that default to false. This way, the cache model can correspond to the output of the cpuid tool, making it easier to compare and check.
Overall, LGTM,
Re: [PATCH v5 3/6] target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM feature bits
In reply to Babu Mogertarget/i386/cpu.c static const CPUCaches epyc_milan_v2_cache_info = { · line 2517
Quoted 11 lines
target/i386/cpu.c +11
-0+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 ,
true.
target/i386/cpu.c static const CPUCaches epyc_milan_v2_cache_info = { · line 2529
Quoted 12 lines
target/i386/cpu.c +12
-0+ .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 ,
true.
Re: [PATCH v5 4/6] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing
In reply to Babu MogerQuoted 14 lines · Babu Moger
Date: Thu, 6 Feb 2025 13:28:37 -0600
From: Babu Moger <[email protected]>
Subject: [PATCH v5 4/6] target/i386: Add feature that indicates WRMSR to
BASE reg is non-serializing
X-Mailer: git-send-email 2.34.1Add the CPUID bit indicates that a WRMSR to
MSR_FS_BASE,MSR_GS_BASE, orMSR_KERNEL_GS_BASEis non-serializing.
CPUID_Fn80000021_EAX
Bit Feature description
1 FsGsKernelGsBaseNonSerializing.
WRMSR toFS_BASE,GS_BASEand KernelGSbase are non-serializing.
Quoted 7 lines
Link https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zipSigned-off-by Babu Moger <[email protected]>Reviewed-by Maksim Davydov <[email protected]>--- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
Re: [PATCH v5 5/6] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits
In reply to Babu Mogertarget/i386/cpu.c static const CPUCaches epyc_genoa_cache_info = { · line 2625
Quoted 11 lines
target/i386/cpu.c +11
-0+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 ,
true.
target/i386/cpu.c static const CPUCaches epyc_genoa_cache_info = { · line 2637
Quoted 12 lines
target/i386/cpu.c +12
-0+ .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 ,
true.
Re: [PATCH v5 6/6] target/i386: Add support for EPYC-Turin model
In reply to Babu Mogertarget/i386/cpu.c static const CPUCaches epyc_genoa_v2_cache_info = { · line 2679
Quoted 11 lines
target/i386/cpu.c +11
-0+static const CPUCaches epyc_turin_cache_info = { + .l1d_cache = &(CPUCacheInfo ) { + .type =DATA_CACHE , + .level =1 , + .size =48 * KiB, + .line_size =64 , + .associativity =12 , + .partitions =1 , + .sets =64 , + .lines_per_tag =1 , + .self_init =1 ,
true.
target/i386/cpu.c static const CPUCaches epyc_genoa_v2_cache_info = { · line 2691
Quoted 12 lines
target/i386/cpu.c +12
-0+ .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 ,
true.
(And it would be better to add a Turin entry in docs/system/cpu-models-x86.rst.inc later :-).)
Thanks,
Zhao
Re: [PATCH v5 2/6] target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM feature bits
In reply to Zhao LiuHi Zhao,
Quoted 48 lines · Zhao Liu
Quoted 47 lines · Babu Moger
Date: Thu, 6 Feb 2025 13:28:35 -0600
From: Babu Moger <[email protected]>
Subject: [PATCH v5 2/6] target/i386: Update EPYC-Rome CPU model for Cache
property, RAS, SVM feature bits
X-Mailer: git-send-email 2.34.1Found 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 GIFSigned-off-by Babu Moger <[email protected]>Reviewed-by Maksim Davydov <[email protected]>--- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)target/i386/cpu.c +0
-0@@ -2342,6 +2342,60 @@ static const CPUCaches epyc_rome_v3_cache_info = { }, };
Quoted 13 lines
target/i386/cpu.c static const CPUCaches epyc_rome_v3_cache_info = { · line 2355
Quoted 11 lines
target/i386/cpu.c +11
-0+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 ,This field could be true,
Sure.
Quoted 14 lines
target/i386/cpu.c static const CPUCaches epyc_rome_v3_cache_info = { · line 2367
Quoted 13 lines
target/i386/cpu.c +12
-0+ .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 ,
Quoted 1 line
ditto,
Sure.
Quoted 6 lines
Compared to the previous cache model version, the differences can be checked. I feel that in the future, when we introduce a new cache model, it's better to avoid omitting items that default to false. This way, the cache model can correspond to the output of the cpuid tool, making it easier to compare and check.
Sounds good.
Quoted 6 lines
Overall, LGTM,
Reviewed-by Zhao Liu <[email protected]>
Thanks
Babu
Re: [PATCH v5 3/6] target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM feature bits
In reply to Zhao LiuHi Zhao,
Quoted 12 lines · Zhao Liu
target/i386/cpu.c static const CPUCaches epyc_milan_v2_cache_info = { · line 2517
Quoted 11 lines
target/i386/cpu.c +11
-0+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 ,
Quoted 1 line
true.
Sure.
Quoted 14 lines
target/i386/cpu.c static const CPUCaches epyc_milan_v2_cache_info = { · line 2529
Quoted 13 lines
target/i386/cpu.c +12
-0+ .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 ,
Quoted 1 line
true.
Sure.
Quoted 4 lines
Reviewed-by Zhao Liu <[email protected]>
Thanks
Babu
Re: [PATCH v5 4/6] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing
In reply to Zhao LiuHi Zhao,
Quoted 23 lines · Zhao Liu
Quoted 14 lines · Babu Moger
Date: Thu, 6 Feb 2025 13:28:37 -0600
From: Babu Moger <[email protected]>
Subject: [PATCH v5 4/6] target/i386: Add feature that indicates WRMSR to
BASE reg is non-serializing
X-Mailer: git-send-email 2.34.1Add the CPUID bit indicates that a WRMSR to
MSR_FS_BASE,MSR_GS_BASE, orMSR_KERNEL_GS_BASEis non-serializing.
CPUID_Fn80000021_EAX
Bit Feature description
1 FsGsKernelGsBaseNonSerializing.
WRMSR toFS_BASE,GS_BASEand KernelGSbase are non-serializing.Quoted 7 lines
Link https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zipSigned-off-by Babu Moger <[email protected]>Reviewed-by Maksim Davydov <[email protected]>--- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
Quoted 2 lines
Reviewed-by Zhao Liu <[email protected]>
Thank you,
Babu
Re: [PATCH v5 5/6] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits
In reply to Zhao LiuHi Zhao,
Quoted 12 lines · Zhao Liu
target/i386/cpu.c static const CPUCaches epyc_genoa_cache_info = { · line 2625
Quoted 11 lines
target/i386/cpu.c +11
-0+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 ,
Quoted 1 line
true.
Sure.
Quoted 14 lines
target/i386/cpu.c static const CPUCaches epyc_genoa_cache_info = { · line 2637
Quoted 13 lines
target/i386/cpu.c +12
-0+ .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 ,
Quoted 1 line
true.
Sure.
Quoted 4 lines
Reviewed-by Zhao Liu <[email protected]>
Thanks
Babu
Re: [PATCH v5 6/6] target/i386: Add support for EPYC-Turin model
In reply to Zhao LiuHi Zhao,
Quoted 12 lines · Zhao Liu
target/i386/cpu.c static const CPUCaches epyc_genoa_v2_cache_info = { · line 2679
Quoted 11 lines
target/i386/cpu.c +11
-0+static const CPUCaches epyc_turin_cache_info = { + .l1d_cache = &(CPUCacheInfo ) { + .type =DATA_CACHE , + .level =1 , + .size =48 * KiB, + .line_size =64 , + .associativity =12 , + .partitions =1 , + .sets =64 , + .lines_per_tag =1 , + .self_init =1 ,
Quoted 1 line
true.
Sure.
Quoted 14 lines
target/i386/cpu.c static const CPUCaches epyc_genoa_v2_cache_info = { · line 2691
Quoted 13 lines
target/i386/cpu.c +12
-0+ .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 ,
Quoted 1 line
true.
Sure.
Quoted 2 lines
Reviewed-by Zhao Liu <[email protected]>
thanks
Quoted 3 lines
(And it would be better to add a Turin entry in docs/system/cpu-models-x86.rst.inc later :-).)
Yes. Will add a new patch to update docs/system/cpu-models-x86.rst.inc.
Quoted 6 lines
Thanks,
Zhao
Re: [PATCH v5 1/6] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits
In reply to Zhao LiuQuoted 18 lines · Zhao Liu
And one more thing :-) ...
Review static const X86CPUDefinition builtin_x86_defs[] = { · line 5268
Quoted 12 lines
static const CPUCaches
epyc_rome_cache_info= {
.l1d_cache = &(CPUCacheInfo) {
.type =DATA_CACHE,(quoted diff) +5
-0@@ -5207,6 +5261,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, .cache_info = &epyc_v4_cache_info }, + { + .version = 5, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" },When I checks the "overflow-recov" and "succor" enabling, I find these 2 bits are set unconditionally.
Quoted 2 lines
I'm not sure if all AMD platforms support both bits, do you think it's necessary to check the host support?
Hi Zhao,
IIRC, we intentionally set these unconditionally since there is no specific support needed from the host side for guests to use these bits to handle MCEs. See the original discussion and rationale in this thread:
https://lore.kernel.org/all/[email protected]/
However, this discussion only applied to the SUCCOR feature and not the OVERFLOW_RECOV feature and now that you bring it up, I'm second guessing whether we can apply the same thinking to OVERFLOW_RECOV. I think we may want to keep setting the SUCCOR bit unconditionally, but we may want to handle OVERFLOW_RECOV normally. I'll have to track down some old hardware to see how this behaves when the hardware doesn't support it.
Thanks,
John
Quoted 22 lines
target/i386/kvm/kvm.c +4
-1@@ -555,7 +555,10 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, cpuid_1_edx =kvm_arch_get_supported_cpuid (s,1 ,0 ,R_EDX ); ret |= cpuid_1_edx &CPUID_EXT2_AMD_ALIASES ; }else if (function ==0x80000007 && reg ==R_EBX ) { - ret |=CPUID_8000_0007_EBX_OVERFLOW_RECOV |CPUID_8000_0007_EBX_SUCCOR ; +uint32_t ebx; +host_cpuid (0x80000007 ,0 , &unused, &ebx, &unused, &unused); + + ret |= ebx & (CPUID_8000_0007_EBX_OVERFLOW_RECOV |CPUID_8000_0007_EBX_SUCCOR ); }else if (function ==KVM_CPUID_FEATURES && reg ==R_EAX ) {/* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't * be enabled without the in-kernel irqchip Thanks,
Zhao
Re: [PATCH v5 1/6] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits
Hi John,
Quoted 29 lines · John Allen
Quoted 18 lines · Zhao Liu
And one more thing :-) ...
Review static const X86CPUDefinition builtin_x86_defs[] = { · line 5268
Quoted 12 lines
static const CPUCaches
epyc_rome_cache_info= {
.l1d_cache = &(CPUCacheInfo) {
.type =DATA_CACHE,(quoted diff) +5
-0@@ -5207,6 +5261,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, .cache_info = &epyc_v4_cache_info }, + { + .version = 5, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" },When I checks the "overflow-recov" and "succor" enabling, I find these 2 bits are set unconditionally.
Quoted 2 lines
I'm not sure if all AMD platforms support both bits, do you think it's necessary to check the host support?
Hi Zhao,
IIRC, we intentionally set these unconditionally since there is no specific support needed from the host side for guests to use these bits to handle MCEs. See the original discussion and rationale in this thread:
Quoted 8 lines
https://lore.kernel.org/all/[email protected]/
However, this discussion only applied to the SUCCOR feature and not the
OVERFLOW_RECOVfeature and now that you bring it up, I'm second guessing whether we can apply the same thinking toOVERFLOW_RECOV. I think we may want to keep setting the SUCCOR bit unconditionally, but we may want to handleOVERFLOW_RECOVnormally. I'll have to track down some old hardware to see how this behaves when the hardware doesn't support it.
Yes. We need to verify it on pre-EPYC hardware. Please let us know how it goes.
But, this series updates only the EPYC based CPU models. It should not be a concern here. Right?
Quoted 27 lines
Thanks,
JohnQuoted 22 lines
target/i386/kvm/kvm.c +4
-1@@ -555,7 +555,10 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, cpuid_1_edx =kvm_arch_get_supported_cpuid (s,1 ,0 ,R_EDX ); ret |= cpuid_1_edx &CPUID_EXT2_AMD_ALIASES ; }else if (function ==0x80000007 && reg ==R_EBX ) { - ret |=CPUID_8000_0007_EBX_OVERFLOW_RECOV |CPUID_8000_0007_EBX_SUCCOR ; +uint32_t ebx; +host_cpuid (0x80000007 ,0 , &unused, &ebx, &unused, &unused); + + ret |= ebx & (CPUID_8000_0007_EBX_OVERFLOW_RECOV |CPUID_8000_0007_EBX_SUCCOR ); }else if (function ==KVM_CPUID_FEATURES && reg ==R_EAX ) {/* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't * be enabled without the in-kernel irqchip Thanks,
Zhao
Signature · 2 lines
Thanks Babu Moger
Re: [PATCH v5 1/6] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits
Quoted 5 lines · Babu
Date: Wed, 26 Feb 2025 14:28:35 -0600
From: "Moger, Babu" <[email protected]>
Subject: Re: [PATCH v5 1/6] target/i386: Update EPYC CPU model for Cache
property, RAS, SVM feature bits
Quoted 40 lines
Hi John,
Quoted 37 lines · John Allen
Quoted 18 lines · Zhao Liu
And one more thing :-) ...
Review static const X86CPUDefinition builtin_x86_defs[] = { · line 5268
Quoted 12 lines
static const CPUCaches
epyc_rome_cache_info= {
.l1d_cache = &(CPUCacheInfo) {
.type =DATA_CACHE,(quoted diff) +5
-0@@ -5207,6 +5261,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, .cache_info = &epyc_v4_cache_info }, + { + .version = 5, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" },When I checks the "overflow-recov" and "succor" enabling, I find these 2 bits are set unconditionally.
Quoted 2 lines
I'm not sure if all AMD platforms support both bits, do you think it's necessary to check the host support?
Hi Zhao,
IIRC, we intentionally set these unconditionally since there is no specific support needed from the host side for guests to use these bits to handle MCEs. See the original discussion and rationale in this thread:
https://lore.kernel.org/all/[email protected]/
However, this discussion only applied to the SUCCOR feature and not the
OVERFLOW_RECOVfeature and now that you bring it up, I'm second guessing whether we can apply the same thinking toOVERFLOW_RECOV. I think we may want to keep setting the SUCCOR bit unconditionally, but we may want to handleOVERFLOW_RECOVnormally. I'll have to track down some old hardware to see how this behaves when the hardware doesn't support it.
Yes, thanks!
Quoted 5 lines
Yes. We need to verify it on pre-EPYC hardware. Please let us know how it goes.
But, this series updates only the EPYC based CPU models. It should not be a concern here. Right?
Yes, it doesn't block this series. :-)
Thank you both,
Zhao