Skip to content
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

Question/Request: Does RapidJIT support windows kernel/driver addressspace (all upper bits set) #157

Open
hendrikp opened this issue Feb 7, 2018 · 7 comments

Comments

@hendrikp
Copy link

hendrikp commented Feb 7, 2018

One reason LuaJIT couldn't be ported to 64bit in a project of mine was the limitation to the 47-bit addressspace(due to the double-tagging) even after the changes to the gc the last years. Is RapidJIT now working in full 64bit-addresspace and doesn't make use anymore of undocumented win api hacks that might not be working in kernel mode?

Or if not might there be interest in a sponsorship for changing RapidJIT to use normal allocations that support true 64-bit addresses everywhere (userdata+luadata).

Thanks for the feedback

@lukego
Copy link
Contributor

lukego commented Feb 7, 2018

The 96-bit VM (#93) would allow us to use full 64-bit addresses. This would divide tagged values into a 32-bit type tag and a 64-bit value. This has not been implemented yet but to me it seems very promising.

Note that RaptorJIT does not support Windows. Supporting new operating systems would require active maintenance, full CI test coverage, and generally being a net-positive for users of existing platforms. This can be done but it can't be taken lightly.

P.S. Is there actually a CPU that supports full 64-bit address space in hardware? That would be news to me.

@hendrikp
Copy link
Author

hendrikp commented Feb 7, 2018

Ah ok sad to hear that windows is not supported, I'm not sure about CPU's physical addresses as those can't be made use of anyways; the virtual addresses in windows kernel mode have all upper bits set (kinda negative address range if you can imagine).

@lukego
Copy link
Contributor

lukego commented Feb 7, 2018

@hendrikp I'd bet there is a simple solution that you can use with LuaJIT. Sounds like you only need signed/sign-extended addresses. I would be surprised if there is not a well-known solution for this on x86. I'd start by looking in the Intel CPU manuals where they describe how the bits of an address are actually interpreted by the CPU.

@lukego
Copy link
Contributor

lukego commented Feb 7, 2018

@hendrikp Just to clarify: I am saying that virtual addresses on x86-64 are not really 64-bit on the hardware level. They are more like signed 48-bit numbers that look 64-bit due to sign extension. So I reckon you could pretty well encode any practical address in the bits LuaJIT provides.

See https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details for more details.

@hendrikp
Copy link
Author

hendrikp commented Feb 7, 2018 via email

@lukego
Copy link
Contributor

lukego commented Feb 7, 2018

@hendrikp If you want professional help to work out what the issue is and find a solution I can help you with that via http://snabb.solutions/. Windows should not be a problem if you use LuaJIT rather than RaptorJIT as the base.

@hendrikp
Copy link
Author

hendrikp commented Feb 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants