From 1590badb8f9f94e18a7b9367f14767a8c702f0cd Mon Sep 17 00:00:00 2001 From: Kent McLeod Date: Fri, 9 Jul 2021 11:41:44 +1000 Subject: [PATCH 1/4] libsel4,config.h: Remove misleading #defines autoconf.h is expected to contain all defined config options for an seL4 build configuration. Having these redefinitions were leftover from when the verification build system didn't produce an autoconf.h file and set the config separately. Its more likely that these defaults would incorrectly hide an include path misconfiguration and produce settings that are inconsistent with the kernel's configuration. Signed-off-by: Kent McLeod --- libsel4/include/sel4/config.h | 81 ----------------------------------- 1 file changed, 81 deletions(-) diff --git a/libsel4/include/sel4/config.h b/libsel4/include/sel4/config.h index 0241b35d41e..fe97bc5ebe1 100644 --- a/libsel4/include/sel4/config.h +++ b/libsel4/include/sel4/config.h @@ -10,87 +10,6 @@ #include -/* size of the initial thread's root CNode (2^x slots, x >= 4) */ -#ifndef CONFIG_ROOT_CNODE_SIZE_BITS -#define CONFIG_ROOT_CNODE_SIZE_BITS 12 -#endif - -/* number of timer ticks until a thread is preempted */ -#ifndef CONFIG_KERNEL_MCS -#ifndef CONFIG_TIME_SLICE -#define CONFIG_TIME_SLICE 5 -#endif -#endif - -#ifdef CONFIG_KERNEL_MCS -#ifndef CONFIG_BOOT_THREAD_TIME_SLICE -#define CONFIG_BOOT_THREAD_TIME_SLICE 5 -#endif - -#ifndef CONFIG_KERNEL_WCET_SCALE -#define CONFIG_KERNEL_WCET_SCALE 1 -#endif -#endif - -/* the number of scheduler domains */ -#ifndef CONFIG_NUM_DOMAINS -#define CONFIG_NUM_DOMAINS 16 -#endif - -/* number of priorities per domain */ -#ifndef CONFIG_NUM_PRIORITIES -#define CONFIG_NUM_PRIORITIES 256 -#endif - -/* maximum number of caps that can be created in one retype invocation */ -#ifndef CONFIG_RETYPE_FAN_OUT_LIMIT -#define CONFIG_RETYPE_FAN_OUT_LIMIT 256 -#endif - -/* chunk size for memory clears during retype, in bits. */ -#ifndef CONFIG_RESET_CHUNK_BITS -#define CONFIG_RESET_CHUNK_BITS 8 -#endif - -/* maximum number of iterations until we preempt a delete/revoke invocation */ -#ifndef CONFIG_MAX_NUM_WORK_UNITS_PER_PREEMPTION -#define CONFIG_MAX_NUM_WORK_UNITS_PER_PREEMPTION 100 -#endif - -/* address range to flush per preemption work unit */ -#ifndef CONFIG_FLUSH_WORK_UNIT -#define CONFIG_FLUSH_WORK_UNIT 64 -#endif - -/* maximum number of untyped caps in bootinfo */ -/* WARNING: must match value in libsel4! */ -/* CONSTRAINT: (16 * CONFIG_MAX_NUM_BOOTINFO_DEVICE_REGIONS) + (5 * CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS) <= 4036 */ -#ifndef CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS -#define CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS 166 -#endif - -#ifndef CONFIG_KERNEL_MCS -/* length of a timer tick in ms */ -#ifndef CONFIG_TIMER_TICK_MS -#define CONFIG_TIMER_TICK_MS 2 -#endif -#endif - -/* maximum number of different tracepoints which can be placed in the kernel */ -#ifndef CONFIG_MAX_NUM_TRACE_POINTS -#define CONFIG_MAX_NUM_TRACE_POINTS 0 -#endif - -/* maximum number of IOMMU RMRR entries we can record while ACPI parsing */ -#ifndef CONFIG_MAX_RMRR_ENTRIES -#define CONFIG_MAX_RMRR_ENTRIES 32 -#endif - -/* maximum number of IOAPIC supported */ -#ifndef CONFIG_MAX_NUM_IOAPIC -#define CONFIG_MAX_NUM_IOAPIC 1 -#endif - /* Alias CONFIG_MAX_NUM_NODES > 1 to ENABLE_SMP_SUPPORT */ #if CONFIG_MAX_NUM_NODES > 1 #define ENABLE_SMP_SUPPORT From d2aefef387c0e3e8d267e4cda3df84070d50a00a Mon Sep 17 00:00:00 2001 From: Kent McLeod Date: Fri, 9 Jul 2021 11:57:13 +1000 Subject: [PATCH 2/4] libsel4: Fix Config name for ENABLE_SMP_SUPPORT CONFIG_ENABLE_SMP_SUPPORT has the correct namespace for a kernel config option. Signed-off-by: Kent McLeod --- CHANGES | 1 + config.cmake | 7 +++++++ include/config.h | 5 +++++ libsel4/include/sel4/config.h | 5 ----- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 40b4a1e7ba2..452b0df1d9e 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Upcoming release: BINARY COMPATIBLE * Added support for the ARM Cortex A55 * Added support for the ODroid C4 + * Rename libsel4 config option ENABLE_SMP_SUPPORT to CONFIG_ENABLE_SMP_SUPPORT to be namespace compliant. ## Upgrade Notes --- diff --git a/config.cmake b/config.cmake index 383698329fc..647f314d4ac 100644 --- a/config.cmake +++ b/config.cmake @@ -274,6 +274,13 @@ config_string( UNQUOTE ) +# Set CONFIG_ENABLE_SMP_SUPPORT as an alias of CONFIG_MAX_NUM_NODES > 1 +if(KernelMaxNumNodes GREATER 1) + config_set(KernelEnableSMPSupport ENABLE_SMP_SUPPORT ON) +else() + config_set(KernelEnableSMPSupport ENABLE_SMP_SUPPORT OFF) +endif() + config_string( KernelStackBits KERNEL_STACK_BITS "This describes the log2 size of the kernel stack. Great care should be taken as\ diff --git a/include/config.h b/include/config.h index 30d91359857..a1bdb73a91c 100644 --- a/include/config.h +++ b/include/config.h @@ -7,3 +7,8 @@ #pragma once #include + +/* Set ENABLE_SMP_SUPPORT for kernel source files */ +#ifdef CONFIG_ENABLE_SMP_SUPPORT +#define ENABLE_SMP_SUPPORT +#endif diff --git a/libsel4/include/sel4/config.h b/libsel4/include/sel4/config.h index fe97bc5ebe1..59c86a9cddf 100644 --- a/libsel4/include/sel4/config.h +++ b/libsel4/include/sel4/config.h @@ -10,11 +10,6 @@ #include -/* Alias CONFIG_MAX_NUM_NODES > 1 to ENABLE_SMP_SUPPORT */ -#if CONFIG_MAX_NUM_NODES > 1 -#define ENABLE_SMP_SUPPORT -#endif - #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT #ifdef CONFIG_ARM_PA_SIZE_BITS_40 #define AARCH64_VSPACE_S2_START_L1 From a1283e119a61de4f195041b30f787bfaa450f0e5 Mon Sep 17 00:00:00 2001 From: Kent McLeod Date: Fri, 9 Jul 2021 12:05:22 +1000 Subject: [PATCH 3/4] libsel4: Fix name for AARCH64_VSPACE_S2_START_L1 CONFIG_AARCH64_VSPACE_S2_START_L1 has the correct namespace for a kernel config option. Signed-off-by: Kent McLeod --- CHANGES | 2 ++ include/config.h | 6 ++++++ libsel4/include/sel4/config.h | 6 ------ src/arch/arm/config.cmake | 6 ++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 452b0df1d9e..c5c3c0ceb0f 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,8 @@ Upcoming release: BINARY COMPATIBLE * Added support for the ARM Cortex A55 * Added support for the ODroid C4 * Rename libsel4 config option ENABLE_SMP_SUPPORT to CONFIG_ENABLE_SMP_SUPPORT to be namespace compliant. + * Rename libsel4 config option AARCH64_VSPACE_S2_START_L1 to CONFIG_AARCH64_VSPACE_S2_START_L1 to be namespace + compliant. ## Upgrade Notes --- diff --git a/include/config.h b/include/config.h index a1bdb73a91c..d3418b8ad0a 100644 --- a/include/config.h +++ b/include/config.h @@ -12,3 +12,9 @@ #ifdef CONFIG_ENABLE_SMP_SUPPORT #define ENABLE_SMP_SUPPORT #endif + +#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT +#ifdef CONFIG_ARM_PA_SIZE_BITS_40 +#define AARCH64_VSPACE_S2_START_L1 +#endif +#endif diff --git a/libsel4/include/sel4/config.h b/libsel4/include/sel4/config.h index 59c86a9cddf..8a705ae1187 100644 --- a/libsel4/include/sel4/config.h +++ b/libsel4/include/sel4/config.h @@ -10,12 +10,6 @@ #include -#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT -#ifdef CONFIG_ARM_PA_SIZE_BITS_40 -#define AARCH64_VSPACE_S2_START_L1 -#endif -#endif - /* Configurations requring the kernel log buffer */ #if defined CONFIG_BENCHMARK_TRACK_KERNEL_ENTRIES || \ defined CONFIG_BENCHMARK_TRACEPOINTS diff --git a/src/arch/arm/config.cmake b/src/arch/arm/config.cmake index 90b89671281..e1137b6ba73 100644 --- a/src/arch/arm/config.cmake +++ b/src/arch/arm/config.cmake @@ -102,6 +102,12 @@ config_option( config_option(KernelArmGicV3 ARM_GIC_V3_SUPPORT "Build support for GICv3" DEFAULT OFF) +if(KernelArmPASizeBits40 AND ARM_HYPERVISOR_SUPPORT) + config_set(KernelAarch64VspaceS2StartL1 AARCH64_VSPACE_S2_START_L1 "ON") +else() + config_set(KernelAarch64VspaceS2StartL1 AARCH64_VSPACE_S2_START_L1 "OFF") +endif() + config_option( KernelArmHypEnableVCPUCP14SaveAndRestore ARM_HYP_ENABLE_VCPU_CP14_SAVE_AND_RESTORE "Trap, but don't save/restore VCPUs' CP14 accesses \ From 97f3bfa4872d7debb682be5cd66a83d9e90b0e91 Mon Sep 17 00:00:00 2001 From: Kent McLeod Date: Fri, 9 Jul 2021 12:09:07 +1000 Subject: [PATCH 4/4] libsel4: def. CONFIG_KERNEL_LOG_BUFFER in autoconf Define CONFIG_KERNEL_LOG_BUFFER in the same way as all other kernel config options so that it is present in autoconf.h Signed-off-by: Kent McLeod --- config.cmake | 8 ++++++++ libsel4/include/sel4/config.h | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config.cmake b/config.cmake index 647f314d4ac..b2f56b4fdc1 100644 --- a/config.cmake +++ b/config.cmake @@ -365,6 +365,14 @@ if(NOT (KernelBenchmarks STREQUAL "none")) else() config_set(KernelEnableBenchmarks ENABLE_BENCHMARKS OFF) endif() + +# Reflect the existance of kernel Log buffer +if(KernelBenchmarksTrackKernelEntries OR KernelBenchmarksTracepoints) + config_set(KernelLogBuffer KERNEL_LOG_BUFFER ON) +else() + config_set(KernelLogBuffer KERNEL_LOG_BUFFER OFF) +endif() + config_string( KernelMaxNumTracePoints MAX_NUM_TRACE_POINTS "Use TRACE_POINT_START(k) and TRACE_POINT_STOP(k) macros for recording data, \ diff --git a/libsel4/include/sel4/config.h b/libsel4/include/sel4/config.h index 8a705ae1187..5ae039efc9d 100644 --- a/libsel4/include/sel4/config.h +++ b/libsel4/include/sel4/config.h @@ -9,9 +9,3 @@ /* Compile-time configuration parameters. Might be set by the build system. */ #include - -/* Configurations requring the kernel log buffer */ -#if defined CONFIG_BENCHMARK_TRACK_KERNEL_ENTRIES || \ - defined CONFIG_BENCHMARK_TRACEPOINTS -#define CONFIG_KERNEL_LOG_BUFFER -#endif