Skip to content

Set register dep to exclude GPR0 for temp2Reg in inlineCompareAndSet - #22633

Merged
zl-wang merged 1 commit into
eclipse-openj9:masterfrom
rmnattas:cmpandset-regdep
Sep 17, 2025
Merged

Set register dep to exclude GPR0 for temp2Reg in inlineCompareAndSet#22633
zl-wang merged 1 commit into
eclipse-openj9:masterfrom
rmnattas:cmpandset-regdep

Conversation

@rmnattas

@rmnattas rmnattas commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

The temp2Reg is used by VMnonNullSrcWrtBarCardCheckEvaluator in some cases in a stbx instruction, which can't have GPR0 as the RA argument or it will act upon it as a null value.
This can cause an unexpected register spill in the middle of an internal control-flow sequence that might not be fully executed [1].

The inserted exclusion is sufficiently conditioned under doWrtBar && doCrdMrk (both true only when gcMode == gc_modron_wrtbar_cardmark_and_oldcheck), similarly conditioned by other callers to VMnonNullSrcWrtBarCardCheckEvaluator, and the stbx instruction generated by VMnonNullSrcWrtBarCardCheckEvaluator is conditioned under doCrdMrk = (gcMode == gc_modron_wrtbar_cardmark_and_oldcheck)

Testing: https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/29958/

[1]

 [    0x7ffee402f9f0]   15      bge     cr0, Label L4208
 [    0x7ffee402fb40]   15      lwz     gr11, [gr3, 0]
>[    0x7ffee4eb2ff0]   15      std     [gr14, 0], gr3 # #SPILL8 # SymRef  <#SPILL8_5300     0x7ffee4e542e0>[#5300  Auto] [flags 0x80000000 0x0 ]
 [    0x7ffee402fcf0]   15      ld      gr3, [gr15, 416]
 [    0x7ffee402fd90]   15      andis.  gr3, gr3, 16
 PRE: 
POST: [CCR_    0x7ffee402e640 : cr0] 
 [    0x7ffee402fec0]   15      Label L4212:    ; (Start of internal control flow)      
 [    0x7ffee402ff50]   15      beq     cr0, Label L4213
 [    0x7ffee40300b0]   15      ld      gr3, [gr15, 200]
 [    0x7ffee4030150]   15      rldicl  gr5, gr5, 0000000000000037, 007FFFFFFFFFFFFF
 [    0x7ffee4030200]   15      li      gr2, 0000000000000001
 [    0x7ffee4030350]   15      stb     [gr3, gr5], gr2
 [    0x7ffee4eb2ee0]   15      ori     gr0, gr3, 0x0
>[    0x7ffee4eb2e40]   15      ld      gr3, [gr14, 0]          ; spilled for icall # #SPILL8 # SymRef  <#SPILL8_5300     0x7ffee4e542e0>[#5300  Auto] [flags 0x80000000 0x0 ]
 [    0x7ffee40303f0]   15      Label L4213:    ; (End of internal control flow)        
 [    0x7ffee4030480]   15      subf    gr0, gr6, gr4
 [    0x7ffee4030520]   15      cmpld   cr0, gr0, gr7
 [    0x7ffee40305c0]   15      blt     cr0, Label L4208
 [    0x7ffee4030660]   15      andi.   gr0, gr11, 240
 PRE: 
POST: [CCR_    0x7ffee402e640 : cr0] 
 [    0x7ffee4030790]   15      bne     cr0, Label L4208
 [    0x7ffee4030870]   15      bl      00007FFF96D42600                ; Direct Call "jitWriteBarrierStoreGenerationalAndConcurrentMark"
 PRE: 
POST: 
 [    0x7ffee4030960]   15      Label L4209:    
 [    0x7ffee4030bc0]   15      assocreg
 PRE: 
POST: [&GPR_    0x7ffee402b060 : gr3] [GPR_    0x7ffee402aff0 : gr4] [GPR_    0x7ffee402d7f0 : gr11] [GPR_    0x7ffee4004970 : ???] [GPR_    0x7ffee402f320 : ???] [GPR_    0x7ffee402b140 : ???] [GPR_    0x7ffee402f390 : ???] [GPR_    0>
 [    0x7ffee40309f0]   15      Label L4208:    
 PRE: [&GPR_    0x7ffee402b0d0 : gr3] [&GPR_    0x7ffee402b530 : gr4] [GPR_    0x7ffee402f2b0 : gr11] [GPR_    0x7ffee402f320 : gr0] [GPR_    0x7ffee402b140 : gr29] [GPR_    0x7ffee402f390 : gr2] [GPR_    0x7ffee402f400 : gr5] [GPR_   >
POST: [&GPR_    0x7ffee402b0d0 : gr3] [&GPR_    0x7ffee402b530 : gr4] [GPR_    0x7ffee402f2b0 : gr11] [GPR_    0x7ffee402f320 : gr0] [GPR_    0x7ffee402b140 : gr29] [GPR_    0x7ffee402f390 : gr2] [GPR_    0x7ffee402f400 : gr5] [GPR_   >

Internal RTC 153007

The temp2Reg is used by `VMnonNullSrcWrtBarCardCheckEvaluator` in some
cases in a `stbx` instruction, which can't have GPR0 as the RA argument
or it will act upon it as a null value.
This causes the an unexpected register spill in the middle of an
internal control-flow sequence that might not be fully executed.
@rmnattas

Copy link
Copy Markdown
Contributor Author

fyi @zl-wang

@zl-wang zl-wang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks reasonable to me

@zl-wang

zl-wang commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Jenkins test sanity aix,plinux jdk8,jdk21

@zl-wang

zl-wang commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

@AdamBrousseau looks like some infra issue for the failing build?

@zl-wang

zl-wang commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

i would consider it as a success:

Build [Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Personal_testList_1 #196](https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Personal_testList_1/196/) completed: SUCCESS
[Pipeline] }
13:22:38  Build [Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Personal_testList_2 #196](https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Personal_testList_2/196/) completed: SUCCESS
[Pipeline] }
13:35:56  Build [Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Personal_testList_0 #196](https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Personal_testList_0/196/) completed: SUCCESS

@AdamBrousseau

Copy link
Copy Markdown
Contributor

AdamBrousseau looks like some infra issue for the failing build?

Agree

@zl-wang

zl-wang commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

all tests are successful as indicated above ... merging

@zl-wang
zl-wang merged commit 985752b into eclipse-openj9:master Sep 17, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants