Thread (16 messages) 16 messages, 5 authors, 2024-09-19

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

From: Mike Rapoport <rppt@kernel.org>
Date: 2024-09-15 13:51:46
Also in: bpf, linux-alpha, linux-arch, linux-m68k, linux-mips, linux-mm, linux-modules, linux-riscv, linux-sh, linux-um, linuxppc-dev, lkml, loongarch, sparclinux

Hi Ard,

On Fri, Sep 13, 2024 at 05:00:42PM +0200, Ard Biesheuvel wrote:
Hi Mike,

On Mon, 9 Sept 2024 at 08:51, Mike Rapoport [off-list ref] wrote:
...
quoted
+static void execmem_fill_trapping_insns(void *ptr, size_t size, bool writable)
+{
+       if (execmem_info->fill_trapping_insns)
+               execmem_info->fill_trapping_insns(ptr, size, writable);
+       else
+               memset(ptr, 0, size);
Does this really have to be a function pointer with a runtime check?

This could just be a __weak definition, with the arch providing an
override if the memset() is not appropriate.
I prefer to keep this a method in execmem_info rather that have a __weak
definition that architectures can override.

This is not on the hot path, so I don't think a runtime check here would
matter. Still, I can fill in a default with memset at init time.

-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help