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

8293100: RISC-V: Need to save and restore callee-saved FloatRegisters in StubGenerator::generate_call_stub #10095

Closed

Conversation

zhengxiaolinX
Copy link
Contributor

@zhengxiaolinX zhengxiaolinX commented Aug 31, 2022

Hi team,

  1. Tests described in JDK-8293100 are failed, for callee-saved float registers used in C++ code are observed being killed after entering the Java world since callee-saved float registers are unfortunately missed to be saved in StubGenerator::generate_call_stub(). So the phenomenon presented in the failed tests seems to be weird.

  2. This patch also fixes some typos in vmreg_riscv.cpp when debugging the same issue:
    (before)
    140D1DC7-39AD-4D5E-ABDE-38AACB658E3F
    This one seems not right, either; and it also gets fixed in this patch:
    (after)
    6374B608-F574-4883-9DB5-D0525BE2536A

  3. Also, branch nodes for float registers in OptoAssembly didn't show their destination blocks. This patch adds a little enhancement for those.

Hotspot tier1 has passed both on my board and qemu, and vmTestbase/nsk/stress tests failed before have passed as well.
The test process on the board is slow and I am testing the remaining but I consider this as ready for review.

Best,
Xiaolin


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-8293100: RISC-V: Need to save and restore callee-saved FloatRegisters in StubGenerator::generate_call_stub

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10095

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 31, 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
Copy link

openjdk bot commented Aug 31, 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 Aug 31, 2022
@zhengxiaolinX zhengxiaolinX changed the title 8293100: riscv: Forgot to save callee-saved FloatRegisters in StubGenerator::generate_call_stub 8293100: RISC-V: Need to save and restore callee-saved FloatRegisters in StubGenerator::generate_call_stub Aug 31, 2022
@zhengxiaolinX zhengxiaolinX marked this pull request as ready for review September 1, 2022 04:11
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 1, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 1, 2022

Webrevs

@VladimirKempik
Copy link

vmTestbase/nsk/stress/jni/jnistress002.java now passes with this patch
Running now full tier4:hotspot ( which includes vmTestbase), will report on results later

Copy link
Contributor

@yadongw yadongw left a comment

Choose a reason for hiding this comment

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

lgtm(not a reviewer)

Copy link
Member

@feilongjiang feilongjiang left a comment

Choose a reason for hiding this comment

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

Looks good, with one comment.

// -22 [ argument word 1 ]
// -21 [ saved x27 ] <--- sp_after_call
// -34 [ argument word 1 ]
// -33 [ saved f27 ] <--- sp_after_call
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to add some comments about saving FloatRegisters at line 124.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, always forget the comment things. Seems x9 is also missed in the comments; it is added along with f8-f9 and f18-f27 now.

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Looks fine.

@openjdk
Copy link

openjdk bot commented Sep 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:

8293100: RISC-V: Need to save and restore callee-saved FloatRegisters in StubGenerator::generate_call_stub

Reviewed-by: yadongwang, fjiang, shade, vkempik

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

  • 3ac91b0: 8293003: Review running time of Warn5 regression test
  • e0168a0: 8288012: AArch64: unnecessary macro expansion in stubGenerator_aarch64
  • 99c3ab0: 8293010: JDI ObjectReference/referringObjects/referringObjects001 fails: assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) failed: checking
  • 0fb9469: 8290126: Add a check in JavadocTester for "javadoc should not crash"
  • 0a4d0ce: 8293121: (fs) Refactor UnixFileSystem copying into generic Unix, Linux, and BSD implementations
  • 032be16: 8292066: Convert TestInputArgument.sh and TestSystemLoadAvg.sh to java version
  • e393973: 8292990: Improve test coverage for XPath Axes: parent
  • fa68371: 8292584: assert(cb != __null) failed: must be with -XX:-Inline
  • 04d8069: 8230374: maxOutputSize, instead of javatest.maxOutputSize, should be used in TEST.properties
  • 3d254d3: 8289510: Improve test coverage for XPath Axes: namespace
  • ... and 21 more: https://git.openjdk.org/jdk/compare/9e3176bd09c7210ccb125491abb6a6a4d852b6c6...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 (@shipilev, @VladimirKempik) 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 Sep 1, 2022
@zhengxiaolinX
Copy link
Contributor Author

vmTestbase/nsk/stress/jni/jnistress002.java now passes with this patch Running now full tier4:hotspot ( which includes vmTestbase), will report on results later

Hi Vladimir, my hotspot tier2~4 have passed. I was wondering if all's right with your hotspot tier4?

@VladimirKempik
Copy link

Hello
Tier4:hotspot is good on thead.

@zhengxiaolinX
Copy link
Contributor Author

Thanks!
And thank you all for reviewing as always. Let's move on then.

/integrate

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

openjdk bot commented Sep 2, 2022

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

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Sep 2, 2022

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

  • 98ce45f: 8292981: Unify and restructure integer printing format specifiers
  • 3ac91b0: 8293003: Review running time of Warn5 regression test
  • e0168a0: 8288012: AArch64: unnecessary macro expansion in stubGenerator_aarch64
  • 99c3ab0: 8293010: JDI ObjectReference/referringObjects/referringObjects001 fails: assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) failed: checking
  • 0fb9469: 8290126: Add a check in JavadocTester for "javadoc should not crash"
  • 0a4d0ce: 8293121: (fs) Refactor UnixFileSystem copying into generic Unix, Linux, and BSD implementations
  • 032be16: 8292066: Convert TestInputArgument.sh and TestSystemLoadAvg.sh to java version
  • e393973: 8292990: Improve test coverage for XPath Axes: parent
  • fa68371: 8292584: assert(cb != __null) failed: must be with -XX:-Inline
  • 04d8069: 8230374: maxOutputSize, instead of javatest.maxOutputSize, should be used in TEST.properties
  • ... and 22 more: https://git.openjdk.org/jdk/compare/9e3176bd09c7210ccb125491abb6a6a4d852b6c6...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 2, 2022

@RealFYang @zhengxiaolinX Pushed as commit bc5ffc8.

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

@zhengxiaolinX zhengxiaolinX deleted the callee-saved-float-missing branch September 2, 2022 07:01
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
6 participants