RFR: 8367325: [s390x] build failure due to JDK-8361376 [v2]

Martin Doerr mdoerr at openjdk.org
Mon Sep 15 10:56:16 UTC 2025


On Mon, 15 Sep 2025 10:14:40 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> Fixes the SIGLL caused after [JDK-8361376](https://bugs.openjdk.org/browse/JDK-8361376). 
>> 
>> Issue was with `cs` instruction, which requires the address to be aligned. And after this change address at which operating was not aligned.
>> 
>> Wisdom from Principle of Z Operations: 
>> 
>> Sytax: CS R<sub>1</sub>,R<sub>3</sub>,D<sub>2</sub>(B<sub>2</sub>)
>> 
>> Sytax: CSY R<sub>1</sub>,R<sub>3</sub>,D<sub>2</sub>(B<sub>2</sub>)
>> 
>> `
>> The second operand of COMPARE AND SWAP (CS, CSY) must be designated on a word boundary.
>> `
>> 
>> 
>> 
>> => 0x3fffc3149ba <_ZN17BarrierSetNMethod15set_guard_valueEP7nmethodii+266>: cs %r1,%r4,0(%r3)
>> (gdb) i r r3
>> r3             0x3ffe500017a       4397593526650
>> (gdb) p ($r3 % 8) 
>> $5 = 2
>> (gdb) si 
>> 
>> Thread 16 "C1 CompilerThre" received signal SIGILL, Illegal instruction.
>> NativeMethodBarrier::set_guard_value (bit_mask=2147483647, value=1, this=0x3ffe5000166)
>>     at /home/amit/jdk/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp:74
>> 74         if (v == old_value) break;
>
> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   better fix

src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp line 70:

> 68: #endif // COMPILER2
> 69: 
> 70:   static const int PATCHABLE_INSTRUCTION_OFFSET = 3 * 6 + 2;

Maybe better call it `PATCHABLE_BARRIER_VALUE_OFFSET`?
It's no longer the instruction start address.
Or even better: define 2 constants. The version without the +2 is still needed below.

src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp line 30:

> 28: #include "code/nmethod.hpp"
> 29: #include "gc/shared/barrierSetNMethod.hpp"
> 30: #include "gc/shared/barrierSetAssembler.hpp"

Should be sorted alphabetically.

src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp line 43:

> 41:       address inst_addr = get_barrier_start_address() + BarrierSetAssembler::PATCHABLE_INSTRUCTION_OFFSET;
> 42: 
> 43:       DEBUG_ONLY(Assembler::is_z_cfi(*((long*)inst_addr)));

The cfi check needs an adjustment to point to the instruction start, right?

src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp line 48:

> 46: 
> 47:   public:
> 48:     static const int BARRIER_TOTAL_LENGTH = BarrierSetAssembler::PATCHABLE_INSTRUCTION_OFFSET + 2*6; // bytes

Same here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27213#discussion_r2348599191
PR Review Comment: https://git.openjdk.org/jdk/pull/27213#discussion_r2348599782
PR Review Comment: https://git.openjdk.org/jdk/pull/27213#discussion_r2348601880
PR Review Comment: https://git.openjdk.org/jdk/pull/27213#discussion_r2348606577


More information about the hotspot-dev mailing list