Thread (49 messages) 49 messages, 7 authors, 2023-11-07

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

From: Mike Rapoport <rppt@kernel.org>
Date: 2023-09-23 15:42:01
Also in: bpf, linux-arm-kernel, linux-mips, linux-mm, linux-modules, linux-riscv, linux-s390, linux-trace-kernel, lkml, loongarch, netdev, sparclinux

On Thu, Sep 21, 2023 at 03:14:54PM -0700, Song Liu wrote:
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport [off-list ref] wrote:
quoted
[...]
quoted
+
+/**
+ * enum execmem_type - types of executable memory ranges
+ *
+ * There are several subsystems that allocate executable memory.
+ * Architectures define different restrictions on placement,
+ * permissions, alignment and other parameters for memory that can be used
+ * by these subsystems.
+ * Types in this enum identify subsystems that allocate executable memory
+ * and let architectures define parameters for ranges suitable for
+ * allocations by each subsystem.
+ *
+ * @EXECMEM_DEFAULT: default parameters that would be used for types that
+ * are not explcitly defined.
+ * @EXECMEM_MODULE_TEXT: parameters for module text sections
+ * @EXECMEM_KPROBES: parameters for kprobes
+ * @EXECMEM_FTRACE: parameters for ftrace
+ * @EXECMEM_BPF: parameters for BPF
+ * @EXECMEM_TYPE_MAX:
+ */
+enum execmem_type {
+       EXECMEM_DEFAULT,
I found EXECMEM_DEFAULT more confusing than helpful.
I hesitated a lot about that, but in the end decided to have
EXECMEM_DEFAULT and alias EXECMEM_MODULE_TEXT to it because this is what we
essentially have now for the most architectures.

If you'll take a look at arch-specific patches, in many cases there is only
EXECMEM_DEFAULT that an architecture defines and that default is used by
all the subsystems.
 
Song
quoted
+       EXECMEM_MODULE_TEXT = EXECMEM_DEFAULT,
+       EXECMEM_KPROBES,
+       EXECMEM_FTRACE,
+       EXECMEM_BPF,
+       EXECMEM_TYPE_MAX,
+};
+
[...]
-- 
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