Closed Lucus16 closed 2 years ago
This looks like a good idea, thanks. Do you know how this interacts with the 4k/16k pages? What is the performance like? Having x86 emulate ARM is pretty miserable, but it is functional.
A build of GNU hello takes 15 seconds native and 5 minutes when using x86 emulation and 4k pages. It's not fast. I'll try 16k pages later.
With 16k pages, x86 emulation works too. The GNU hello build fails near the end on a patchelf invocation, after a little over 5 minutes. I'd say binfmt_misc is compatible with 16k pages but emulated patchelf is not. We could add a NixOS assertion like boot.kernelBuildIs16K -> boot.binfmt.emulatedSystems == [ ]
.
Compiling the kernel with BINFMT_MISC allows users to emulate x86 software much like Rosetta on macos with: