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
8282392: [zero] Build broken on AArch64 #7633
Conversation
Fix as suggested by APH.
|
Webrevs
|
@a74nh This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 13 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@theRealAph, @shipilev) but any other Committer may sponsor as well.
|
/integrate |
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.
I think it is confusing to have AARCH64_PORT_ONLY
defines, to be honest. In the similar cases for X86, we just additionally protect these blocks with !ZERO. Something like:
#if defined(AARCH64) && !defined(ZERO)
ret_pc = pauth_strip_pointer(ret_pc);
#endif
See for example: jdk/src/hotspot/share/utilities/ticks.cpp Line 66 in 4e7fb41
|
That's what we looked at and it was more of a mess, IMO. In the end it's a judgment call which to have, and I've seen this kind of mistake, where a particular port is confused with a particular CPU, enough times that I think this is OK; YMMV. |
From the perspective of Zero maintenance, having the Zero-specific workarounds explicitly doing |
I think I understand your point, but IMO it's almost always easier to understand language which says what something is than what it isn't, and a simple name than a boolean expression. And that is more important, I believe. |
My only issue with that is that: becomes: Which is a little uglier. How about defining the macro something like: (ultimately, I'm happy with any of the above) |
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.
Fine, let's do it in this form.
/sponsor |
Going to push as commit c1a28aa.
Your commit was automatically rebased without conflicts. |
Sorry I missed this but this is stylistically awful IMHO. What is AARCH64_PORT_ONLY supposed to mean? IIUC it really means AARCH64_NATIVE_PORT_ONLY or AARCH64_NOT_ZERO_ONLY. I would much rather have seen @shipilev request to use a combination of CPU and ZERO to get this right - as used everywhere else when dealing with ZERO. |
I've seen this problem repeating over the years, caused by a failure to distinguish between an ifdef for the properties of a particular CPU and one for the implementation of a particular port. Courtesy of Zero, there is not a 1:1 mapping between these, and (judging by the problems we've seen) it is a frequent cause of confusion. Usually we catch the bugs before push, but not always. In my opinion that this is not merely a matter of people making mistakes, but of a style that is confusing, and will continue to be. |
I prefer adding the ifndef ZERO to guard these cases than this singular attempt to do something completely different. |
@theRealAph Hear, hear! Zero is causing a conceptual mess the way it is currently "injected" into hotspot. This mess also spills over into the build system. The core problem is that Zero claims to be a "CPU", which it clearly is not. And then a lot of workarounds needs to be installed everywhere to compensate for this confusion. A better solution would be to go back to CPU meaning just CPU, and introduce a second dimension along which to determine zero/non-zero. We might have to bikeshed for a while to find a good name for this second dimension (I can't come up with any ideal names straight away, anyway. INTERPRETED_ONLY vs COMPILED? ZERO vs NON_ZERO? Or ZERO vs ONE? :-)) Doing this would simplify the concepts and logic behind both the Hotspot code and the build system, and eliminate a class of errors that keep popping up all the time, due to this confusing design decision. |
Zero is a CPU-agnostic interpreter build, but our builds are inherently CPU-based, so Zero has to represent that "don't care" CPU because it has to replace some CPU specific code with Zero's C code. But then you have to build other CPU-specific parts of the JDK even when using Zero. Hence the approach of using CPU ifdefs combined with a check for Zero. |
Can you explain why it's not better? I don't want to waste your time by prolonging discussions unnecessarily, but it seems to me that this nomenclature conveys exactly what we mean: not so much running on a particular CPU, but a particular port. |
@theRealAph the word "port" may have a very specific meaning to you such that this macro conveys what you expect, but it doesn't to me. You have to know what is not considered part of a "port" when building Aarch64 - and that is simply when building Zero. So to me Zero should be part of any conditionalisation. e.g. (if macros work this way)
or the ifdefs @shipilev suggested. |
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7633/head:pull/7633
$ git checkout pull/7633
Update a local copy of the PR:
$ git checkout pull/7633
$ git pull https://git.openjdk.java.net/jdk pull/7633/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7633
View PR using the GUI difftool:
$ git pr show -t 7633
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7633.diff