config: make root cnode size 4k minimum

The previous minimum (4) was actually too small to fit more than 1
capability, which would not allow the kernel to boot. A 4K minimum means
on 32-bit, an 8 size is the minimum (256 slots) and on 64-bit, 7 (128
slots).

In addition to being a more practical minimum, this also allows for
simplification of the boot code for future commits.
This commit is contained in:
Anna Lyons
2019-04-30 10:00:09 +10:00
parent f3fbf85544
commit 5fac9e8198
3 changed files with 10 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ Upcoming release: BREAKING
* Added extended bootinfo header for device tree (SEL4_BOOTINFO_HEADER_FDT). * Added extended bootinfo header for device tree (SEL4_BOOTINFO_HEADER_FDT).
* Support added for passing a device tree from the bootloader to the root task on ARM. * Support added for passing a device tree from the bootloader to the root task on ARM.
* Add seL4_VSpaceBits, the size of the top level page table. * Add seL4_VSpaceBits, the size of the top level page table.
* The root cnode size is now a minimum of 4K.
## Upgrade Notes ## Upgrade Notes
--- ---

View File

@@ -72,12 +72,13 @@ include(src/config.cmake)
config_set(KernelHaveFPU HAVE_FPU "${KernelHaveFPU}") config_set(KernelHaveFPU HAVE_FPU "${KernelHaveFPU}")
# System parameters # System parameters
config_string(KernelRootCNodeSizeBits ROOT_CNODE_SIZE_BITS "Root CNode Size (2^n slots) \ config_string(
The acceptable range is 4-27, based on the kernel-supplied caps.\ KernelRootCNodeSizeBits ROOT_CNODE_SIZE_BITS "Root CNode Size (2^n slots) \
The root CNode needs at least enough space to contain up to\ The acceptable range is 8-27 and 7-26, for 32-bit and 64-bit respectively. \
BI_CAP_DYN_START. Note that in practice your root CNode will need\ The root CNode needs at least enough space to contain up to BI_CAP_DYN_START."
to be several bits larger than 4 to fit untyped caps and\ DEFAULT 12
cannot be 27 bits as it won't fit in memory." DEFAULT 12 UNQUOTE) UNQUOTE
)
config_string(KernelTimerTickMS TIMER_TICK_MS "Timer tick period in milliseconds" DEFAULT 2 UNQUOTE) config_string(KernelTimerTickMS TIMER_TICK_MS "Timer tick period in milliseconds" DEFAULT 2 UNQUOTE)
config_string( config_string(

View File

@@ -126,7 +126,8 @@ BOOT_CODE void write_slot(slot_ptr_t slot_ptr, cap_t cap)
*/ */
compile_assert(root_cnode_size_valid, compile_assert(root_cnode_size_valid,
CONFIG_ROOT_CNODE_SIZE_BITS < 32 - seL4_SlotBits && CONFIG_ROOT_CNODE_SIZE_BITS < 32 - seL4_SlotBits &&
(1U << CONFIG_ROOT_CNODE_SIZE_BITS) >= seL4_NumInitialCaps) BIT(CONFIG_ROOT_CNODE_SIZE_BITS) >= seL4_NumInitialCaps &&
BIT(CONFIG_ROOT_CNODE_SIZE_BITS) >= (seL4_PageBits - seL4_SlotBits))
BOOT_CODE cap_t BOOT_CODE cap_t
create_root_cnode(void) create_root_cnode(void)