-
Notifications
You must be signed in to change notification settings - Fork 729
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
[FFI] Fix the issue with the struct FF/DD in upcall on z/OS #20018
[FFI] Fix the issue with the struct FF/DD in upcall on z/OS #20018
Conversation
The PR has been verified with FFI specific test suites in OpenJ9. |
also, is there any special treatment in zOS ABI for single-member struct/union? something like:
Hopefully no ... such that it is good as it is. |
If the passing parameter is union, it will regardless of member type, it will be passed in GPR. For the single element struct, it will be in GPR as well (whether it is Floating point or not). |
for union treated as you described, is it limited to single-member and no-more-than-8-byte? or, you meant any union? |
According to LE Vendor reference [1], for argument passing, any aggregate type that is not union and contains exactly two floating point types of same size, is considered complex type. All other parameters from the argument lists are passed in GPR1-3 if available (With exception of floating point type. So the case you shared, if we have nested single member struct, as the aggregate has only one member, it will be passed in available GPRs. [1]. https://www.ibm.com/docs/en/SSLTBW_2.5.0/pdf/ceev100_v2r5.pdf |
ok ... that makes it clear. the implementation only needs to tighten up on a few cases mentioned above, and we are good to go. |
@ChengJin01 at least three categorization bugs I can see, mentioned previously:
|
As for case 2 openj9/test/functional/Java21Only/src/org/openj9/test/jep442/upcall/UpcallMHWithUnionTests.java Line 1610 in 9249e24
As for case 3 openj9/test/functional/Java21Only/src/org/openj9/test/jep442/upcall/UpcallMHWithStructTests.java Line 2224 in 9249e24
|
I agree with the cases @zl-wang shared, all those should be considered non complex. |
please help confirm whether these 3 cases above are covered in this PR against z/OS ABI as the fix is totally based on z/OS ABI (my understanding is that case 2 & 3 should be addressed as explained at #20018 (comment)). |
Do the rules also apply to
If so, we will need to unify the code to handle them altogether. |
@ChengJin01 Yes , rules include all floating point types, so doubles as well. |
e035eea
to
404d9fb
Compare
I've updated the code to handle all the 3 cases above for float & double. |
you added float before c ... making it invalid declaration.
|
Yes, the latest changes already covers this case (a struct with a 8-byte nested struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can live with the position we come back to fix this corner case in the future. @TobiAjila what do you think?
404d9fb
to
99b9d25
Compare
8b12769
to
345c09f
Compare
345c09f
to
484dbc7
Compare
484dbc7
to
4704666
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i approved it on the basis that it catches the most likely cases (being good enough) and we are running out of time.
@tajila, please double-check & approve it if no more concerns. |
a7dd2c2
to
e5c8489
Compare
Just fixed the code conflicts when rebasing the branch with the latest changes. |
The changes resolve the issue with the register mapping for the struct FF/DD or its variants in upcall on z/OS by categorizing them into ALL_SP/ALL_DP placed on FPRs while other non-complex type are categorized into AGGREGATE_OTHER placed on GPRs. Fixes: eclipse-openj9#19952 Signed-off-by: ChengJin01 <[email protected]>
e5c8489
to
babde24
Compare
jenkins test sanity alinux64 jdk21 |
jenkins test sanity xlinux64 jdk22 |
jenkins test sanity xlinux jdk22 |
@dchopra001, please help confirm whether the fix works good in OpenJ9 FFI test suites. |
This change fixes the issues we observed in openj9 functional tests. We still see some failures in openjdk tests. I can't say with 100% certainty yet if they are all unrelated to this issue as I'm still working through them. However they don't look related so far. |
jenkins test sanity zlinux jdk22 |
The test failures at https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.functional_aarch64_linux_Personal/204/tapTestReport/ (jobs were not yet finished) had nothing to do with FFI related tests (passed). |
[FFI] Fix the issue with the struct FF/DD in upcall on z/OS
The changes resolve the issue with the register mapping for the
struct FF/DD or its variants in upcall on z/OS by categorizing
them into ALL_SP/ALL_DP placed on FPRs while other non-complex
type are categorized into AGGREGATE_OTHER placed on GPRs.
Fixes: #19952
Signed-off-by: ChengJin01 [email protected]