Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0.49) Recognize POWER11 and future coverage on AIX and Linux #20738

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/oti/j9port.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ typedef enum J9ProcessorArchitecture {
PROCESSOR_PPC_P8,
PROCESSOR_PPC_P9,
PROCESSOR_PPC_P10,
PROCESSOR_PPC_P11,

PROCESSOR_X86_UNKNOWN,
PROCESSOR_X86_INTELPENTIUM,
Expand Down
16 changes: 14 additions & 2 deletions runtime/port/unix/j9sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ static intptr_t getAIXPPCDescription(struct J9PortLibrary *portLibrary, J9Proces
#define __power_10() (_system_configuration.implementation == POWER_10)
#endif /* !defined(__power_10) */

/*
* Please update the macro below to stay in sync with the latest POWER processor known to OpenJ9,
* ensuring CPU recognition is more robust than in the past. As the macro currently stands, any
* later processors are recognized as at least POWER11.
*/
#define POWER11_OR_ABOVE (0xFFFFFF00 << 11)
#define __power_latestKnownAndUp() J9_ARE_ANY_BITS_SET(_system_configuration.implementation, POWER11_OR_ABOVE)

#if defined(J9OS_I5_V6R1) /* vmx_version id only available since TL4 */
#define __power_vsx() (_system_configuration.vmx_version > 1)
#endif
Expand Down Expand Up @@ -578,7 +586,9 @@ mapPPCProcessor(const char *processorName)
} else if (0 == strncasecmp(processorName, "power9", 6)) {
rc = PROCESSOR_PPC_P9;
} else if (0 == strncasecmp(processorName, "power10", 7)) {
rc = PROCESSOR_PPC_P10;
rc = PROCESSOR_PPC_P10;
} else if (0 == strncasecmp(processorName, "power11", 7)) {
rc = PROCESSOR_PPC_P11;
}

return rc;
Expand Down Expand Up @@ -631,7 +641,9 @@ getAIXPPCDescription(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc)
} else if (__power_9()) {
desc->processor = PROCESSOR_PPC_P9;
} else if (__power_10()) {
desc->processor = PROCESSOR_PPC_P10;
desc->processor = PROCESSOR_PPC_P10;
} else if (__power_latestKnownAndUp()) {
desc->processor = PROCESSOR_PPC_P11;
} else {
desc->processor = PROCESSOR_PPC_UNKNOWN;
}
Expand Down