Re: [PATCH v5 6/8] x86/module: perpare module loading for ROX allocations of text

2024-10-10 Thread Nathan Chancellor
Hi Mike, On Wed, Oct 09, 2024 at 09:08:14PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > When module text memory will be allocated with ROX permissions, the > memory at the actual address where the module will live will contain > invalid instructions and there will be a wr

Re: [PATCH v5 7/8] execmem: add support for cache of large ROX pages

2024-10-10 Thread Kees Bakker
Op 09-10-2024 om 20:08 schreef Mike Rapoport: From: "Mike Rapoport (Microsoft)" Using large pages to map text areas reduces iTLB pressure and improves performance. Extend execmem_alloc() with an ability to use huge pages with ROX permissions as a cache for smaller allocations. To populate the

Re: [PATCH v5 4/8] module: prepare to handle ROX allocations for text

2024-10-10 Thread Song Liu
On Wed, Oct 9, 2024 at 10:47 PM Mike Rapoport wrote: > > On Wed, Oct 09, 2024 at 03:23:40PM -0700, Song Liu wrote: > > On Wed, Oct 9, 2024 at 11:10 AM Mike Rapoport wrote: > > [...] > > > diff --git a/include/linux/module.h b/include/linux/module.h > > > index 88ecc5e9f523..7039f609c6ef 100644 >

Re: Bisected: [PATCH v5 8/8] x86/module: enable ROX caches for module text

2024-10-10 Thread Mike Rapoport
On Thu, Oct 10, 2024 at 05:30:33PM +0900, Sergey Senozhatsky wrote: > On (24/10/09 21:08), Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > Enable execmem's cache of PMD_SIZE'ed pages mapped as ROX for module > > text allocations. > > > > With this modprobe disappoints kmemlea

Re: [PATCH v5 7/8] execmem: add support for cache of large ROX pages

2024-10-10 Thread Mike Rapoport
On Wed, Oct 09, 2024 at 11:58:33PM -0700, Christoph Hellwig wrote: > On Wed, Oct 09, 2024 at 09:08:15PM +0300, Mike Rapoport wrote: > > /** > > * struct execmem_info - architecture parameters for code allocations > > + * @fill_trapping_insns: set memory to contain instructions that will trap > >

Re: [PATCH v5 7/8] execmem: add support for cache of large ROX pages

2024-10-10 Thread Mike Rapoport
On Wed, Oct 09, 2024 at 01:24:27PM -0700, Andrew Morton wrote: > On Wed, 9 Oct 2024 21:08:15 +0300 Mike Rapoport wrote: > > > Using large pages to map text areas reduces iTLB pressure and improves > > performance. > > Are there any measurable performance improvements? I don't have any numbers,

Re: [PATCH v5 6/8] x86/module: perpare module loading for ROX allocations of text

2024-10-10 Thread Christoph Hellwig
> +extern void apply_alternatives(struct alt_instr *start, struct alt_instr > *end, > +struct module *mod); > +extern void apply_retpolines(s32 *start, s32 *end, struct module *mod); > +extern void apply_returns(s32 *start, s32 *end, struct module *mod); > +extern void

Re: [PATCH] asm-generic: provide generic page_to_phys and phys_to_page implementations

2024-10-10 Thread Christoph Hellwig
On Thu, Oct 10, 2024 at 09:03:42AM +0200, Christoph Hellwig wrote: > > I think we should try to have a little fewer nested macros > > to evaluate here, right now this ends up expanding > > __pfn_to_phys, PFN_PHYS, PAGE_SHIFT, CONFIG_PAGE_SHIFT, > > page_to_pfn and __page_to_pfn. While the behavior

Re: [PATCH v5 2/8] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

2024-10-10 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] asm-generic: provide generic page_to_phys and phys_to_page implementations

2024-10-10 Thread Christoph Hellwig
On Wed, Oct 09, 2024 at 02:06:27PM +, Arnd Bergmann wrote: > This is clearly a good idea, and I'm happy to take that through > the asm-generic tree if there are no complaints. > > Do you have any other patches that depend on it? Well, I have new code that would benefit from these helpers, but

Bisected: [PATCH v5 8/8] x86/module: enable ROX caches for module text

2024-10-10 Thread Sergey Senozhatsky
On (24/10/09 21:08), Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Enable execmem's cache of PMD_SIZE'ed pages mapped as ROX for module > text allocations. > With this modprobe disappoints kmemleak [ 12.700128] kmemleak: Found object by alias at 0xa000a000 [ 12.70217

Re: [PATCH v5 3/8] asm-generic: introduce text-patching.h

2024-10-10 Thread Arnd Bergmann
On Wed, Oct 9, 2024, at 18:08, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Several architectures support text patching, but they name the header > files that declare patching functions differently. > > Make all such headers consistently named text-patching.h and add an empty > hea

Re: [PATCH v5 3/8] asm-generic: introduce text-patching.h

2024-10-10 Thread Geert Uytterhoeven
On Wed, Oct 9, 2024 at 8:09 PM Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Several architectures support text patching, but they name the header > files that declare patching functions differently. > > Make all such headers consistently named text-patching.h and add an empty > he