Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanout libsel4/include/config.h configurations #449

Merged
merged 4 commits into from
Sep 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ 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
---
Expand Down
15 changes: 15 additions & 0 deletions config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down Expand Up @@ -358,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, \
Expand Down
11 changes: 11 additions & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@
#pragma once

#include <sel4/config.h>

/* Set ENABLE_SMP_SUPPORT for kernel source files */
#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
98 changes: 0 additions & 98 deletions libsel4/include/sel4/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,101 +9,3 @@
/* Compile-time configuration parameters. Might be set by the build system. */

#include <autoconf.h>

/* 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
#endif

#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
#define CONFIG_KERNEL_LOG_BUFFER
#endif
6 changes: 6 additions & 0 deletions src/arch/arm/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down