https://bugs.winehq.org/show_bug.cgi?id=48291
--- Comment #40 from Zebediah Figura z.figura12@gmail.com --- Ultimately, if we really want to pursue making direct syscalls work (and I still wince that the idea isn't immediately thrown out as absurd), I think we'll need to start talking to the Linux kernel about giving us a custom interface that makes it easy and performant.
I'm not a kernel developer, but I'll just throw some things out here. Knowing that we're going to have to start introducing some universal thunking at PE <-> Unix boundaries anyway (for e.g. ARM64's x18), the most ideal thing would be to make part of that a way to toggle whether syscalls should be trapped or not. That toggle of course wouldn't be able to involve a syscall itself; it would probably have to point to some bit of global memory that is registered at an early point in the process.