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

8286711: AArch64: serviceability agent tests fail with PAC enabled #8814

Closed
wants to merge 1 commit into from

Conversation

nick-arm
Copy link
Member

@nick-arm nick-arm commented May 20, 2022

When the VM is run with -XX:UseBranchProtection=pac-ret on a supported CPU, the upper bits of the saved link register contain a "pointer authentication code" which must be checked and removed by a special instruction before a function returns. The serviceability agent is unaware of this and so sees garbled PC values when walking the stack. This patch just masks out the PAC bits from the sender PC after reading it from the stack frame.


Progress

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

Issue

  • JDK-8286711: AArch64: serviceability agent tests fail with PAC enabled

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8814/head:pull/8814
$ git checkout pull/8814

Update a local copy of the PR:
$ git checkout pull/8814
$ git pull https://git.openjdk.java.net/jdk pull/8814/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8814

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8814.diff

When the VM is run with `-XX:UseBranchProtection=pac-ret` on a supported
CPU, the upper bits of the saved link register contain a "pointer
authentication code" which must be checked and removed by a special
instruction before a function returns.  The serviceability agent is
unaware of this and so sees garbled PC values when walking the stack.
This patch just masks out the PAC bits from the sender PC after reading
it from the stack frame.
@bridgekeeper
Copy link

bridgekeeper bot commented May 20, 2022

👋 Welcome back ngasson! 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 label May 20, 2022
@openjdk
Copy link

openjdk bot commented May 20, 2022

@nick-arm The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

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

@openjdk openjdk bot added serviceability hotspot labels May 20, 2022
@mlbridge
Copy link

mlbridge bot commented May 20, 2022

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

That all seems reasonable to me.

Thanks.

@openjdk
Copy link

openjdk bot commented May 23, 2022

@nick-arm 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:

8286711: AArch64: serviceability agent tests fail with PAC enabled

Reviewed-by: dholmes, cjplummer

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

  • 6cc4bb1: 6725221: Standardize obtaining boolean properties with defaults
  • 194bc08: 8287249: Zero: Missing BarrierSetNMethod::arm() method
  • 25669bb: 8275170: Some jtreg sound tests should be marked with sound keyword
  • 4518063: 8281682: Redundant .ico files in Windows app-image cause unnecessary bloat
  • fdece9a: 8287169: compiler/arguments/TestCompileThresholdScaling.java fails on x86_32 after JDK-8287052
  • 25080e0: 8286891: thread_local causes undefined symbol error with XL C
  • a10c559: 8287162: (zipfs) Performance regression related to support for POSIX file permissions
  • d888c80: 8287165: JFR: Add logging to jdk/jfr/api/consumer/recordingstream/TestOnEvent.java
  • fdc147e: 8287139: aarch64 intrinsic for unsignedMultiplyHigh
  • 8f0eb5d: 8287158: Explicitly reject unsupported call shapes on macos-aarch64 in mainline
  • ... and 46 more: https://git.openjdk.java.net/jdk/compare/4587337e956ed6f1a59e9d980a09ab9f784fbde0...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 the ready label May 23, 2022
@nick-arm
Copy link
Member Author

nick-arm commented May 30, 2022

/integrate

1 similar comment
@nick-arm
Copy link
Member Author

nick-arm commented May 30, 2022

/integrate

@openjdk
Copy link

openjdk bot commented May 30, 2022

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

  • 19fb8ab: 8287195: AArch64: Client VM build failure after JDK-8283689
  • 1b9987c: 8287288: Fix some typos in C1
  • 447ae00: 8287418: riscv: Fix correctness issue of MacroAssembler::movptr
  • a27ba1a: 8287363: null pointer should use NULL instead of 0
  • 744b822: 8287073: NPE from CgroupV2Subsystem.getInstance()
  • 5848a60: 8286093: java/awt/geom/Path2D/UnitTest.java failed with "RuntimeException: 2D bounds too small"
  • 3d2d039: 8287440: Typo in package-info.java of java.util.random
  • 36350bf: 8287484: JFR: Seal RecordedObject
  • a6e2e22: 8285008: JFR: jdk/jfr/jmx/streaming/TestClose.java failed with "Exception: Expected repository to be empty"
  • 2c461ac: 8287492: ProblemList compiler/jvmci/errors/TestInvalidDebugInfo.java
  • ... and 107 more: https://git.openjdk.java.net/jdk/compare/4587337e956ed6f1a59e9d980a09ab9f784fbde0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label May 30, 2022
@openjdk openjdk bot closed this May 30, 2022
@openjdk openjdk bot removed ready rfr labels May 30, 2022
@openjdk
Copy link

openjdk bot commented May 30, 2022

@nick-arm Pushed as commit d833173.

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

@openjdk
Copy link

openjdk bot commented May 30, 2022

@nick-arm The command integrate can only be used in open pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot integrated serviceability
3 participants