-
Notifications
You must be signed in to change notification settings - Fork 931
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
s390x support for Luajit #395
base: v2.1
Are you sure you want to change the base?
Conversation
Guesses for now based on the ELF ABI supplement for zSeries.
Stick to the default until we know what we actually need.
Added missing elif condition for s390x for GCC dependency
Removing the gcc check for now .. missed micheal's comment earlier
changed instruction opcode to 64bit
Added s390x specific condition codes
made some changes like mentioning arch from x86 to S390x removed some x86 specific code
Added CFrame definations for S390X values un assigned as i am unsure of the values
Referred arm dasc file have created slots wherein i have to replace them with s390x registers and instructions
Assigned general purpose register to existing macros
Added definitions to macros savereg and restreg used Store and Load instructions to store and load register contents to n from memory
These are educated guesses at this point. We might need more stack space because we don't have many free registers available.
I believe these macros obey the C calling convention, so we need to allocate our stack frame and save all callee-save registers. We can tune it later if it turns out we don't need all the registers.
f8-f15 are callee-saved (not f0,f2,f4 and f6). There isn't space for them in the caller's stack frame so we need to increase the size of the interpreter's stack frame.
Still guessing at this point. This code will need to be changed.
used MOVE LONG EXTENDED in place of mov and MOVE LONG instead of movzx
added instructions to macros, referring macro defination of x86 for macro ins_ANDdid not find equivalent s390x replacement instruction for 'Not' hence have currently marked the place as '????' '????' has to be replaced with s390x complement instruction
added definations to macros to test operand type refeered x86 definations no JUMP instruction found for s390x used BRANCH RELATIVE on CONDITION instead (brc) Not sure how the condition will be checked , need to discuss this
The extra check for register is currently ignored, and trying to see what value does the encode function return. Its still to be worked out, how this value is used later, after decoding.
We can discuss if we need to keep it 6 bytes or 8 bytes long, Not clear enough to me as well
I have added the number depending on the number of operands, pls check for the ones which access memory. Also For base register and displacement, should I assume that it will be passed in the same order as it is expected, since I dont have any means to see the output, I am confused a bit for those add modes. Since we decided to test RR first, thats in progress, but would like to add others as well.
- Fix syntax errors - Fix whitespace (use two-space indentation to match surrounding code)
It's convenient for sp to be a pseudonym for r15 (the stack pointer). 'or_2' doesn't need to be special cased ('or' did because it is a keyword).
Each memory operand will be a single parameter so we also need to update the instruction encoding nargs field.
Also sets the action list type to unsigned short (uint16_t) which I think is the most appropriate type for s390x (x86 uses uint8_t and other platforms use uint32_t).
@siddhesh , if you would look for some s390x and ppc64le hw for things like CI, let me know, we can arrange that. |
Let me know if you need s390x hardware access for CI or testing - happy to help provide. |
I did a quick test on a zEC12 machine running Fedora 29 with "make all check bench" and all looks good. |
Thanks for testing, I'll merge it into my v2.1 and work on getting it into Fedora. |
Hi, I have now merged the s390x port into my tree in v2.1 branch and also pushed the patch into Fedora rawhide[1]. F30 is already branched so this will automatically go into F31, but I'll also check with Igor to see if he is comfortable backporting the patches to F30. I've started pushing my branch patches into Debian, which is a bit slow going (since I am less familiar with Debian processes than Fedora) but the maintainer has agreed in principle to accept patches. [1] https://koji.fedoraproject.org/koji/buildinfo?buildID=1254116 |
Sounds good, I suppose there is a plan for long term maintenance of the fork, right? |
For now my goal is to try and regain the lost momentum on the project by cherry-picking PRs into my fork and them pushing them into distributions and staying in sync with this repo at the same time. Please get in touch with me on siddhesh at gotplt dot org to continue the discussion on the fork since this PR may not be the best place to do that. |
Any updates on if this will be merged? |
I'm having an issue building lyaml with this patchset. If you install gcc, git, libyaml-devel, and the patched luajit, checkout lyaml, and run
I don't see this with lua on s390x, or with (patched) luajit on other arches that I have tried. |
lyaml issue is fixed by moonjit#107 |
Hi ccorley! |
Thanks, rinaldou! After I pulled that fix in, I was able to build as well. For anyone else that runs into this, I created a LuaJIT patch for that 2-line change from the OpenResty 1.17.8.2 source, then applied the patch during the kong-build-tools package-kong step. Also important, I used the kong 'next' source branch. |
What is the status here? |
From my understanding, they have an instance for testing. Not sure what
other blockers exist
|
That's me (moonjit) who has that instance, which is different from LuaJIT/LuaJIT. Given that I'm not actively involved in either project, please feel free to take that instance back and offer it to Mike. I don't have anything to salvage from that instance. |
need to resolve the conflicting files first |
Thank you for this engagement! We would be happy about this enablement. |
The Lua module for nginx now requires luajit to function. As a result, it is now impossible to build nginx for s390x arch in Debian because there is zero support for s390x in LuaJIT. Can this get put in a higher priority list for the LuaJIT team? |
Considering the fact that this PR has been sitting for over 4 years with absolutely zero response from LuaJIT or anyone even remotely connected to LuaJIT (not members or even contributors), I have doubts that this will ever be merged or even acknowledged. The best course of action here is to abandon all hope of getting this merged upstream, and make a high-quality third-party package/distribution that everyone can depend on. |
This PR needs some clean-up. I don't think it's reasonable to merge it with 261 individual commits. |
I am working with the Open Mainframe Project (part of the Linux Foundation) to get this cleaned up and to address the concerns in #395 (comment). We hope to get this done over the next couple of months and to generate a PR that is more acceptable. |
I'm currently working with the Open Mainframe Project under @nealef on cleaning this PR, resolving merge conflicts and addressing any other concerns with a goal of merging it in couple of months. I'll be splitting this PR into 2 or more PRs for easier reviewing purposes. |
The mentorship program by the Linux Foundation is finished and the s390x support is provided by #891 . You can receive a Linux vm for verification for free for 120 days on a mainframe via this link: https://developer.ibm.com/articles/get-started-with-ibm-linuxone/ If you want to receive long-term access as an Open Source Community Member, you can use this form with a reference to the special open source project: https://www.ibm.com/community/z/open-source/virtual-machines-request/ Choosable Linux distributions: SLES (upgradable to openSUSE), RHEL, Ubuntu, debian |
Added necessary code to support arch s390x in Luajit.