Skip to content

Conversation

@suchismith1993
Copy link
Contributor

@suchismith1993 suchismith1993 commented Jul 19, 2024

JBS Issue: JDK-8331859
Linux PPC64le requires Power8 since the beginning.
AIX requires Power8 with the new OpenXL based build (JDK-8307520). The old build has been removed in JDK 23 (JDK-8327701).
Linux PPC64 Big Endian is no longer officially supported (only kept alive for development, debugging and testing purposes).

The following checks for old processors are no longer needed:
8: VM_Version::has_lqarx()
7: VM_Version::has_popcntw()
6: VM_Version::has_cmpb()
5: VM_Version::has_popcntb()
These ones and some more checks for old instructions are no longer needed. All code which is no longer reachable when removing them should also get removed.
Checks like "PowerArchitecturePPC64 >= 8" (or older) can be removed.

Atomic::PlatformCmpxchg<1>::operator() can be simplified by using sub-word instructions (lharx, lbarx).

Temp registers can be removed from cmpxchgb and cmpxchgh.

Build flags "-mcpu=powerpc64 -mtune=power5" for Big Endian linux should get replaced by "-mcpu=power8 -mtune=power8" as already used for linux PPC64le.


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-8331859: [PPC64] Remove support for Power7 and older (Enhancement - P4)

Reviewers

Reviewers without OpenJDK IDs

  • @dbriemann (no known openjdk.org user name / role)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20262

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 19, 2024

👋 Welcome back sroy! 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 Jul 19, 2024

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

8331859: [PPC64] Remove support for Power7 and older

Reviewed-by: mdoerr

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 163 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 (@TheRealMDoerr) 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
Copy link

openjdk bot commented Jul 19, 2024

@suchismith1993 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 Jul 19, 2024
@suchismith1993 suchismith1993 changed the title changes for removing power7 and below JDK-8331859 : [PPC64] Remove support for Power7 and older Sep 13, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 13, 2024

@suchismith1993 This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 8, 2024

@suchismith1993 This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Nov 8, 2024
@suchismith1993
Copy link
Contributor Author

/open

@openjdk openjdk bot reopened this Jan 23, 2025
@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@suchismith1993 This pull request is now open

@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@suchismith1993 this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout power8
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Jan 23, 2025
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Jan 23, 2025
@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Feb 12, 2025
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr 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. We'll retest it. 2nd review needed.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 21, 2025
"ppc64%s%s%s%s",
(" sha"),
(" aes"),
"ppc64 sha aes%s%s%s%s",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is now broken! Too many %s!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. Sorry about that. For some reason the files are not getting saved in the machine and older versions were getting pushed. Fixed now.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 21, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 22, 2025
Copy link
Member

@dbriemann dbriemann left a comment

Choose a reason for hiding this comment

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

Nice cleanup. I have some small suggestions.


// Prefetch the data into the L2 cache.
__ dcbt(R3_ARG1, 0);
// If supported set DSCR pre-fetch to deepest.
Copy link
Member

Choose a reason for hiding this comment

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

The If supported can be removed from the comment.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 23, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 23, 2025
Copy link
Member

@dbriemann dbriemann left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM

@suchismith1993
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 26, 2025
@openjdk
Copy link

openjdk bot commented May 26, 2025

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

@varada1110
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented May 26, 2025

Going to push as commit 5cdeef8.
Since your change was applied there have been 165 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 26, 2025
@openjdk openjdk bot closed this May 26, 2025
@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 26, 2025
@openjdk
Copy link

openjdk bot commented May 26, 2025

@varada1110 @suchismith1993 Pushed as commit 5cdeef8.

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

@shqking
Copy link
Contributor

shqking commented Jun 24, 2025

Hi, I came across VM crash with SIGILL after this patch.

My local test environment

As I don't hava ppc64 hardware, I built one ppc64le Java binary with cross-compilation on Ubuntu-24.04 and ran java -version with QEMU. Here shows a snippet of the error log:

$ sudo chroot /sysroot/ppc64el /tmp/build-ppc64el/images/jdk/bin/java --version
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00007718c7817380, pid=121270, tid=121272
#
# JRE version:  (26.0) (fastdebug build )
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 26-internal-git-9c3eaa49f7f, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-ppc64le)
# Problematic frame:
# v  ~BufferBlob::config_dscr 0x00007718c7817380
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to //core.121270)
#
# An error report file with more information is saved as:
# //hs_err_pid121270.log
[2.177s][warning][os] Loading hsdis library failed
#
#
qemu: uncaught target signal 6 (Aborted) - core dumped
environment: line 1: 121269 Aborted                 "$@"

