File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3148,7 +3148,10 @@ uint VM_Version::cores_per_cpu() {
31483148 result = (_cpuid_info.dcp_cpuid4_eax .bits .cores_per_cpu + 1 );
31493149 }
31503150 } else if (is_amd_family ()) {
3151- result = (_cpuid_info.ext_cpuid8_ecx .bits .cores_per_cpu + 1 );
3151+ result = _cpuid_info.ext_cpuid8_ecx .bits .threads_per_cpu + 1 ;
3152+ if (cpu_family () >= 0x17 ) { // Zen or later
3153+ result /= _cpuid_info.ext_cpuid1E_ebx .bits .threads_per_core + 1 ;
3154+ }
31523155 } else if (is_zx ()) {
31533156 bool supports_topology = supports_processor_topology ();
31543157 if (supports_topology) {
Original file line number Diff line number Diff line change @@ -199,8 +199,8 @@ class VM_Version : public Abstract_VM_Version {
199199 union ExtCpuid8Ecx {
200200 uint32_t value;
201201 struct {
202- uint32_t cores_per_cpu : 8 ,
203- : 24 ;
202+ uint32_t threads_per_cpu : 8 ,
203+ : 24 ;
204204 } bits;
205205 };
206206
You can’t perform that action at this time.
0 commit comments