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

8291550: RISC-V: jdk uses misaligned memory access when AvoidUnalignedAccess enabled #1852

Closed
wants to merge 2 commits into from

Conversation

omikhaltsova
Copy link

@omikhaltsova omikhaltsova commented Oct 6, 2023

I'd like to backport JDK-8291550 to jdk17u. This fix is related only to RISC-V.

The patch applies not cleanly. It differs from the original one in the following:

1. src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp

#undef VFCVT_SAFE was removed because there is no #define VFCVT_SAFE(VFLOATCVT) (JDK-8306966)

2. src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp

The difference is in context due to method signature change by JDK-8299229
void NativeNMethodBarrier::verify() const {..
bool NativeNMethodBarrier::check_barrier(err_msg& msg) const {..

msg.print(..) was replaced with tty->print_cr(..)

3. src/hotspot/cpu/riscv/interp_masm_riscv.cpp

The changes were not applied to
void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Register index) {
This method doesn't exist, it was added by JDK-8301995.

4. src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

The difference is in context due to the method signature change by JDK-8298075
address MacroAssembler::get_target_of_li32(address insn_addr) {
static address get_target_of_li32(address insn_addr) {

NULL was replaced with nullptr by JDK-8301496.

5. src/hotspot/cpu/riscv/nativeInst_riscv.cpp
src/hotspot/cpu/riscv/nativeInst_riscv.hpp

NULL was replaced with nullptr by JDK-8301496

Testing: tier1 tests successfully passed on a RISC-V HiFive board with Linux.


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
  • JDK-8291550 needs maintainer approval

Issue

  • JDK-8291550: RISC-V: jdk uses misaligned memory access when AvoidUnalignedAccess enabled (Bug - P3 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/1852/head:pull/1852
$ git checkout pull/1852

Update a local copy of the PR:
$ git checkout pull/1852
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/1852/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1852

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/1852.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 6, 2023

👋 Welcome back omikhaltcova! 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 changed the title Backport 37093441661c26f333aac00d16aea00c3341d314 8291550: RISC-V: jdk uses misaligned memory access when AvoidUnalignedAccess enabled Oct 6, 2023
@openjdk
Copy link

openjdk bot commented Oct 6, 2023

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label Oct 6, 2023
@@ -4099,7 +4185,8 @@ address MacroAssembler::zero_words(Register ptr, Register cnt) {

// base: Address of a buffer to be zeroed, 8 bytes aligned.
// cnt: Immediate count in HeapWords.
void MacroAssembler::zero_words(Register base, u_int64_t cnt) {

Choose a reason for hiding this comment

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

looks like this edit was accidentially added to the backport, other than that - looks good

Copy link
Author

Choose a reason for hiding this comment

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

Thx! That's right, this line break was inserted by mistake. Fixed.

@omikhaltsova omikhaltsova marked this pull request as ready for review October 6, 2023 14:37
@openjdk
Copy link

openjdk bot commented Oct 6, 2023

⚠️ @omikhaltsova This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 6, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 6, 2023

Webrevs

@openjdk openjdk bot added the approval label Oct 6, 2023
@openjdk
Copy link

openjdk bot commented Oct 7, 2023

@omikhaltsova 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:

8291550: RISC-V: jdk uses misaligned memory access when AvoidUnalignedAccess enabled

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

  • 8314149: 8315606: Open source few swing text/html tests
  • 3506c88: 8309104: [JVMCI] compiler/unsafe/UnsafeGetStableArrayElement test asserts wrong values with Graal
  • e95369b: 8281149: (fs) java/nio/file/FileStore/Basic.java fails with java.lang.RuntimeException: values differ by more than 1GB
  • 6cc9975: 8258951: java/net/httpclient/HandshakeFailureTest.java failed with "RuntimeException: Not found expected SSLHandshakeException in java.io.IOException"
  • 98e5490: 8315377: C2: assert(u->find_out_with(Op_AddP) == nullptr) failed: more than 2 chained AddP nodes?
  • 7f9b92c: 8312440: assert(cast != nullptr) failed: must have added a cast to pin the node
  • dbbded3: 8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17
  • 273872c: 8301489: C1: ShortLoopOptimizer might lift instructions before their inputs
  • 9dc5ff0: 8299075: TestStringDeduplicationInterned.java fails because extra deduplication
  • c8bc1c2: 8307403: java/util/zip/DeInflate.java timed out
  • ... and 8 more: https://git.openjdk.org/jdk17u-dev/compare/20d41b94787371fe8f260dac05138b554f305ea1...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval labels Oct 7, 2023
@omikhaltsova
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 8, 2023

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

  • 9f384e7: 8308047: java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java timed out and also had jcmd pipe errors
  • 8314149: 8315606: Open source few swing text/html tests
  • 3506c88: 8309104: [JVMCI] compiler/unsafe/UnsafeGetStableArrayElement test asserts wrong values with Graal
  • e95369b: 8281149: (fs) java/nio/file/FileStore/Basic.java fails with java.lang.RuntimeException: values differ by more than 1GB
  • 6cc9975: 8258951: java/net/httpclient/HandshakeFailureTest.java failed with "RuntimeException: Not found expected SSLHandshakeException in java.io.IOException"
  • 98e5490: 8315377: C2: assert(u->find_out_with(Op_AddP) == nullptr) failed: more than 2 chained AddP nodes?
  • 7f9b92c: 8312440: assert(cast != nullptr) failed: must have added a cast to pin the node
  • dbbded3: 8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17
  • 273872c: 8301489: C1: ShortLoopOptimizer might lift instructions before their inputs
  • 9dc5ff0: 8299075: TestStringDeduplicationInterned.java fails because extra deduplication
  • ... and 9 more: https://git.openjdk.org/jdk17u-dev/compare/20d41b94787371fe8f260dac05138b554f305ea1...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 8, 2023
@openjdk openjdk bot closed this Oct 8, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 8, 2023
@openjdk
Copy link

openjdk bot commented Oct 8, 2023

@omikhaltsova Pushed as commit adef8e4.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
2 participants