-
Notifications
You must be signed in to change notification settings - Fork 721
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
Unify processor detection on Z #3956
Unify processor detection on Z #3956
Conversation
Jenkins test sanity zlinux JDK8 |
{ | ||
ret_machine = (TR_S390MachineType)machine; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the logic that existed prior to this PR which would force us to return 0 as the machine id even though we did extract it.
@@ -415,215 +219,78 @@ CPU::getS390SupportsGuardedStorageFacility() | |||
//////////////////////////////////////////////////////////////////////////////// | |||
|
|||
void | |||
CPU::initializeS390zLinuxProcessorFeatures() | |||
CPU::initializeS390ProcessorFeatures() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializeS390zLinuxProcessorFeatures
and initializeS390zOSProcessorFeatures
are now unified into this function. I suggest to reviewers to compare the before and after for both functions against this new one and convince themselves that they are indeed the same semantically.
{ | ||
J9ProcessorDesc *processorDesc = TR::Compiler->target.cpu.TO_PORTLIB_getJ9ProcessorDesc(); | ||
J9PortLibrary *privatePortLibrary = TR::Compiler->portLib; | ||
|
||
// The following conditionals are dependent on each other and must occur in this order | ||
TR::Compiler->target.cpu.setS390SupportsZ9(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added as our ALS is z9.
I'll fix the copyright checks when I start addressing reviews so as to not cancel the currently running build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Added a few questions / comments on things not directly related to the proposed changes.
1cab02a
to
332b5f3
Compare
I'll be out of office with questionable internet access. Perhaps @vijaysun-omr or @gita-omr would be able to take over this PR's review? I think the only outstanding issue is related to HIGH_GPR support settings. |
41df2f3
to
4522048
Compare
Unmarking WIP as everything has been addressed. @vijaysun-omr / @gita-omr are you able to take ownership of this PR as per the above comment by @joransiu? |
Assigned to myself. Which tests should we run? |
This touches some common files as well. So to be conservative let's run everything: Jenkins test sanity all JDK8 |
So it's been a while since this guy has been ready, however I will be away next week and back on the 13th. I would dislike if merging this change causes problems while I'm away and not here to fix anything. Having said that I think it's best to wait until my return before merging this. I'll continue background testing to make sure nothing has regressed since. |
Avoid using an enumerated `TR_S390MachineType` type to represent machine ids to future proof the JVM running on a more modern processor for which we do not know the machine id for. A typical example of this is running an older JVM, say very early Java 8 snapshots of OpenJ9 which did not have z14 support. In such cases the machine id for z14 would not match any of the existing machine ids in the codebase at the time and we would start reporting invalid machine ids in the verbose log ("0" to be precise). In this change we use the true machine id as parsed from z/OS or Linux on Z and display the number that is returned as an integer. The actual machine detection logic relies on the port library which uses STFLE bits to determine the processor we are executing on. This means processor detection is unaffected by our changes here. Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
In the JIT compiler, similarly to j9sysinfo.c we can assume STFLE bits are always available since our ALS is z9. Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
Both z/OS and Linux should rely on the answers given by the port library on whether we support particular processor features. The code was already more or less the same between the two functions, however there were some redundancies in checking for OS support as the port library already takes care of this for us in j9sysinfo.c Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
Several of these functions are already implemented in j9sysinfo.c where they really belong. Deprecate the support in the JIT. Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
4522048
to
9ae9991
Compare
We cannot use `utsname` on Linux as it simply returns "s390x" in `info.machine`. Add a comment directly in the code as to why this restriction is there. Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
9ae9991
to
fd8342d
Compare
@joransiu I have removed the "enabling HPRs on Linux on Z 31-bit" commit from this PR. The reason is because I have another rather large change coming to remove This PR should be ready to go. Launching builds on your behalf. Jenkins test sanity all JDK8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the commits again. LGTM.
This PR contains several incremental changes. The end goal was to really print the machine id if the processor was unknown. Previously we extract the machine id and compare against a list of known ids. If no id matches we return 0, and when verbose printout is requested via
-Xjit:verbose
we print 0 as the machine id.This is not ideal as we would like to print the machine id even if we did not match it to one of the known ones. We fix this problem here by eliminating the use of
TR_S390MachineType
enum and just use the machine id as anint32_t
. In doing so we identify several other opportunities in the area of processor detection, such as severe code duplication, and responsibility movement to the port library.Please see each commit for a description of what was changed and why.