Skip to content

8383990: Remove exception code filters from Windows AArch64 safefetch handler#31158

Closed
swesonga wants to merge 2 commits into
openjdk:masterfrom
swesonga:del-win-aarch64-safefetch-exception-list
Closed

8383990: Remove exception code filters from Windows AArch64 safefetch handler#31158
swesonga wants to merge 2 commits into
openjdk:masterfrom
swesonga:del-win-aarch64-safefetch-exception-list

Conversation

@swesonga
Copy link
Copy Markdown
Member

@swesonga swesonga commented May 13, 2026

JDK-8383541: Safefetch should return the error value when accessing pages protected with PAGE_GUARD on windows-aarch64 added a handler for guard pages specifically. However, @mo-beck has pointed out that we can actually remove the list of exceptions altogether to future-proof the safefetch implementation since it uses a LDR instruction whose PC is known and checked for by handle_safefetch. The gtests added in JDK-8383541 still pass with this change.



Progress

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

Issue

  • JDK-8383990: Remove exception code filters from Windows AArch64 safefetch handler (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31158

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 13, 2026

👋 Welcome back swesonga! 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
Copy Markdown

openjdk Bot commented May 13, 2026

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

8383990: Remove exception code filters from Windows AArch64 safefetch handler

Reviewed-by: dholmes, jwaters, mbeckwit

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

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 (@dholmes-ora, @TheShermanTanker) 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 hotspot-runtime hotspot-runtime-dev@openjdk.org label May 13, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

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

  • hotspot-runtime

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
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-runtime. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 13, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 13, 2026

Webrevs

Copy link
Copy Markdown
Contributor

@mo-beck mo-beck left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Copy link
Copy Markdown
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

It looks like exception_code is now unused and so can be removed from the signature.

Also this code has a section for _LP64 but as far as I can see the only call to handle_safefetch is from a section for _M_ARM64 - so the LP64 code seems dead as well.

@swesonga
Copy link
Copy Markdown
Member Author

It looks like exception_code is now unused and so can be removed from the signature.

handle_safefetch (defined in src/hotspot/share/runtime/safefetch_static.hpp) is a function used by the other platforms as well. I left it unchanged to avoid special-casing it for windows-aarch64

Also this code has a section for _LP64 but as far as I can see the only call to handle_safefetch is from a section for _M_ARM64 - so the LP64 code seems dead as well.

_LP64 is defined for all 64-bit CPUs in make/autoconf/flags-cflags.m4 so that code is not dead. It is tested by the SafeFetchN_with_page_guard_protection gtest

Copy link
Copy Markdown
Contributor

@TheShermanTanker TheShermanTanker 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!

@dholmes-ora
Copy link
Copy Markdown
Member

It looks like exception_code is now unused and so can be removed from the signature.

handle_safefetch (defined in src/hotspot/share/runtime/safefetch_static.hpp) is a function used by the other platforms as well. I left it unchanged to avoid special-casing it for windows-aarch64

Hmmm okay. It is declared in a shared header file but as far as I can see there are no callers from shared code. It seems to exist in the shared file to simplify the include process even though it is only used by platform-specific code and so could be declared in a platform specific header.

Also this code has a section for _LP64 but as far as I can see the only call to handle_safefetch is from a section for _M_ARM64 - so the LP64 code seems dead as well.

_LP64 is defined for all 64-bit CPUs

Doh! Sorry yes my brain read that referring to x86_64.

Copy link
Copy Markdown
Member

@dholmes-ora dholmes-ora 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. Thanks

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 15, 2026
@swesonga
Copy link
Copy Markdown
Member Author

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label May 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

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

@macarte
Copy link
Copy Markdown
Contributor

macarte commented May 15, 2026

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label May 15, 2026
@openjdk openjdk Bot closed this May 15, 2026
@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 May 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

@macarte @swesonga Pushed as commit f66380e.

💡 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

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants