An obvious problem is the fact that 32bit applications will use 32bit addressing modes which are illegal when the processor is running in 64-bit mode.
Wow64 is just a support library to make 32bit apps run in a 64-bit OS, but that library itself is 32-bit.
If you have any supporting evidence to the contrary I’d love to read it because it’ll blow up my conception of how multi arch works on 64-bit.
Note that the concept of a process is irrelevant: processes don't exist to Intel processors. There was a concept called a "task" early on in I believe the 286 line, but nowadays all OSes just set up a single task segment on the CPU and do all of the context switching via other means, because it simply wound up being faster anyway. The processor just has tons of registers that you can flip around, and being able to switch between protected mode and long mode is a property of the code segment currently being executed (IIRC) which is something you can jump between in usermode using a far call. (And this is, as far as I know, just about the only way in which x86 segments remain relevant today.)
Thanks for correcting me!
[1] https://stackoverflow.com/questions/24113729/switch-from-32b...
But that's very windows specific, I think the general term is jumping between long mode and protected mode?
It works by setting a LDT with a 32-bit code segment and then doing a far/long cross-segment jump to the 32-bit segment. 32-bit code runs, and it jumps back to the 64-bit segment for Nt* “syscalls”, Unix lib calls, and signals.
I don’t think there’s much of a performance effect, if anything it should be faster since all the Unix code running is 64-bit (and x86_64 has more registers, newer ISA extensions). You also don’t have to worry about Unix libraries eating up precious 32-bit address space.
The only current downside is OpenGL/Vulkan calls that return (64-bit) pointers to memory, those buffers need to be copied to 32-bit before being returned to the application. A Vulkan extension is in the works for that.