File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
com.oracle.svm.core/src/com/oracle/svm/core/amd64
com.oracle.svm.native.libchelper Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 43
43
* - substratevm/src/com.oracle.svm.native.libchelper/include/amd64hotspotcpuinfo.h
44
44
* - substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c
45
45
*/
46
- @ BasedOnJDKFile ("https://github.com/openjdk/jdk/blob/jdk-25+23 /src/hotspot/cpu/x86/vm_version_x86.hpp#L41-L348 " )
46
+ @ BasedOnJDKFile ("https://github.com/openjdk/jdk/blob/jdk-26+13 /src/hotspot/cpu/x86/vm_version_x86.hpp#L43-L351 " )
47
47
@ CLibrary (value = "libchelper" , requireStatic = true )
48
48
public class AMD64LibCHelper {
49
49
@ Platforms (Platform .AMD64 .class )
Original file line number Diff line number Diff line change @@ -188,8 +188,8 @@ typedef union {
188
188
typedef union {
189
189
uint32_t value ;
190
190
struct {
191
- uint32_t cores_per_cpu : 8 ,
192
- : 24 ;
191
+ uint32_t threads_per_cpu : 8 ,
192
+ : 24 ;
193
193
} bits ;
194
194
} ExtCpuid8Ecx ;
195
195
Original file line number Diff line number Diff line change @@ -211,7 +211,10 @@ static uint32_t cores_per_cpu(CpuidInfo *_cpuid_info) {
211
211
}
212
212
else if (is_amd_family (_cpuid_info ))
213
213
{
214
- result = (_cpuid_info -> ext_cpuid8_ecx .bits .cores_per_cpu + 1 );
214
+ result = _cpuid_info -> ext_cpuid8_ecx .bits .threads_per_cpu + 1 ;
215
+ if (cpu_family (_cpuid_info ) >= 0x17 ) { // Zen or later
216
+ result /= _cpuid_info -> ext_cpuid1E_ebx .bits .threads_per_core + 1 ;
217
+ }
215
218
}
216
219
else if (is_zx (_cpuid_info ))
217
220
{
You can’t perform that action at this time.
0 commit comments