AsahiLinux / linux

Linux kernel source tree
Other
2.25k stars 87 forks source link

TSO Support and execve #189

Open wrenger opened 1 year ago

wrenger commented 1 year ago

In 6.3 @marcan added rudimentary TSO support over prctl (https://github.com/AsahiLinux/linux/commit/b5c05cbffb0488c7618106926d522cc3b43d93d5). This toggles the memory model for the currently running process. A caveat of the current implementation is that this does not survive execve. Is this the expected behavior or a bug?

Context: I would like to run some unmodified executables with TSO enabled and the prctl+execve way would be perfect for this. Unfortunately, I do not know any other way to enable TSO for this. Especially as the kernel modules (cyyself/m1tso-linux, leeehui/tso-enabler) that enabled this system-wide are not working anymore.

wrenger commented 1 year ago

Here, it is disabled after exec:

https://github.com/AsahiLinux/linux/blob/b5c05cbffb0488c7618106926d522cc3b43d93d5/arch/arm64/kernel/process.c#L715-L717