sel4: remove x86_32/pc and imx7-sabre

The imx7 is not supported officially [0] anymore and the 32bit pc version is
not used nor intended to be used.

https://github.com/seL4/seL4/issues/254

Issue #4910
This commit is contained in:
Alexander Boettcher 2023-05-24 09:21:18 +02:00 committed by Christian Helmuth
parent 22bee79534
commit 7351aa1670
19 changed files with 0 additions and 499 deletions

View File

@ -1,5 +0,0 @@
PLAT := imx7
CPU := cortex-a7
override BOARD := imx7d_sabre
-include $(REP_DIR)/lib/mk/spec/arm/kernel-sel4.inc

View File

@ -1,8 +0,0 @@
PLAT := imx7
ARCH := arm
SEL4_ARCH := aarch32
PLAT_BOARD := /imx7d_sabre
SEL4_WORDBITS := 32
include $(REP_DIR)/lib/mk/syscall-sel4.inc

View File

@ -1,21 +0,0 @@
GEN_SRC_CC = \
spec/x86/io_port_session_component.cc \
vm_session_common.cc
REP_SRC_CC = \
spec/x86/io_port_session_support.cc \
spec/x86/irq.cc \
spec/x86/platform_services.cc \
spec/x86/platform_thread.cc \
spec/x86/vm_space.cc \
spec/x86/vm_session_component.cc \
spec/x86_32/boot_info.cc \
spec/x86_32/platform.cc \
spec/x86_32/platform_pd.cc \
spec/x86_32/thread.cc \
spec/x86_32/vm_space.cc
INC_DIR += $(REP_DIR)/src/core/spec/x86_32
INC_DIR += $(REP_DIR)/src/core/spec/x86
include $(REP_DIR)/lib/mk/core-sel4.inc

View File

@ -1,19 +0,0 @@
SEL4_DIR := $(call select_from_ports,sel4)/src/kernel/sel4
#
# Execute the kernel build only at the second build stage when we know
# about the complete build settings (e.g., the 'CROSS_DEV_PREFIX') and the
# current working directory is the library location.
#
ifeq ($(called_from_lib_mk),yes)
all: build_kernel
else
all:
endif
build_kernel:
$(VERBOSE)$(MAKE) \
TOOLPREFIX=$(CROSS_DEV_PREFIX) \
BOARD=ia32 ARCH=x86 SEL4_ARCH=ia32 PLAT=pc99 DEBUG=1 \
SOURCE_ROOT=$(SEL4_DIR) -f$(SEL4_DIR)/Makefile

View File

@ -1,3 +0,0 @@
BASE_LIBS += base-sel4-common base-sel4
include $(BASE_DIR)/lib/mk/spec/x86_32/ld-platform.inc

View File

@ -1,10 +0,0 @@
#
# Make the includes of src/base/include/ available to the startup lib. This is
# needed because the seL4-specific src/platform/_main_parent_cap.h as included
# by the startup lib depends on base/internal/capability_space_sel4.h.
#
INC_DIR += $(REP_DIR)/src/include $(BASE_DIR)/src/include
LIBS += syscall-sel4
include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc

View File

@ -1,10 +0,0 @@
PLAT := pc99
ARCH := x86
SEL4_ARCH := ia32
PLAT_BOARD := /$(SEL4_ARCH)
SEL4_WORDBITS := 32
ARCH_INCLUDES := exIPC.h vmenter.h
include $(REP_DIR)/lib/mk/syscall-sel4.inc

View File

@ -1,4 +0,0 @@
# \deprecated
SPECS += x86_32
include $(call select_from_repositories,mk/spec/x86_32.mk)

View File

@ -1,7 +0,0 @@
This archive contains the seL4-specific part of Genode.
It also contains the source code of the seL4 kernel in the
'src/kernel/sel4' directory.
Please note that seL4 has a license distinct from Genode. seL4's
license can be found at 'src/kernel/sel4/LICENSE_GPLv2.txt'.

View File

