Re: Workarounds for LuaJIT's 4GB limit

  • From: Florian Weimer <fw@xxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 21 Oct 2014 18:11:19 +0200

* Sean Conner:

> It was thus said that the Great Florian Weimer once stated:
>> * Mike Pall:
>> 
>> > Florian Weimer wrote:
>> >> From this, I infer that all valid userspace pointers on x86_64 are
>> >> representable as lightuserdata values.
>> >
>> > Solaris also uses the negative x64 address space in user mode (for
>> > stacks and default mmap). I have no plans to deal with this oddity.
>> 
>> Wow.  I didn't know this was even supported by the silicon.
>
>   Why not?  Addresses presented to processes are virtual and as long as, for
> example, address $FFC0000012345670 is mapped into the process I don't see a
> problem with "negative" addresses.  

The architecture is limited to 48 bits, and you can't map stuff at
arbitrary addresses (the topmost 16 bit must all be equal).  I
mistakenly assumed that the negative addresses were reserved to kernel
data structures.

Anyway, rather soon, the 48 bit limit will fall, due to NVRAM.

Other related posts: