From 169bc07e83f93187b4a191490b54cf366f0657d5 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 25 Apr 2024 10:57:17 -0700 Subject: [PATCH] kernel: move memory domain kconfigs into its own file This moves memory domain related kconfigs into its own file Kconfig.mem_domain. Signed-off-by: Daniel Leung --- kernel/Kconfig | 54 +------------------------------------ kernel/Kconfig.mem_domain | 56 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 53 deletions(-) create mode 100644 kernel/Kconfig.mem_domain diff --git a/kernel/Kconfig b/kernel/Kconfig index 767c04f94fe..c65ec351fcb 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -943,59 +943,7 @@ config BOUNDS_CHECK_BYPASS_MITIGATION macros do nothing. endmenu - -menu "Memory Domains" - -config MAX_DOMAIN_PARTITIONS - int "Maximum number of partitions per memory domain" - default 16 - range 0 255 - depends on USERSPACE - help - Configure the maximum number of partitions per memory domain. - -config ARCH_MEM_DOMAIN_DATA - bool - depends on USERSPACE - help - This hidden option is selected by the target architecture if - architecture-specific data is needed on a per memory domain basis. - If so, the architecture defines a 'struct arch_mem_domain' which is - embedded within every struct k_mem_domain. The architecture - must also define the arch_mem_domain_init() function to set this up - when a memory domain is created. - - Typical uses might be a set of page tables for that memory domain. - -config ARCH_MEM_DOMAIN_SYNCHRONOUS_API - bool - depends on USERSPACE - help - This hidden option is selected by the target architecture if - modifying a memory domain's partitions at runtime, or changing - a memory domain's thread membership requires synchronous calls - into the architecture layer. - - If enabled, the architecture layer must implement the following - APIs: - - arch_mem_domain_thread_add - arch_mem_domain_thread_remove - arch_mem_domain_partition_remove - arch_mem_domain_partition_add - - It's important to note that although supervisor threads can be - members of memory domains, they have no implications on supervisor - thread access to memory. Memory domain APIs may only be invoked from - supervisor mode. - - For these reasons, on uniprocessor systems unless memory access - policy is managed in separate software constructions like page - tables, these APIs don't need to be implemented as the underlying - memory management hardware will be reprogrammed on context switch - anyway. -endmenu - +rsource "Kconfig.mem_domain" rsource "Kconfig.smp" config TICKLESS_KERNEL diff --git a/kernel/Kconfig.mem_domain b/kernel/Kconfig.mem_domain new file mode 100644 index 00000000000..9f94f4cdcbd --- /dev/null +++ b/kernel/Kconfig.mem_domain @@ -0,0 +1,56 @@ +# Kernel configuration options + +# Copyright (c) 2014-2015 Wind River Systems, Inc. +# SPDX-License-Identifier: Apache-2.0 + +menu "Memory Domains" + +config MAX_DOMAIN_PARTITIONS + int "Maximum number of partitions per memory domain" + default 16 + range 0 255 + depends on USERSPACE + help + Configure the maximum number of partitions per memory domain. + +config ARCH_MEM_DOMAIN_DATA + bool + depends on USERSPACE + help + This hidden option is selected by the target architecture if + architecture-specific data is needed on a per memory domain basis. + If so, the architecture defines a 'struct arch_mem_domain' which is + embedded within every struct k_mem_domain. The architecture + must also define the arch_mem_domain_init() function to set this up + when a memory domain is created. + + Typical uses might be a set of page tables for that memory domain. + +config ARCH_MEM_DOMAIN_SYNCHRONOUS_API + bool + depends on USERSPACE + help + This hidden option is selected by the target architecture if + modifying a memory domain's partitions at runtime, or changing + a memory domain's thread membership requires synchronous calls + into the architecture layer. + + If enabled, the architecture layer must implement the following + APIs: + + arch_mem_domain_thread_add + arch_mem_domain_thread_remove + arch_mem_domain_partition_remove + arch_mem_domain_partition_add + + It's important to note that although supervisor threads can be + members of memory domains, they have no implications on supervisor + thread access to memory. Memory domain APIs may only be invoked from + supervisor mode. + + For these reasons, on uniprocessor systems unless memory access + policy is managed in separate software constructions like page + tables, these APIs don't need to be implemented as the underlying + memory management hardware will be reprogrammed on context switch + anyway. +endmenu