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

8297763: Fix missing stub code expansion before align() in shared trampolines #11414

Closed
wants to merge 2 commits into from

Conversation

zhengxiaolinX
Copy link
Contributor

@zhengxiaolinX zhengxiaolinX commented Nov 29, 2022

This patch fixes missing stub code expansion logic before align() for AArch64 and RISC-V.

The align() at most creates 4-byte padding, so a NativeInstruction::instruction_size is enough.

I am considering pre-calculating the total trampoline sizes and allocating them in batches, but maybe after this one, for this is a quick fix to unblock #11188. Please see that thread.

The assert_alignment(pc()); added in the RISC-V part shows that RVC doesn't change the trampoline stub / static stub logic, so there is no need to adjust the trampoline size for it. [1]

Tested AArch64 hotspot tier1~3, and 4 is still running; tested RISC-V hotspot tier1~2, and 3~4 are still running.

Thanks,
Xiaolin

[1]

address stub = start_a_stub(NativeInstruction::instruction_size
+ NativeCallTrampolineStub::instruction_size);


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8297763: Fix missing stub code expansion before align() in shared trampolines

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11414/head:pull/11414
$ git checkout pull/11414

Update a local copy of the PR:
$ git checkout pull/11414
$ git pull https://git.openjdk.org/jdk pull/11414/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11414

View PR using the GUI difftool:
$ git pr show -t 11414

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11414.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 29, 2022

👋 Welcome back xlinzheng! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 29, 2022
@openjdk
Copy link

openjdk bot commented Nov 29, 2022

@zhengxiaolinX The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Nov 29, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 29, 2022

Webrevs

@@ -52,6 +52,11 @@ static bool emit_shared_trampolines(CodeBuffer* cb, CodeBuffer::SharedTrampoline
bool p_succeeded = true;
auto emit = [&](address dest, const CodeBuffer::Offsets &offsets) {
masm.set_code_section(cb->stubs());
if (cb->stubs()->maybe_expand_to_ensure_remaining(NativeInstruction::instruction_size) && cb->blob() == NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoud we add a check for the real code alignment here and put maybe_expand_to_ensure_remaining() and masm.align(wordSize) operations under that check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion - yes, indeed.

@zhengxiaolinX
Copy link
Contributor Author

zhengxiaolinX commented Dec 1, 2022

Gentle ping - may I have a second review please (the AArch64 part of the changes)? The latest change has passed hotspot tier1~tier4 on both platforms.

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me.

@openjdk
Copy link

openjdk bot commented Dec 1, 2022

@zhengxiaolinX This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8297763: Fix missing stub code expansion before align() in shared trampolines

Reviewed-by: fyang, luhenry

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 104 new commits pushed to the master branch:

  • 914ef07: 8297609: Add application/wasm MIME type for wasm file extension
  • a71d91b: 8298067: Persistent test failures after 8296012
  • 87572d4: 8298068: ProblemList tests failing due to JDK-8297235
  • 0edb5d0: 8297683: Use enhanced-for cycle instead of Enumeration in java.security.jgss
  • c67166f: 8298003: NMT: fatal block printout does not show the correct corruption address
  • 99e2ef4: 8298054: ProblemList jdk/jfr/api/consumer/recordingstream/TestStop.java
  • 6065516: 8291418: adjust monitor deflation logging and deflate_idle_monitors use
  • 6e54705: 8295424: adjust timeout for another JLI GetObjectSizeIntrinsicsTest.java subtest
  • 562bc17: 8291359: Specification of method j.l.foreign.VaList::skip still deserves clarification
  • 2821fa9: 8280798: com.sun.jdi.ObjectReference::setValue spec should prohibit any final field modification
  • ... and 94 more: https://git.openjdk.org/jdk/compare/361b50e724f8c1177f89eaa93e38b69d244dadee...master

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 (@RealFYang) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 1, 2022
@zhengxiaolinX
Copy link
Contributor Author

Thanks for the reviews @RealFYang @luhenry! (The GHA failure is not related)

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@zhengxiaolinX
Your change (at version cf0d037) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 5, 2022

Going to push as commit f9e0f1d.
Since your change was applied there have been 116 commits pushed to the master branch:

  • 2300ed4: 8291769: Translation of switch with record patterns could be improved
  • eab0ada: 8296545: C2 Blackholes should allow load optimizations
  • dea2161: 8297959: Provide better descriptions for some Operating System JFR events
  • d523d9d: 8297864: Dead code elimination
  • 777fb52: 8297974: ClassCastException in com.sun.tools.javac.comp.AttrRecover.doRecovery
  • 17666fb: 8297794: Deprecate JMX Management Applets for Removal
  • 619b68c: 8294540: Remove Opaque2Node: it is broken and triggers assert
  • 82561de: 8296384: [TESTBUG] sun/security/provider/SecureRandom/AbstractDrbg/SpecTest.java intermittently timeout
  • 61b7093: 8297872: Non-local G1MonotonicArenaFreePool::_freelist_pool has non-trivial ctor/dtor
  • 3b3bbe5: 8296907: VMError: add optional callstacks, siginfo for secondary errors
  • ... and 106 more: https://git.openjdk.org/jdk/compare/361b50e724f8c1177f89eaa93e38b69d244dadee...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 5, 2022
@openjdk openjdk bot closed this Dec 5, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@TobiHartmann @zhengxiaolinX Pushed as commit f9e0f1d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@zhengxiaolinX
Copy link
Contributor Author

Thank you, Tobias!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants