diff --git a/repos/base-sel4/lib/import/import-syscall-sel4.mk b/repos/base-sel4/lib/import/import-syscall-sel4.mk index 9f64c6cd05..db6e4cbdf2 100644 --- a/repos/base-sel4/lib/import/import-syscall-sel4.mk +++ b/repos/base-sel4/lib/import/import-syscall-sel4.mk @@ -10,6 +10,3 @@ INC_DIR += $(SEL4_INCLUDE_DIR) # Access to other sel4-specific headers such as 'autoconf.h'. # INC_DIR += $(SEL4_INCLUDE_DIR)/sel4 - -# required for seL4_DebugPutChar -CC_OPT += -DCONFIG_PRINTING diff --git a/repos/base-sel4/patches/acpi_bootinfo.patch b/repos/base-sel4/patches/acpi_bootinfo.patch deleted file mode 100644 index 8a2dba6401..0000000000 --- a/repos/base-sel4/patches/acpi_bootinfo.patch +++ /dev/null @@ -1,146 +0,0 @@ ---- src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h -+++ src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h -@@ -65,7 +65,12 @@ - seL4_SlotRegion extraBIPages; /* caps for any pages used to back the additional bootinfo information */ - seL4_Uint8 initThreadCNodeSizeBits; /* initial thread's root CNode size (2^n slots) */ - seL4_Domain initThreadDomain; /* Initial thread's domain ID */ -- seL4_Word archInfo; /* tsc freq on x86, unused on arm */ -+ struct { -+ seL4_Word tsc; /* tsc freq on x86, unused on arm */ -+ seL4_Word revision; -+ seL4_Word rsdt; -+ unsigned long long xsdt; -+ } archInfo; - seL4_SlotRegion untyped; /* untyped-object caps (untyped caps) */ - seL4_UntypedDesc untypedList[CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS]; /* information about each untyped */ - /* the untypedList should be the last entry in this struct, in order ---- src/kernel/sel4/include/arch/x86/arch/kernel/boot.h -+++ src/kernel/sel4/include/arch/x86/arch/kernel/boot.h -@@ -41,7 +41,8 @@ - paddr_t* drhu_list, - acpi_rmrr_list_t *rmrr_list, - seL4_X86_BootInfo_VBE *vbe, -- seL4_X86_BootInfo_mmap_t *mb_mmap -+ seL4_X86_BootInfo_mmap_t *mb_mmap, -+ acpi_info_t* acpi_info - ); - - bool_t init_cpu( ---- src/kernel/sel4/src/plat/pc99/machine/acpi.c -+++ src/kernel/sel4/src/plat/pc99/machine/acpi.c -@@ -30,10 +30,10 @@ - uint8_t revision; - uint32_t rsdt_address; - uint32_t length; -- uint32_t xsdt_address[2]; -+ uint64_t xsdt_address; - uint8_t extended_checksum; - char reserved[3]; --} acpi_rsdp_t; -+} PACKED acpi_rsdp_t; - compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == 36) - - /* DMA Remapping Reporting Table */ -@@ -245,7 +245,7 @@ - } - - BOOT_CODE acpi_rsdt_t* --acpi_init(void) -+acpi_init(acpi_info_t *acpi_info) - { - acpi_rsdp_t* acpi_rsdp = acpi_get_rsdp(); - acpi_rsdt_t* acpi_rsdt; -@@ -259,6 +259,12 @@ - acpi_rsdp = acpi_table_init(acpi_rsdp, ACPI_RSDP); - printf("ACPI: RSDP vaddr=%p\n", acpi_rsdp); - -+ if (acpi_info) { -+ acpi_info->revision = acpi_rsdp->revision; -+ acpi_info->phys_rsdt = acpi_rsdp->rsdt_address; -+ acpi_info->phys_xsdt = acpi_rsdp->xsdt_address; -+ } -+ - acpi_rsdt = (acpi_rsdt_t*)(word_t)acpi_rsdp->rsdt_address; - printf("ACPI: RSDT paddr=%p\n", acpi_rsdt); - acpi_rsdt_mapped = (acpi_rsdt_t*)acpi_table_init(acpi_rsdt, ACPI_RSDT); ---- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -+++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -@@ -34,7 +34,13 @@ - uint32_t entry[1]; - } PACKED acpi_rsdt_t; - --acpi_rsdt_t* acpi_init(void); -+typedef struct acpi_info_t { -+ uint32_t revision; -+ uint32_t phys_rsdt; -+ uint64_t phys_xsdt; -+} acpi_info_t; -+ -+acpi_rsdt_t * acpi_init(acpi_info_t *); - - uint32_t acpi_madt_scan( - acpi_rsdt_t* acpi_rsdt, ---- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -+++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -@@ -187,7 +187,7 @@ - } - - static BOOT_CODE bool_t --try_boot_sys_node(cpu_id_t cpu_id) -+try_boot_sys_node(cpu_id_t cpu_id, acpi_info_t* acpi_info) - { - p_region_t boot_mem_reuse_p_reg; - -@@ -224,7 +224,8 @@ - boot_state.drhu_list, - &boot_state.rmrr_list, - &boot_state.vbe_info, -- &boot_state.mb_mmap_info -+ &boot_state.mb_mmap_info, -+ acpi_info - )) { - return false; - } -@@ -487,7 +488,8 @@ - } - - /* get ACPI root table */ -- acpi_rsdt = acpi_init(); -+ acpi_info_t acpi_info = { 0, 0, 0 }; -+ acpi_rsdt = acpi_init(&acpi_info); - if (!acpi_rsdt) { - return false; - } -@@ -597,7 +599,7 @@ - ksNumCPUs = boot_state.num_cpus; - - printf("Starting node #0 with APIC ID %lu\n", boot_state.cpus[0]); -- if (!try_boot_sys_node(boot_state.cpus[0])) { -+ if (!try_boot_sys_node(boot_state.cpus[0], &acpi_info)) { - return false; - } - ---- src/kernel/sel4/src/arch/x86/kernel/boot.c -+++ src/kernel/sel4/src/arch/x86/kernel/boot.c -@@ -250,7 +250,8 @@ - paddr_t* drhu_list, - acpi_rmrr_list_t *rmrr_list, - seL4_X86_BootInfo_VBE *vbe, -- seL4_X86_BootInfo_mmap_t *mb_mmap -+ seL4_X86_BootInfo_mmap_t *mb_mmap, -+ acpi_info_t* acpi_info - ) - { - cap_t root_cnode_cap; -@@ -405,7 +406,10 @@ - } - write_it_asid_pool(it_ap_cap, it_vspace_cap); - -- ndks_boot.bi_frame->archInfo = tsc_init(); -+ ndks_boot.bi_frame->archInfo.tsc = tsc_init(); -+ ndks_boot.bi_frame->archInfo.revision = acpi_info->revision; -+ ndks_boot.bi_frame->archInfo.rsdt = acpi_info->phys_rsdt; -+ ndks_boot.bi_frame->archInfo.xsdt = acpi_info->phys_xsdt; - - /* create the idle thread */ - if (!create_idle_thread()) { diff --git a/repos/base-sel4/patches/acpi_mbi2.patch b/repos/base-sel4/patches/acpi_mbi2.patch new file mode 100644 index 0000000000..54e5b13887 --- /dev/null +++ b/repos/base-sel4/patches/acpi_mbi2.patch @@ -0,0 +1,84 @@ +--- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h ++++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h +@@ -15,6 +15,11 @@ + #include + #include + ++enum acpi_size { ++ ACPI_V1_SIZE = 20, ++ ACPI_V2_SIZE = 36 ++}; ++ + /* Generic System Descriptor Table Header */ + typedef struct acpi_header { + char signature[4]; +@@ -40,7 +45,7 @@ typedef struct acpi_rsdp { + uint8_t extended_checksum; + char reserved[3]; + } PACKED acpi_rsdp_t; +-compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == 36) ++compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == ACPI_V2_SIZE) + + /* Root System Descriptor Table */ + typedef struct acpi_rsdt { +--- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c ++++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c +@@ -651,12 +651,14 @@ try_boot_sys_mbi2( + if (tag->type == MULTIBOOT2_TAG_CMDLINE) { + char const * const cmdline = (char const * const)(behind_tag); + cmdline_parse(cmdline, &cmdline_opt); +- } else if (tag->type == MULTIBOOT2_TAG_ACPI) { +- if (sizeof(boot_state.acpi_rsdp) != tag->size - sizeof(*tag)) { +- printf("sizeof ACPI RSDP unexpected %ld!=%lu\n", (long)sizeof(boot_state.acpi_rsdp), (long)tag->size - sizeof(*tag)); +- return false; ++ } else if (tag->type == MULTIBOOT2_TAG_ACPI_1) { ++ if (ACPI_V1_SIZE == tag->size - sizeof(*tag)) { ++ memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, tag->size - sizeof(*tag)); ++ } ++ } else if (tag->type == MULTIBOOT2_TAG_ACPI_2) { ++ if (sizeof(boot_state.acpi_rsdp) == tag->size - sizeof(*tag)) { ++ memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, sizeof(boot_state.acpi_rsdp)); + } +- memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, sizeof(boot_state.acpi_rsdp)); + } else if (tag->type == MULTIBOOT2_TAG_MODULE) { + multiboot2_module_t const * module = (multiboot2_module_t const *)behind_tag; + printf( +--- src/kernel/sel4/src/plat/pc99/machine/acpi.c ++++ src/kernel/sel4/src/plat/pc99/machine/acpi.c +@@ -182,7 +182,7 @@ acpi_get_rsdp(void) + + for (addr = (char*)BIOS_PADDR_START; addr < (char*)BIOS_PADDR_END; addr += 16) { + if (strncmp(addr, acpi_str_rsd, 8) == 0) { +- if (acpi_calc_checksum(addr, 20) == 0) { ++ if (acpi_calc_checksum(addr, ACPI_V1_SIZE) == 0) { + return (acpi_rsdp_t*)addr; + } + } +@@ -255,8 +255,13 @@ acpi_validate_rsdp(acpi_rsdp_t *acpi_rsdp) + acpi_rsdt_t* acpi_rsdt; + acpi_rsdt_t* acpi_rsdt_mapped; + +- if (acpi_calc_checksum((char*)acpi_rsdp, 20) != 0) { +- printf("BIOS: ACPI information corrupt\n"); ++ if (acpi_calc_checksum((char*)acpi_rsdp, ACPI_V1_SIZE) != 0) { ++ printf("BIOS: ACPIv1 information corrupt\n"); ++ return false; ++ } ++ ++ if (acpi_rsdp->revision > 0 && acpi_calc_checksum((char*)acpi_rsdp, sizeof(*acpi_rsdp)) != 0) { ++ printf("BIOS: ACPIv2 information corrupt\n"); + return false; + } + +--- src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h ++++ src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h +@@ -43,7 +43,8 @@ enum multiboot2_tags { + MULTIBOOT2_TAG_CMDLINE = 1, + MULTIBOOT2_TAG_MODULE = 3, + MULTIBOOT2_TAG_MEMORY = 6, +- MULTIBOOT2_TAG_ACPI = 15, ++ MULTIBOOT2_TAG_ACPI_1 = 14, ++ MULTIBOOT2_TAG_ACPI_2 = 15, + }; + + #endif diff --git a/repos/base-sel4/patches/autoconf_32.config b/repos/base-sel4/patches/autoconf_32.config deleted file mode 100644 index 2a3942a42a..0000000000 --- a/repos/base-sel4/patches/autoconf_32.config +++ /dev/null @@ -1,76 +0,0 @@ ---- src/kernel/sel4/configs/pc99/ia32/autoconf.h -+++ src/kernel/sel4/configs/pc99/ia32/autoconf.h -@@ -24,7 +24,8 @@ - #define CONFIG_HAVE_LIBC 1 - #define CONFIG_USER_COMPILER "" - #define CONFIG_LIB_SEL4_PLAT_SUPPORT 1 --#define CONFIG_WORD_SIZE 64 -+#define CONFIG_WORD_SIZE 32 -+#define CONFIG_ARCH_X86_GENERIC 1 - #define CONFIG_ARCH_X86 1 - #define CONFIG_APP_TESTS 1 - #define CONFIG_MAX_NUM_IOAPIC 1 -@@ -32,15 +33,14 @@ - #define CONFIG_SEL4UTILS_STACK_SIZE 655360 - #define CONFIG_HAVE_LIB_SEL4_ALLOCMAN 1 - #define CONFIG_FASTPATH 1 --#define CONFIG_X2APIC 1 - #define CONFIG_LIB_SEL4_VKA_DEBUG_LIVE_OBJS_SZ 0 --#define CONFIG_HAVE_TIMER 1 - #define CONFIG_SEL4UTILS_CSPACE_SIZE_BITS 18 - #define CONFIG_DOMAIN_SCHEDULE "" - #define CONFIG_LIB_SEL4 1 - #define CONFIG_LIBSEL4DEBUG_FUNCTION_INSTRUMENTATION_NONE 1 - #define CONFIG_LIB_SEL4_UTILS 1 - #define CONFIG_LIB_SEL4_VSPACE 1 -+#define CONFIG_PRINTING 1 - #define CONFIG_LIB_PLATSUPPORT 1 - #define CONFIG_LIB_SEL4_ALLOCMAN 1 - #define CONFIG_HAVE_LIB_SEL4_SIMPLE_DEFAULT 1 -@@ -49,8 +49,7 @@ - #define CONFIG_HAVE_LIB_SEL4_VSPACE 1 - #define CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS 230 - #define CONFIG_LIB_SEL4_VKA_DEBUG_LIVE_SLOTS_SZ 0 --#define CONFIG_SYSCALL 1 --#define CONFIG_MAX_NUM_NODES 1 -+#define CONFIG_MAX_NUM_NODES 16 - #define CONFIG_CROSS_COMPILER_PREFIX "" - #define CONFIG_MAX_RMRR_ENTRIES 32 - #define CONFIG_LIB_SEL4_INLINE_INVOCATIONS 1 -@@ -66,7 +65,9 @@ - #define CONFIG_OPTIMISATION_O2 1 - #define CONFIG_HAVE_LIB_CPIO 1 - #define CONFIG_HAVE_LIB_SEL4_VKA 1 --#define CONFIG_FSGSBASE_INST 1 -+#define CONFIG_XAPIC 1 -+#define CONFIG_SYSENTER 1 -+#define CONFIG_FSGSBASE_GDT 1 - #define CONFIG_HAVE_LIB_SEL4_PLAT_SUPPORT 1 - #define CONFIG_USER_EXTRA_CFLAGS "-D_XOPEN_SOURCE=700" - #define CONFIG_HAVE_FPU 1 -@@ -76,11 +77,12 @@ - #define CONFIG_SUPPORT_PCID 1 - #define CONFIG_HAVE_LIB_PLATSUPPORT 1 - #define CONFIG_NUM_DOMAINS 1 -+#define CONFIG_ARCH_IA32 1 - #define CONFIG_HAVE_LIB_UTILS 1 - #define CONFIG_USER_OPTIMISATION_O2 1 - #define CONFIG_LIB_CPIO 1 - #define CONFIG_RETYPE_FAN_OUT_LIMIT 256 --#define CONFIG_ROOT_CNODE_SIZE_BITS 16 -+#define CONFIG_ROOT_CNODE_SIZE_BITS 18 - #define CONFIG_NUM_PRIORITIES 256 - #define CONFIG_TESTPRINTER_REGEX ".*" - #define CONFIG_APP_SEL4TEST 1 -@@ -92,9 +94,8 @@ - #define CONFIG_KERNEL_EXTRA_CPPFLAGS "" - #define CONFIG_LIBSEL4DEBUG_ALLOC_BUFFER_ENTRIES 128 - #define CONFIG_CACHE_LN_SZ 64 --#define CONFIG_ARCH_X86_64 1 - #define CONFIG_HUGE_PAGE 1 - #define CONFIG_LIB_SEL4_MUSLC_SYS_MORECORE_BYTES 1048576 - #define CONFIG_BUILDSYS_USE_CCACHE 1 --#define CONFIG_MAX_NUM_NODES 1 --#define CONFIG_KERNEL_STACK_BITS 12 -+#define CONFIG_ENABLE_BENCHMARKS 1 -+#define CONFIG_BENCHMARK_TRACK_UTILISATION 1 diff --git a/repos/base-sel4/patches/autoconf_32.patch b/repos/base-sel4/patches/autoconf_32.patch new file mode 100644 index 0000000000..f671437222 --- /dev/null +++ b/repos/base-sel4/patches/autoconf_32.patch @@ -0,0 +1,46 @@ +--- src/kernel/sel4/configs/pc99/autoconf.h ++++ src/kernel/sel4/configs/pc99/autoconf.h +@@ -51,13 +51,13 @@ + #define CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS 167 + #define CONFIG_FPU_MAX_RESTORES_SINCE_SWITCH 64 + #define CONFIG_LIB_SEL4_VKA_DEBUG_LIVE_SLOTS_SZ 0 +-#define CONFIG_MAX_NUM_NODES 1 ++#define CONFIG_MAX_NUM_NODES 16 + #define CONFIG_CROSS_COMPILER_PREFIX "" + #define CONFIG_LIB_SEL4_INLINE_INVOCATIONS 1 + #define CONFIG_LIB_SEL4_MUSLC_SYS 1 + #define CONFIG_HAVE_LIB_SEL4_TEST 1 + #define CONFIG_LIB_MUSL_C 1 +-#define CONFIG_ARCH_X86_NEHALEM 1 ++#define CONFIG_ARCH_X86_GENERIC 1 + #define CONFIG_MAX_NUM_WORK_UNITS_PER_PREEMPTION 100 + #define CONFIG_USER_CFLAGS "" + #define CONFIG_HAVE_LIB_SEL4_DEBUG 1 +@@ -75,13 +75,13 @@ + #define CONFIG_HAVE_LIB_SEL4_SIMPLE 1 + #define CONFIG_HAVE_LIB_ELF 1 + #define CONFIG_HAVE_LIB_PLATSUPPORT 1 +-#define CONFIG_NUM_DOMAINS 16 ++#define CONFIG_NUM_DOMAINS 1 + #define CONFIG_ARCH_IA32 1 + #define CONFIG_HAVE_LIB_UTILS 1 + #define CONFIG_USER_OPTIMISATION_O2 1 + #define CONFIG_LIB_CPIO 1 + #define CONFIG_RETYPE_FAN_OUT_LIMIT 256 +-#define CONFIG_ROOT_CNODE_SIZE_BITS 16 ++#define CONFIG_ROOT_CNODE_SIZE_BITS 18 + #define CONFIG_NUM_PRIORITIES 256 + #define CONFIG_TESTPRINTER_REGEX ".*" + #define CONFIG_APP_SEL4TEST 1 +@@ -96,6 +96,11 @@ + #define CONFIG_CACHE_LN_SZ 64 + #define CONFIG_LIB_SEL4_MUSLC_SYS_MORECORE_BYTES 1048576 + #define CONFIG_BUILDSYS_USE_CCACHE 1 ++#define CONFIG_MULTIBOOT1_HEADER ++#define CONFIG_MULTIBOOT2_HEADER ++#define CONFIG_PRINTING 1 ++#define CONFIG_ENABLE_BENCHMARKS 1 ++#define CONFIG_BENCHMARK_TRACK_UTILISATION 1 + #else + #define AUTOCONF_INCLUDED + #define CONFIG_LIB_SEL4_SIMPLE 1 diff --git a/repos/base-sel4/patches/autoconf_64.config b/repos/base-sel4/patches/autoconf_64.patch similarity index 73% rename from repos/base-sel4/patches/autoconf_64.config rename to repos/base-sel4/patches/autoconf_64.patch index bdeb0b4f74..4437c00032 100644 --- a/repos/base-sel4/patches/autoconf_64.config +++ b/repos/base-sel4/patches/autoconf_64.patch @@ -1,14 +1,6 @@ ---- src/kernel/sel4/configs/pc99/x86_64/autoconf.h -+++ src/kernel/sel4/configs/pc99/x86_64/autoconf.h -@@ -25,6 +25,7 @@ - #define CONFIG_USER_COMPILER "" - #define CONFIG_LIB_SEL4_PLAT_SUPPORT 1 - #define CONFIG_WORD_SIZE 64 -+#define CONFIG_ARCH_X86_GENERIC 1 - #define CONFIG_ARCH_X86 1 - #define CONFIG_APP_TESTS 1 - #define CONFIG_MAX_NUM_IOAPIC 1 -@@ -32,7 +33,7 @@ +--- src/kernel/sel4/configs/pc99/autoconf.h ++++ src/kernel/sel4/configs/pc99/autoconf.h +@@ -129,7 +129,7 @@ #define CONFIG_SEL4UTILS_STACK_SIZE 655360 #define CONFIG_HAVE_LIB_SEL4_ALLOCMAN 1 #define CONFIG_FASTPATH 1 @@ -17,24 +9,15 @@ #define CONFIG_LIB_SEL4_VKA_DEBUG_LIVE_OBJS_SZ 0 #define CONFIG_HAVE_TIMER 1 #define CONFIG_SEL4UTILS_CSPACE_SIZE_BITS 18 -@@ -41,6 +42,7 @@ - #define CONFIG_LIBSEL4DEBUG_FUNCTION_INSTRUMENTATION_NONE 1 - #define CONFIG_LIB_SEL4_UTILS 1 - #define CONFIG_LIB_SEL4_VSPACE 1 -+#define CONFIG_PRINTING 1 - #define CONFIG_LIB_PLATSUPPORT 1 - #define CONFIG_LIB_SEL4_ALLOCMAN 1 - #define CONFIG_HAVE_LIB_SEL4_SIMPLE_DEFAULT 1 -@@ -50,7 +52,7 @@ +@@ -147,7 +147,6 @@ #define CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS 230 #define CONFIG_LIB_SEL4_VKA_DEBUG_LIVE_SLOTS_SZ 0 #define CONFIG_SYSCALL 1 -#define CONFIG_MAX_NUM_NODES 1 -+#define CONFIG_MAX_NUM_NODES 16 #define CONFIG_CROSS_COMPILER_PREFIX "" #define CONFIG_MAX_RMRR_ENTRIES 32 #define CONFIG_LIB_SEL4_INLINE_INVOCATIONS 1 -@@ -66,21 +68,20 @@ +@@ -162,21 +161,20 @@ #define CONFIG_OPTIMISATION_O2 1 #define CONFIG_HAVE_LIB_CPIO 1 #define CONFIG_HAVE_LIB_SEL4_VKA 1 @@ -48,7 +31,8 @@ #define CONFIG_HAVE_LIB_ELF 1 -#define CONFIG_SUPPORT_PCID 1 #define CONFIG_HAVE_LIB_PLATSUPPORT 1 - #define CONFIG_NUM_DOMAINS 1 +-#define CONFIG_NUM_DOMAINS 16 ++#define CONFIG_NUM_DOMAINS 1 #define CONFIG_HAVE_LIB_UTILS 1 #define CONFIG_USER_OPTIMISATION_O2 1 #define CONFIG_LIB_CPIO 1 @@ -58,7 +42,7 @@ #define CONFIG_NUM_PRIORITIES 256 #define CONFIG_TESTPRINTER_REGEX ".*" #define CONFIG_APP_SEL4TEST 1 -@@ -93,8 +94,8 @@ +@@ -189,9 +187,14 @@ #define CONFIG_LIBSEL4DEBUG_ALLOC_BUFFER_ENTRIES 128 #define CONFIG_CACHE_LN_SZ 64 #define CONFIG_ARCH_X86_64 1 @@ -66,6 +50,12 @@ #define CONFIG_LIB_SEL4_MUSLC_SYS_MORECORE_BYTES 1048576 #define CONFIG_BUILDSYS_USE_CCACHE 1 -#define CONFIG_MAX_NUM_NODES 1 ++#define CONFIG_MAX_NUM_NODES 16 #define CONFIG_KERNEL_STACK_BITS 12 ++#define CONFIG_ARCH_X86_GENERIC 1 ++#define CONFIG_MULTIBOOT1_HEADER ++#define CONFIG_MULTIBOOT2_HEADER ++#define CONFIG_PRINTING 1 +#define CONFIG_ENABLE_BENCHMARKS 1 +#define CONFIG_BENCHMARK_TRACK_UTILISATION 1 + #endif /* ARCH_IA32 */ diff --git a/repos/base-sel4/patches/benchmark.patch b/repos/base-sel4/patches/benchmark.patch deleted file mode 100644 index ac49286895..0000000000 --- a/repos/base-sel4/patches/benchmark.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- src/kernel/sel4/src/benchmark/benchmark_utilisation.c -+++ src/kernel/sel4/src/benchmark/benchmark_utilisation.c -@@ -36,6 +36,11 @@ - - tcb = TCB_PTR(cap_thread_cap_get_capTCBPtr(lu_ret.cap)); - buffer[BENCHMARK_TCB_UTILISATION] = tcb->benchmark.utilisation; /* Requested thread utilisation */ -+#if CONFIG_MAX_NUM_NODES > 1 -+ if (tcb->tcbAffinity < ksNumCPUs) -+ buffer[BENCHMARK_IDLE_UTILISATION] = NODE_STATE_ON_CORE(ksIdleThread, tcb->tcbAffinity)->benchmark.utilisation; /* Idle thread utilisation */ -+ else -+#endif - buffer[BENCHMARK_IDLE_UTILISATION] = NODE_STATE(ksIdleThread)->benchmark.utilisation; /* Idle thread utilisation */ - - #ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT ---- src/kernel/sel4/include/arch/arm/arch/benchmark_overflowHandler.h -+++ src/kernel/sel4/include/arch/arm/arch/benchmark_overflowHandler.h -@@ -21,6 +21,7 @@ - - extern bool_t benchmark_log_utilisation_enabled; - -+#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - static inline void handleOverflowIRQ(void) - { - if (likely(benchmark_log_utilisation_enabled)) { -@@ -31,6 +32,7 @@ - armv_handleOverflowIRQ(); - } - } -+#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ - #endif /* CONFIG_BENCHMARK_TRACK_UTILISATION */ - #endif /* CONFIG_ENABLE_BENCHMARKS */ - #endif /* ARCH_BENCHMARK_OV_H */ ---- src/kernel/sel4/include/arch/arm/armv/armv7-a/armv/benchmark.h -+++ src/kernel/sel4/include/arch/arm/armv/armv7-a/armv/benchmark.h -@@ -14,10 +14,14 @@ - #ifdef CONFIG_ENABLE_BENCHMARKS - - #ifdef CONFIG_BENCHMARK_TRACK_UTILISATION -+#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - extern uint64_t ccnt_num_overflows; -+#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ - static inline void benchmark_arch_utilisation_reset(void) - { -+#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - ccnt_num_overflows = 0; -+#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ - } - #endif /* CONFIG_BENCHMARK_TRACK_UTILISATION */ - diff --git a/repos/base-sel4/patches/uefi_mbi2.patch b/repos/base-sel4/patches/uefi_mbi2.patch deleted file mode 100644 index 0a07c64954..0000000000 --- a/repos/base-sel4/patches/uefi_mbi2.patch +++ /dev/null @@ -1,435 +0,0 @@ ---- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -+++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -@@ -113,11 +113,11 @@ - } - - BOOT_CODE static paddr_t --load_boot_module(multiboot_module_t* boot_module, paddr_t load_paddr) -+load_boot_module(word_t boot_module_start, paddr_t load_paddr) - { - v_region_t v_reg; - word_t entry; -- Elf_Header_t* elf_file = (Elf_Header_t*)(word_t)boot_module->start; -+ Elf_Header_t* elf_file = (Elf_Header_t*)boot_module_start; - - if (!elf_checkFile(elf_file)) { - printf("Boot module does not contain a valid ELF image\n"); -@@ -378,8 +378,13 @@ - } - - static BOOT_CODE bool_t --try_boot_sys( -- unsigned long multiboot_magic, -+try_load_boot_module( -+ paddr_t mods_end_paddr, /* physical address where boot modules end */ -+ paddr_t boot_module_start, /* physical address of first boot module */ -+ acpi_info_t *acpi_info); -+ -+static BOOT_CODE bool_t -+try_boot_sys_mbi1( - multiboot_info_t* mbi - ) - { -@@ -387,15 +392,9 @@ - - acpi_rsdt_t* acpi_rsdt; /* physical address of ACPI root */ - paddr_t mods_end_paddr; /* physical address where boot modules end */ -- paddr_t load_paddr; - word_t i; -- p_region_t ui_p_regs; - multiboot_module_t *modules = (multiboot_module_t*)(word_t)mbi->part1.mod_list; - -- if (multiboot_magic != MULTIBOOT_MAGIC) { -- printf("Boot loader not multiboot compliant\n"); -- return false; -- } - cmdline_parse((const char *)(word_t)mbi->part1.cmdline, &cmdline_opt); - - if ((mbi->part1.flags & MULTIBOOT_INFO_MEM_FLAG) == 0) { -@@ -489,7 +488,7 @@ - - /* get ACPI root table */ - acpi_info_t acpi_info = { 0, 0, 0 }; -- acpi_rsdt = acpi_init(&acpi_info); -+ acpi_rsdt = acpi_init(&acpi_info, 0); - if (!acpi_rsdt) { - return false; - } -@@ -561,13 +560,27 @@ - mods_end_paddr = modules[i].end; - } - } -+ -+ return try_load_boot_module(mods_end_paddr, modules->start, &acpi_info); -+} -+ -+static BOOT_CODE bool_t -+try_load_boot_module( -+ paddr_t mods_end_paddr, /* physical address where boot modules end */ -+ paddr_t boot_module_start, /* physical address of first boot module */ -+ acpi_info_t *acpi_info -+) -+{ -+ p_region_t ui_p_regs; -+ paddr_t load_paddr; -+ - mods_end_paddr = ROUND_UP(mods_end_paddr, PAGE_BITS); - assert(mods_end_paddr > boot_state.ki_p_reg.end); - - printf("ELF-loading userland images from boot modules:\n"); - load_paddr = mods_end_paddr; - -- load_paddr = load_boot_module(modules, load_paddr); -+ load_paddr = load_boot_module(boot_module_start, load_paddr); - if (!load_paddr) { - return false; - } -@@ -599,7 +612,7 @@ - ksNumCPUs = boot_state.num_cpus; - - printf("Starting node #0 with APIC ID %lu\n", boot_state.cpus[0]); -- if (!try_boot_sys_node(boot_state.cpus[0], &acpi_info)) { -+ if (!try_boot_sys_node(boot_state.cpus[0], acpi_info)) { - return false; - } - -@@ -619,13 +632,208 @@ - return true; - } - -+inline word_t align_up(word_t base, word_t align) -+{ -+ base += align - 1; -+ base &= ~(align - 1); -+ return base; -+} -+ -+static BOOT_CODE bool_t -+try_boot_sys_mbi2( -+ multiboot2_header_t* mbi2 -+) -+{ -+ uint32_t mem_lower = 0; -+ acpi_rsdt_t* acpi_rsdt = 0; /* physical address of ACPI root */ -+ paddr_t mods_end_paddr = 0; /* physical address where boot modules end */ -+ char * acpi_rsdp = 0; -+ int mod_count = 0; -+ word_t boot_module_start = 0; -+ word_t boot_module_size = 0; -+ multiboot2_tag_t const * tag = (multiboot2_tag_t *)(mbi2 + 1); -+ multiboot2_tag_t const * tag_e = (multiboot2_tag_t *)((word_t)mbi2 + mbi2->total_size); -+ -+ /* initialize the memory. We track two kinds of memory regions. Physical memory -+ * that we will use for the kernel, and physical memory regions that we must -+ * not give to the user. Memory regions that must not be given to the user -+ * include all the physical memory in the kernel window, but also includes any -+ * important or kernel devices. */ -+ boot_state.mem_p_regs.count = 0; -+ init_allocated_p_regions(); -+ boot_state.mb_mmap_info.mmap_length = 0; -+ -+ while (tag < tag_e && tag->type != MULTIBOOT2_TAG_END) { -+ word_t const behind_tag = (word_t)tag + sizeof(*tag); -+ -+ if (tag->type == MULTIBOOT2_TAG_CMDLINE) { -+ char const * const cmdline = (char const * const)(behind_tag); -+ cmdline_parse(cmdline, &cmdline_opt); -+ } else -+ if (tag->type == MULTIBOOT2_TAG_ACPI) { -+ acpi_rsdp = (char *)behind_tag; -+ } else -+ if (tag->type == MULTIBOOT2_TAG_MODULE) { -+ multiboot2_module_t const * module = (multiboot2_module_t const *)behind_tag; -+ printf( -+ " module #%d: start=0x%x end=0x%x size=0x%x name='%s'\n", -+ mod_count, -+ module->start, -+ module->end, -+ module->end - module->start, -+ module->string -+ ); -+ -+ if (mod_count == 0) { -+ boot_module_start = module->start; -+ boot_module_size = module->end - module->start; -+ } -+ -+ mod_count ++; -+ if ((sword_t)(module->end - module->start) <= 0) { -+ printf("Invalid boot module size! Possible cause: boot module file not found\n"); -+ return false; -+ } -+ if (mods_end_paddr < module->end) -+ mods_end_paddr = module->end; -+ } else -+ if (tag->type == MULTIBOOT2_TAG_MEMORY) { -+ multiboot2_memory_t const * s = (multiboot2_memory_t *)(behind_tag + 8); -+ multiboot2_memory_t const * e = (multiboot2_memory_t *)((word_t)tag + tag->size); -+ -+ for (multiboot2_memory_t const * m = s; m < e; m++) { -+ if (!m->addr) -+ mem_lower = m->size; -+ -+ printf("\tPhysical Memory Region from %llx size %llx type %u\n", m->addr, m->size, m->type); -+ if (m->addr != (uint64_t)(word_t)m->addr) -+ printf("\t\tPhysical memory region not addressable\n"); -+ -+ if (m->type == MULTIBOOT_MMAP_USEABLE_TYPE && m->addr >= HIGHMEM_PADDR) { -+ if (!add_mem_p_regs((p_region_t) { m->addr, m->addr + m->size })) -+ return false; -+ } -+ } -+ } -+ -+ tag = (multiboot2_tag_t const *)((word_t)tag + align_up(tag->size, sizeof(*tag))); -+ } -+ -+ if (!x86_cpuid_initialize()) { -+ printf("Warning: Your x86 CPU has an unsupported vendor, '%s'.\n" -+ "\tYour setup may not be able to competently run seL4 as " -+ "intended.\n" -+ "\tCurrently supported x86 vendors are AMD and Intel.\n", -+ x86_cpuid_get_identity()->vendor_string); -+ } -+ -+ if (!is_compiled_for_microarchitecture()) { -+ printf("Warning: Your kernel was not compiled for the current microarchitecture.\n"); -+ } -+ -+#ifdef ENABLE_SMP_SUPPORT -+ /* copy boot code for APs to lower memory to run in real mode */ -+ if (!copy_boot_code_aps(mem_lower)) { -+ return false; -+ } -+ /* Initialize any kernel TLS */ -+ mode_init_tls(0); -+#endif /* ENABLE_SMP_SUPPORT */ -+ -+ boot_state.ki_p_reg.start = PADDR_LOAD; -+ boot_state.ki_p_reg.end = kpptr_to_paddr(ki_end); -+ boot_state.vbe_info.vbeMode = -1; -+ -+ printf("Kernel loaded to: start=0x%lx end=0x%lx size=0x%lx entry=0x%lx\n", -+ boot_state.ki_p_reg.start, -+ boot_state.ki_p_reg.end, -+ boot_state.ki_p_reg.end - boot_state.ki_p_reg.start, -+ (paddr_t)_start -+ ); -+ -+ /* remapping legacy IRQs to their correct vectors */ -+ pic_remap_irqs(IRQ_INT_OFFSET); -+ if (config_set(CONFIG_IRQ_IOAPIC)) { -+ /* Disable the PIC so that it does not generate any interrupts. We need to -+ * do this *before* we initialize the apic */ -+ pic_disable(); -+ } -+ -+ acpi_info_t acpi_info = { 0, 0, 0 }; -+ acpi_rsdt = acpi_init(&acpi_info, acpi_rsdp); -+ if (!acpi_rsdt) { -+ return false; -+ } -+ -+ /* check if kernel configuration matches platform requirments */ -+ if (!acpi_fadt_scan(acpi_rsdt)) { -+ return false; -+ } -+ -+ if (!config_set(CONFIG_IOMMU) || cmdline_opt.disable_iommu) { -+ boot_state.num_drhu = 0; -+ } else { -+ /* query available IOMMUs from ACPI */ -+ acpi_dmar_scan( -+ acpi_rsdt, -+ boot_state.drhu_list, -+ &boot_state.num_drhu, -+ MAX_NUM_DRHU, -+ &boot_state.rmrr_list -+ ); -+ } -+ -+ /* query available CPUs from ACPI */ -+ boot_state.num_cpus = acpi_madt_scan(acpi_rsdt, boot_state.cpus, &boot_state.num_ioapic, boot_state.ioapic_paddr); -+ if (boot_state.num_cpus == 0) { -+ printf("No CPUs detected\n"); -+ return false; -+ } -+ -+ if (config_set(CONFIG_IRQ_IOAPIC)) { -+ if (boot_state.num_ioapic == 0) { -+ printf("No IOAPICs detected\n"); -+ return false; -+ } -+ } else { -+ if (boot_state.num_ioapic > 0) { -+ printf("Detected %d IOAPICs, but configured to use PIC instead\n", boot_state.num_ioapic); -+ } -+ } -+ -+ printf("Detected %d boot module(s):\n", mod_count); -+ -+ if (mod_count < 1) { -+ printf("Expect at least one boot module (containing a userland image)\n"); -+ return false; -+ } -+ -+ mods_end_paddr = ROUND_UP(mods_end_paddr, PAGE_BITS); -+ if (mods_end_paddr <= boot_state.ki_p_reg.start) { -+ mods_end_paddr = boot_state.ki_p_reg.end + boot_module_size; -+ mods_end_paddr = ROUND_UP(mods_end_paddr, PAGE_BITS); -+ } -+ -+ return try_load_boot_module(mods_end_paddr, boot_module_start, &acpi_info); -+} -+ - BOOT_CODE VISIBLE void - boot_sys( - unsigned long multiboot_magic, -- multiboot_info_t* mbi) -+ void* mbi) - { -- bool_t result; -- result = try_boot_sys(multiboot_magic, mbi); -+ bool_t result = false; -+ -+ /* call cmdline_parse early to enable serial output for error messages */ -+ cmdline_parse("", &cmdline_opt); -+ -+ if (multiboot_magic == MULTIBOOT_MAGIC) -+ result = try_boot_sys_mbi1(mbi); -+ else -+ if (multiboot_magic == MULTIBOOT2_MAGIC) -+ result = try_boot_sys_mbi2(mbi); -+ else -+ printf("Boot loader is not multiboot 1 or 2 compliant %lx\n", multiboot_magic); - - if (!result) { - fail("boot_sys failed for some reason :(\n"); ---- src/kernel/sel4/include/arch/x86/arch/kernel/boot_sys.h -+++ src/kernel/sel4/include/arch/x86/arch/kernel/boot_sys.h -@@ -12,10 +12,11 @@ - #define __ARCH_KERNEL_BOOT_SYS_H - - #include -+#include - - void boot_sys( - unsigned long multiboot_magic, -- multiboot_info_t* mbi -+ void * multiboot - ); - - #endif ---- src/kernel/sel4/src/plat/pc99/machine/acpi.c -+++ src/kernel/sel4/src/plat/pc99/machine/acpi.c -@@ -190,8 +190,13 @@ - } - - BOOT_CODE static acpi_rsdp_t* --acpi_get_rsdp(void) -+acpi_get_rsdp(char *rsdp_by_bootloader) - { -+ if (rsdp_by_bootloader) { -+ if (acpi_calc_checksum(rsdp_by_bootloader, 20) == 0) -+ return (acpi_rsdp_t*)rsdp_by_bootloader; -+ } -+ - char* addr; - - for (addr = (char*)BIOS_PADDR_START; addr < (char*)BIOS_PADDR_END; addr += 16) { -@@ -245,9 +250,9 @@ - } - - BOOT_CODE acpi_rsdt_t* --acpi_init(acpi_info_t *acpi_info) -+acpi_init(acpi_info_t *acpi_info, char * rsdp_ptr) - { -- acpi_rsdp_t* acpi_rsdp = acpi_get_rsdp(); -+ acpi_rsdp_t* acpi_rsdp = acpi_get_rsdp(rsdp_ptr); - acpi_rsdt_t* acpi_rsdt; - acpi_rsdt_t* acpi_rsdt_mapped; - ---- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -+++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -@@ -40,7 +40,7 @@ - uint64_t phys_xsdt; - } acpi_info_t; - --acpi_rsdt_t * acpi_init(acpi_info_t *); -+acpi_rsdt_t * acpi_init(acpi_info_t *, char * rsdp_ptr); - - uint32_t acpi_madt_scan( - acpi_rsdt_t* acpi_rsdt, ---- src/kernel/sel4/src/arch/x86/multiboot.S -+++ src/kernel/sel4/src/arch/x86/multiboot.S -@@ -62,3 +62,15 @@ - .long CONFIG_MULTIBOOT_GRAPHICS_MODE_WIDTH /*width*/ - .long CONFIG_MULTIBOOT_GRAPHICS_MODE_HEIGHT /*height*/ - .long CONFIG_MULTIBOOT_GRAPHICS_MODE_DEPTH /*depth*/ -+ .align 8 -+ __mbi2_start: -+ /* magic multi-boot 2 header */ -+ .long 0xe85250d6 -+ .long 0x0 -+ .long (__mbi2_end - __mbi2_start) -+ .long -(0xe85250d6 + (__mbi2_end - __mbi2_start)) -+ /* end tag - type, flags, size */ -+ .word 0x0 -+ .word 0x0 -+ .long 0x8 -+ __mbi2_end: ---- src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h -+++ src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h -@@ -0,0 +1,52 @@ -+/* -+ * Copyright 2017, Genode Labs GmbH -+ * -+ * This software may be distributed and modified according to the terms of -+ * the GNU General Public License version 2. Note that NO WARRANTY is provided. -+ * See "LICENSE_GPLv2.txt" for details. -+ * -+ */ -+ -+#ifndef __ARCH_KERNEL_MULTIBOOT2_H -+#define __ARCH_KERNEL_MULTIBOOT2_H -+ -+#define MULTIBOOT2_MAGIC 0x36d76289 -+ -+#include -+ -+typedef struct multiboot2_header -+{ -+ uint32_t total_size; -+ uint32_t unknown; -+} PACKED multiboot2_header_t; -+ -+typedef struct multiboot2_tag -+{ -+ uint32_t type; -+ uint32_t size; -+} PACKED multiboot2_tag_t; -+ -+typedef struct multiboot2_memory -+{ -+ uint64_t addr; -+ uint64_t size; -+ uint32_t type; -+ uint32_t reserved; -+} PACKED multiboot2_memory_t; -+ -+typedef struct multiboot2_module -+{ -+ uint32_t start; -+ uint32_t end; -+ char string [0]; -+} PACKED multiboot2_module_t; -+ -+enum multiboot2_tags { -+ MULTIBOOT2_TAG_END = 0, -+ MULTIBOOT2_TAG_CMDLINE = 1, -+ MULTIBOOT2_TAG_MODULE = 3, -+ MULTIBOOT2_TAG_MEMORY = 6, -+ MULTIBOOT2_TAG_ACPI = 15, -+}; -+ -+#endif diff --git a/repos/base-sel4/ports/sel4.hash b/repos/base-sel4/ports/sel4.hash index aa95dad301..811f9d6edb 100644 --- a/repos/base-sel4/ports/sel4.hash +++ b/repos/base-sel4/ports/sel4.hash @@ -1 +1 @@ -028fc711083263437bd4ed469b54eb7435ba2ea7 +a6a9f6b6e79e9628419a18432fb3d1e6fd0c95f3 diff --git a/repos/base-sel4/ports/sel4.port b/repos/base-sel4/ports/sel4.port index 558ae33768..4bbe149b0a 100644 --- a/repos/base-sel4/ports/sel4.port +++ b/repos/base-sel4/ports/sel4.port @@ -3,8 +3,8 @@ VERSION := git DOWNLOADS := sel4.git URL(sel4) := https://github.com/seL4/seL4.git -# master branch, version 6.0 -REV(sel4) := 8564ace4dfb622ec69e0f7d762ebfbc8552ec918 +# master branch, version 7.0 + already merged multiboot2 and uefi support +REV(sel4) := a66feddb8c5044ecafe472c4ce249ae3adebd01b DIR(sel4) := src/kernel/sel4 $(call check_tool,python) @@ -21,8 +21,7 @@ default: $(DOWNLOADS) $(VERBOSE)mkdir -p src/kernel/sel4/configs/pc99/ia32 $(VERBOSE)cp src/kernel/sel4/configs/pc99/autoconf.h src/kernel/sel4/configs/pc99/x86_64/autoconf.h $(VERBOSE)mv src/kernel/sel4/configs/pc99/autoconf.h src/kernel/sel4/configs/pc99/ia32/autoconf.h - $(VERBOSE)patch -p0 <$(REP_DIR)/patches/autoconf_32.config - $(VERBOSE)patch -p0 <$(REP_DIR)/patches/autoconf_64.config + $(VERBOSE)sed -i "s.^ \*/. \*/\n#ifndef ARCH_IA32\n#define ARCH_IA32\n#endif\n." src/kernel/sel4/configs/pc99/ia32/autoconf.h $(VERBOSE)mkdir -p src/kernel/sel4/configs/imx6/wand_quad $(VERBOSE)mv src/kernel/sel4/configs/imx6/autoconf.h src/kernel/sel4/configs/imx6/wand_quad/autoconf.h $(VERBOSE)patch -p0 <$(REP_DIR)/patches/wand_quad.config diff --git a/repos/base-sel4/src/core/platform.cc b/repos/base-sel4/src/core/platform.cc index 5e40341e52..180738c8f9 100644 --- a/repos/base-sel4/src/core/platform.cc +++ b/repos/base-sel4/src/core/platform.cc @@ -377,17 +377,51 @@ void Platform::_init_rom_modules() rom_size, rom_name, [&] () { xml.node("acpi", [&] () { - uint32_t const revision = bi.archInfo.revision; - uint32_t const rsdt = bi.archInfo.rsdt; - uint64_t const xsdt = bi.archInfo.xsdt; - if (revision && (rsdt || xsdt)) { - xml.attribute("revision", revision); - if (rsdt) - xml.attribute("rsdt", String<32>(Hex(rsdt))); + if (!bi.extraLen) + return; - if (xsdt) - xml.attribute("xsdt", String<32>(Hex(xsdt))); + addr_t const boot_info_page = reinterpret_cast(&bi); + addr_t const boot_info_extra = boot_info_page + 4096; + + seL4_BootInfoHeader const * element = reinterpret_cast(boot_info_extra); + seL4_BootInfoHeader const * const last = reinterpret_cast(boot_info_extra + bi.extraLen); + + for (seL4_BootInfoHeader const *next = nullptr; + (next = reinterpret_cast(reinterpret_cast(element) + element->len)) && + next <= last && element->id != SEL4_BOOTINFO_HEADER_PADDING; + element = next) + { + if (element->id != SEL4_BOOTINFO_HEADER_X86_ACPI_RSDP) + continue; + + struct Acpi_rsdp + { + uint64_t signature; + uint8_t checksum; + char oem[6]; + uint8_t revision; + uint32_t rsdt; + uint32_t length; + uint64_t xsdt; + uint32_t reserved; + + bool valid() const { + const char sign[] = "RSD PTR "; + return signature == *(Genode::uint64_t *)sign; + } + } __attribute__((packed)); + + Acpi_rsdp const * rsdp = reinterpret_cast(reinterpret_cast(element) + sizeof(*element)); + + if (rsdp->valid() && (rsdp->rsdt || rsdp->xsdt)) { + xml.attribute("revision", rsdp->revision); + if (rsdp->rsdt) + xml.attribute("rsdt", String<32>(Hex(rsdp->rsdt))); + + if (rsdp->xsdt) + xml.attribute("xsdt", String<32>(Hex(rsdp->xsdt))); + } } }); }); @@ -494,7 +528,7 @@ Platform::Platform() uint64_t const * buf = reinterpret_cast(ipcbuffer->msg); seL4_BenchmarkGetThreadUtilisation(tcb_sel.value()); - uint64_t execution_time = buf[BENCHMARK_IDLE_UTILISATION]; + uint64_t execution_time = buf[BENCHMARK_IDLE_TCBCPU_UTILISATION]; return { Session_label("kernel"), Trace::Thread_name(name), Trace::Execution_time(execution_time), affinity };