@ -1,41 +0,0 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
content: include/os/attached_mmio.h
include/%.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README
README:
cp $(REP_DIR)/recipes/src/base-sel4-imx7d_sabre/README $@
content: lib/import etc include/sel4
lib/import etc include/sel4:
$(mirror_from_rep_dir)
content: src/tool/sel4_tools
src/kernel:
$(mirror_from_rep_dir)
KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sel4)
src/kernel/sel4: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/sel4/* $@
ELFLOADER_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sel4_tools)
src/tool/sel4_tools: src/kernel/sel4
mkdir -p $@
cp -r $(ELFLOADER_PORT_DIR)/src/tool/sel4_tools/* $@
content: etc/board.conf
etc/board.conf:
echo "BOARD = imx7d_sabre" > etc/board.conf
content:
mv lib/mk/spec/arm/ld-sel4.mk lib/mk/spec/arm/ld.mk;
sed -i "s/imx7_timer_drv/timer/" src/timer/gpt/imx7/target.inc
find lib/mk/spec -name kernel-sel4-*.mk -o -name syscall-sel4-*.mk |\
grep -v "sel4-imx7d_sabre.mk" | xargs rm -rf

View File

@ -1 +0,0 @@
2023-04-25 2ea2eeff7d241d57aee30e6a4178198d1ddedc1a

View File

@ -1,54 +0,0 @@
/*
* \brief Utilities for creating seL4 kernel objects
* \author Norman Feske
* \date 2015-05-08
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__X86_32_ARCH_KERNEL_OBJECT_H_
#define _CORE__X86_32_ARCH_KERNEL_OBJECT_H_
#include <sel4/objecttype.h>
#include <platform.h>
namespace Core {
Phys_allocator &phys_alloc_16k(Allocator * core_mem_alloc = nullptr);
enum {
PAGE_TABLE_LOG2_SIZE = 22 /* 4M region */
};
struct Page_table_kobj
{
enum { SEL4_TYPE = seL4_X86_PageTableObject, SIZE_LOG2 = 12 };
static char const *name() { return "page table"; }
};
struct Page_directory_kobj
{
enum { SEL4_TYPE = seL4_X86_PageDirectoryObject, SIZE_LOG2 = 12 };
static char const *name() { return "page directory"; }
};
struct Vcpu_kobj
{
enum { SEL4_TYPE = seL4_X86_VCPUObject, SIZE_LOG2 = 14 };
static char const *name() { return "vcpu"; }
};
struct Ept_kobj
{
enum { SEL4_TYPE = seL4_X86_EPTPML4Object, SIZE_LOG = 12 };
static char const *name() { return "ept pml4"; }
};
};
#endif /* _CORE__X86_32_ARCH_KERNEL_OBJECT_H_ */

View File

@ -1,33 +0,0 @@
/*
* \brief Access to seL4 boot info
* \author Norman Feske
* \date 2015-05-04
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/stdint.h>
/* core includes */
#include <sel4_boot_info.h>
using namespace Core;
/* provided by the assembly startup code */
extern addr_t __initial_bx;
/**
* Obtain seL4 boot info structure
*/
seL4_BootInfo const &Core::sel4_boot_info()
{
return *(seL4_BootInfo const *)__initial_bx;
}

View File

@ -1,94 +0,0 @@
/*
* \brief Platform interface implementation - x86_32 specific
* \author Norman Feske
* \date 2015-05-01
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* base includes */
#include <base/internal/crt0.h>
/* core includes */
#include <boot_modules.h>
#include <platform.h>
#include <thread_sel4.h>
#include "arch_kernel_object.h"
using namespace Core;
seL4_Word Untyped_memory::smallest_page_type() { return seL4_X86_4K; }
void Platform::init_sel4_ipc_buffer()
{
asm volatile ("movl %0, %%fs" :: "r"(IPCBUF_GDT_SELECTOR) : "memory");
}
long Platform::_unmap_page_frame(Cap_sel const &sel) {
return seL4_X86_Page_Unmap(sel.value()); }
void Platform::_init_core_page_table_registry()
{
seL4_BootInfo const &bi = sel4_boot_info();
addr_t virt_addr = (addr_t)(&_prog_img_beg);
unsigned sel = bi.userImagePaging.start;
/* we don't know the physical location of some objects XXX */
enum { XXX_PHYS_UNKNOWN = ~0UL };
/*
* Register initial page tables
*/
for (; sel < bi.userImagePaging.end; sel++) {
_core_page_table_registry.insert_page_table(virt_addr, Cap_sel(sel),
XXX_PHYS_UNKNOWN,
PAGE_TABLE_LOG2_SIZE);
virt_addr += 1024 * get_page_size();
}
/* initialize 16k memory allocator */
phys_alloc_16k(&core_mem_alloc());
/* reserve some memory for VCPUs - must be 16k */
enum { MAX_VCPU_COUNT = 16 };
addr_t const max_pd_mem = MAX_VCPU_COUNT * (1UL << Vcpu_kobj::SIZE_LOG2);
_initial_untyped_pool.turn_into_untyped_object(Core_cspace::TOP_CNODE_UNTYPED_16K,
[&] (addr_t const phys, addr_t const size, bool) {
phys_alloc_16k().add_range(phys, size);
_unused_phys_alloc.remove_range(phys, size);
},
Vcpu_kobj::SIZE_LOG2, max_pd_mem);
log(":phys_mem_16k: ", phys_alloc_16k());
/*
* Register initial page frames
* - actually we don't use them in core -> skip
*/
#if 0
addr_t const modules_start = reinterpret_cast<addr_t>(&_boot_modules_binaries_begin);
addr_t const modules_end = reinterpret_cast<addr_t>(&_boot_modules_binaries_end);
virt_addr = (addr_t)(&_prog_img_beg);
for (unsigned sel = bi.userImageFrames.start;
sel < bi.userImageFrames.end;
sel++, virt_addr += get_page_size()) {
/* skip boot modules */
if (modules_start <= virt_addr && virt_addr <= modules_end)
continue;
_core_page_table_registry.insert_page_table_entry(virt_addr, sel);
}
#endif
}

View File

