On Sat, Dec 03 2022 at 16:46, Mike Rapoport wrote: > On Thu, Dec 01, 2022 at 11:34:57PM +0100, Thomas Gleixner wrote: >> If you mix this, then you end up with RWX for the whole 2M page. Not an >> option really as you lose _all_ protections in one go. > > I meant to take one 2M page from the direct map and split it to 4K in the > module address space. Then the protection could be done at PTE level after > relocations etc and it would save the dance with text poking. I see what you meant. > But if mapping the code with 2M pages gives massive performance > improvements, it's surely better to keep 2M pages in the modules > space. Yes.