Re: [PATCH v2 00/10] x86/module: rework ROX cache to avoid writable copy

From: Peter Zijlstra
Date: Wed Jan 22 2025 - 04:51:36 EST


On Tue, Jan 21, 2025 at 01:36:47PM +0100, Peter Zijlstra wrote:
> On Tue, Jan 21, 2025 at 11:57:29AM +0200, Mike Rapoport wrote:
>
> > Kirill A. Shutemov (1):
> > x86/mm/pat: restore large ROX pages after fragmentation
>
> The duplication between pmd and pud collapse is a bit annoying, but so
> be it.
>
> > Mike Rapoport (Microsoft) (9):
> > x86/mm/pat: cpa-test: fix length for CPA_ARRAY test
> > x86/mm/pat: drop duplicate variable in cpa_flush()
> > execmem: don't remove ROX cache from the direct map
> > execmem: add API for temporal remapping as RW and restoring ROX afterwards
> > module: introduce MODULE_STATE_GONE
> > module: switch to execmem API for remapping as RW and restoring ROX
> > Revert "x86/module: prepare module loading for ROX allocations of text"
> > module: drop unused module_writable_address()
> > x86: re-enable EXECMEM_ROX support
>
> All these look good on a first reading, let me go build and test the
> various options.

I've tested:

GCC: ibt=off
ibt=on
LLVM: ibt-off,cfi=off
ibt=off,cfi=kcfi
ibt=on,cfi=off
ibt=on,cfi=kcfi
ibt=on,cfi=fineibt

And all of them were able to load a module, so yay!

My plan is to merge these patches into tip/x86/mm once we have -rc1.