RFR: JDK-8331859 : [PPC64] Remove support for Power7 and older [v17]

Hao Sun haosun at openjdk.org
Tue Jun 24 11:06:56 UTC 2025


On Fri, 23 May 2025 13:41:31 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> JBS Issue: [JDK-8331859](https://bugs.openjdk.org/browse/JDK-8331859) 
>> Linux PPC64le requires Power8 since the beginning.
>> AIX requires Power8 with the new OpenXL based build ([JDK-8307520](https://bugs.openjdk.org/browse/JDK-8307520)). The old build has been removed in JDK 23 ([JDK-8327701](https://bugs.openjdk.org/browse/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.
>
> Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   switch case

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}


2. 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)


3. `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 (https://github.com/openjdk/jdk/pull/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.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20262#issuecomment-2999872960


More information about the hotspot-dev mailing list