@ -1,52 +0,0 @@
/*
* \brief Protection-domain facility
* \author Norman Feske
* \date 2015-05-01
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* core includes */
#include <platform_pd.h>
#include "arch_kernel_object.h"
using namespace Core;
addr_t Platform_pd::_init_page_directory() const
{
addr_t const phys_addr = Untyped_memory::alloc_page(platform().ram_alloc());
seL4_Untyped const service = Untyped_memory::untyped_sel(phys_addr).value();
create<Page_directory_kobj>(service,
platform_specific().core_cnode().sel(),
_page_directory_sel);
long ret = seL4_X86_ASIDPool_Assign(platform_specific().asid_pool().value(),
_page_directory_sel.value());
if (ret != seL4_NoError)
error("seL4_X86_ASIDPool_Assign returned ", ret);
return phys_addr;
}
void Platform_pd::_deinit_page_directory(addr_t phys_addr) const
{
int ret = seL4_CNode_Delete(seL4_CapInitThreadCNode,
_page_directory_sel.value(), 32);
if (ret != seL4_NoError) {
error(__FUNCTION__, ": could not free ASID entry, "
"leaking physical memory ", ret);
return;
}
Untyped_memory::free_page(platform().ram_alloc(), phys_addr);
}

View File

@ -1,88 +0,0 @@
/*
* \brief Utilities for thread creation on seL4
* \author Norman Feske
* \date 2015-05-12
*
* This file is used by both the core-specific implementation of the Thread API
* and the platform-thread implementation for managing threads outside of core.
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* base includes */
#include <base/thread_state.h>
/* core includes */
#include <thread_sel4.h>
#include <platform_thread.h>
using namespace Genode;
void Core::start_sel4_thread(Cap_sel tcb_sel, addr_t ip, addr_t sp, unsigned cpu)
{
/* set register values for the instruction pointer and stack pointer */
seL4_UserContext regs;
memset(&regs, 0, sizeof(regs));
size_t const num_regs = sizeof(regs)/sizeof(seL4_Word);
regs.eip = ip;
regs.esp = sp;
regs.fs = IPCBUF_GDT_SELECTOR;
long const ret = seL4_TCB_WriteRegisters(tcb_sel.value(), false, 0,
num_regs, &regs);
ASSERT(ret == 0);
affinity_sel4_thread(tcb_sel, cpu);
seL4_TCB_Resume(tcb_sel.value());
}
void Core::affinity_sel4_thread(Cap_sel const &tcb_sel, unsigned cpu)
{
seL4_TCB_SetAffinity(tcb_sel.value(), cpu);
}
Thread_state Core::Platform_thread::state()
{
seL4_TCB const thread = _info.tcb_sel.value();
seL4_Bool const suspend_source = false;
seL4_Uint8 const arch_flags = 0;
seL4_UserContext registers;
seL4_Word const register_count = sizeof(registers) / sizeof(registers.eip);
long const ret = seL4_TCB_ReadRegisters(thread, suspend_source, arch_flags,
register_count, &registers);
if (ret != seL4_NoError) {
error("reading thread state ", ret);
throw Cpu_thread::State_access_failed();
}
Thread_state state;
memset(&state, 0, sizeof(state));
state.ip = registers.eip;
state.sp = registers.esp;
state.edi = registers.edi;
state.esi = registers.esi;
state.ebp = registers.ebp;
state.ebx = registers.ebx;
state.edx = registers.edx;
state.ecx = registers.ecx;
state.eax = registers.eax;
state.gs = registers.gs;
state.fs = registers.fs;
state.eflags = registers.eflags;
state.trapno = 0; /* XXX detect/track if in exception and report here */
/* registers.tls_base unused */
return state;
}

View File

@ -1,47 +0,0 @@
/*
* \brief Virtual-memory space
* \author Norman Feske
* \date 2015-05-04
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* core includes */
#include <vm_space.h>
#include "arch_kernel_object.h"
using namespace Core;
static long map_page_table(Cap_sel const pagetable,
Cap_sel const vroot,
addr_t const virt)
{
return seL4_X86_PageTable_Map(pagetable.value(), vroot.value(), virt,
seL4_X86_Default_VMAttributes);
}
void Vm_space::unsynchronized_alloc_page_tables(addr_t const start,
addr_t const size)
{
addr_t constexpr PAGE_TABLE_AREA = 1UL << PAGE_TABLE_LOG2_SIZE;
addr_t virt = start & ~(PAGE_TABLE_AREA - 1);
for (; virt < start + size; virt += PAGE_TABLE_AREA) {
if (_page_table_registry.page_table_at(virt, PAGE_TABLE_LOG2_SIZE))
continue;
addr_t phys = 0;
/* 4 MB range - page table */
Cap_sel const pt = _alloc_and_map<Page_table_kobj>(virt, map_page_table, phys);
_page_table_registry.insert_page_table(virt, pt, phys,
PAGE_TABLE_LOG2_SIZE);
}
}

View File

@ -1 +0,0 @@
include $(call select_from_repositories,src/timer/gpt/imx7/target.inc)