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

JDK-8283865: riscv: Break down -XX:+UseRVB into seperate options for each bitmanip extension #8032

Closed
wants to merge 4 commits into from

Conversation

feilongjiang
Copy link
Member

@feilongjiang feilongjiang commented Mar 30, 2022

Currently openjdk riscv supports RISC-V bitmanip extension as a bundle while spec provides four individual extensions: Zb[abcs][1].

According to the spec, we need to break down UseRVB into two individual options UseZba and UseZbb to enable or disable Zba and Zbb respectively (openjdk riscv only supports Zba and Zbb for now).

Since multi-letter extensions representation in the ISA bitmap is still not determined [2][3], availability for those extensions could not be queried from HWCAP. Feature detection of Zba and Zbb was removed temporarily.

Linux RISCV64 release hotspot/jdk tier1 tests are passed on QEMU with following options:

  • +UseZba && +UseZbb
  • +UseZba && -UseZbb
  • -UseZba && +UseZbb

[1]: https://github.com/riscv/riscv-bitmanip/releases/download/1.0.0/bitmanip-1.0.0-38-g865e7a7.pdf
[2]: http://lists.infradead.org/pipermail/linux-riscv/2021-November/010250.html
[3]: http://lists.infradead.org/pipermail/linux-riscv/2021-November/010252.html


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8283865: riscv: Break down -XX:+UseRVB into seperate options for each bitmanip extension

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8032

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

Using diff file

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

@feilongjiang feilongjiang changed the title JDK-8283865 riscv: Break down -XX:+UseRVB into seperate options for each bitmanip extension JDK-8283865: riscv: Break down -XX:+UseRVB into seperate options for each bitmanip extension Mar 30, 2022
@bridgekeeper
Copy link

bridgekeeper bot commented Mar 30, 2022

👋 Welcome back fjiang! 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 Mar 30, 2022
@openjdk
Copy link

openjdk bot commented Mar 30, 2022

@feilongjiang 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 Mar 30, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 30, 2022

Webrevs

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.

Changes looks good to me. (Not a JDK Reviewer)

@feilongjiang
Copy link
Member Author

feilongjiang commented Mar 31, 2022

hotspot/jdk tier1 tests on QEMU with options -XX:+UseZba -XX:+UseZbb/-XX:+UseZba -XX:-UseZbb/-XX:\-UseZba -XX:+UseZbb still good after da7f419.

@shipilev
Copy link
Member

shipilev commented Apr 1, 2022

Sorry, I probably misunderstand the background and the consequences here.

This patch effectively disables B-extensions unless user specifically enables the subextensions with +UseZba and +UseZbb? Is there a hardware that supports B-extension only partially? I.e. do we care about this, at expense of disabling the B-extension by default?

It looks to me we need to postpone this patch until we can detect Zba and Zbb availability automatically.

@RealFYang
Copy link
Member

RealFYang commented Apr 1, 2022

Sorry, I probably misunderstand the background and the consequences here.

This patch effectively disables B-extensions unless user specifically enables the subextensions with +UseZba and +UseZbb? Is there a hardware that supports B-extension only partially? I.e. do we care about this, at expense of disabling the B-extension by default?

It looks to me we need to postpone this patch until we can detect Zba and Zbb availability automatically.

Let me try to clarify:

This patch effectively disables B-extensions unless user specifically enables the subextensions with +UseZba and +UseZbb?

-- That's correct. This is also true even before this change.
Support for those new ISA-features are currently treated as experimental and disabled by default.
Main reason is the lack of hardware supporting those ISA-extensions.
In fact, those ISA-extensions are rather new and I believe hardware supporting those ISA-extensions are not in the market for now.

Is there a hardware that supports B-extension only partially? I.e. do we care about this, at expense of disabling the B-extension by default?

-- No. Actually, we can only test this with QEMU.

It looks to me we need to postpone this patch until we can detect Zba and Zbb availability automatically.

-- In fact this patch fixes two things here:

1. The bitmanipulation ISA extensions will be ratified as individual small extension packages instead of a large B-extension. 
    Software tools should follow this spec. One typical example is QEMU [1]. 
    Previously, QEMU also support this as a bundle, so you do: qemu-riscv64 -cpu rv64,x-b=true
    Now as the spec is frozen, that x-b=true option is no supported anymore. Instead, now you do: qemu-riscv64 -cpu rv64,zba=true,zbb=true,zbc=true,zbs=true
    I think we should do similar thing for JVM breaking down the -XX:-UseRVB option into separate options for each Zb* extension.

2. The current way for detecting those ISA-extensions is wrong. I think this was once affected by some early draft spec. 
     This patch fixes this by removing the wrong way for detection and leaves a FIXME there. 
     I think that's fine to me before the correct way is settled down on Linux/RISCV64. 

[1] https://patchwork.kernel.org/project/qemu-devel/patch/20210911140016.834071-5-philipp.tomsich@vrull.eu/

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.

All right, thanks for explanations. This PR makes sense then.

@openjdk
Copy link

openjdk bot commented Apr 1, 2022

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

8283865: riscv: Break down -XX:+UseRVB into seperate options for each bitmanip extension

Reviewed-by: fyang, shade

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 11 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 (@RealFYang, @shipilev) 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 Apr 1, 2022
@feilongjiang
Copy link
Member Author

feilongjiang commented Apr 2, 2022

@RealFYang @shipilev -- Thanks for the review! The Windows failure is some unrelated environment setup problem, which is not caused by this patch.

P.S.: I have opened another issue (JDK-8284196) to keep tracking the status of feature detection for RISC-V bitmanip ISA-extensions.

@feilongjiang
Copy link
Member Author

/integrate

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

openjdk bot commented Apr 2, 2022

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

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 2, 2022

Going to push as commit 060a188.
Since your change was applied there have been 11 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 Apr 2, 2022
@openjdk openjdk bot closed this Apr 2, 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 Apr 2, 2022
@openjdk
Copy link

openjdk bot commented Apr 2, 2022

@RealFYang @feilongjiang Pushed as commit 060a188.

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

@feilongjiang feilongjiang deleted the split-rvb branch April 2, 2022 02:56
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
3 participants