The unsupported instruction is mfdscr

I checked the instruction at the pc=0x00007718c7817380. It is A6 02 63 7C mfspr r3, 3.
Hence I suspected if the following change in this PR might be related, i.e. src/hotspot/cpu/ppc/vm_version_ppc.cpp
See https://github.com/openjdk/jdk/pull/20262/files#diff-409e1c95e0846f4dbf17f425616970846bbc5fa105c5fb7e80402dc4663416beL95

// Power 8: Configure Data Stream Control Register.
config_dscr();

Check the support of mfdscr in my environment

I built another Java binary with the code commit before this PR, i.e. 8357649: IGV: add block index to the supplemental node properties.

Then I tried the following commands to check the value of PowerArchitecturePPC64 and the support of mfdscr instruction in my environment. As shown below, it seems that mfdscr is NOT supported by default in my qemu environment.

  1. it's power9 which is >=8. it's as expected.
$ sudo chroot /sysroot/ppc64el /tmp/build-ppc64el/images/jdk/bin/java -XX:+PrintFlagsFinal --version | grep PowerArchitecturePPC64
    uintx PowerArchitecturePPC64                   = 9                                 {ARCH diagnostic} {ergonomic}
  1. there is no mfdscr
$ sudo chroot /sysroot/ppc64el /tmp/build-ppc64el/images/jdk/bin/java -XX:+Verbose -version
Version: ppc64 fsqrt isel lxarxeh cmpb popcntb popcntw fcfids vand lqarx aes vpmsumb vsx ldbrx stdbrx sha darn L1_data_cache_line_size=128

ContendedPaddingWidth 128
openjdk version "25-internal" 2025-09-16
OpenJDK Runtime Environment (fastdebug build 25-internal-git-unknown)
OpenJDK 64-Bit Server VM (fastdebug build 25-internal-git-unknown, mixed mode)
  1. VM_Version::determine_features() also treat mfdscr as illegal instructions

Note that a602 037c is changed to 0000 0000 after decoding.

$ sudo chroot /sysroot/ppc64el /tmp/build-ppc64el/images/jdk/bin/java -XX:+PrintAssembly --version

OpenJDK 64-Bit Server VM warning: PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output                                                        
Decoding cpu-feature detection stub at 0x00007964b385f380 before execution:     
[0.068s][warning][os] Loading hsdis library failed                              
[MachCode]                                                                      
  0x00007964b385f380: 2c20 60fc | 2c20 60ec | 1e30 e57c | a920 e37c | f833 a77c | f400 a77c | f402 a77c | 9c26 60ec 
  0x00007964b385f3a0: 0404 0010 | 2922 c37c | 0815 0110 | 0814 0110 | a602 037c | 981e 007c | 2824 e37c | 2825 e37c
  0x00007964b385f3c0: 82fe 0110 | e605 e17c | 3601 c57c | 2000 804e | ec1f 007c | 2000 804e
[/MachCode]                                                                     
Decoding cpu-feature detection stub at 0x00007964b385f380 after execution:      
[MachCode]                                                                      
  0x00007964b385f380: 2c20 60fc | 2c20 60ec | 1e30 e57c | a920 e37c | f833 a77c | f400 a77c | f402 a77c | 9c26 60ec
  0x00007964b385f3a0: 0404 0010 | 2922 c37c | 0815 0110 | 0814 0110 | 0000 0000 | 981e 007c | 2824 e37c | 2825 e37c
  0x00007964b385f3c0: 82fe 0110 | e605 e17c | 0000 0000 | 2000 804e | ec1f 007c | 2000 804e
[/MachCode]     

The question

From this PR and the follow-up patch (#25495) by @TheRealMDoerr , it seems that mfdscr instruction should be always available for Power>=8. Unfortunately, it's actually not in my local environment.

I'm not sure if it's an issue of QEMU or an issue of this PR?
Thanks.

@TheRealMDoerr
Copy link
Contributor

@shqking: Thanks for the detailed analysis! Not sure if it is a QEMU bug. If this is the only problem, let's just add the check back. See new PR linked above. Can you verify and review it, please?

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

Development

Successfully merging this pull request may close these issues.

5 participants