Skip to content

Commit

Permalink
aarch64: Minimal update for vspace API change
Browse files Browse the repository at this point in the history
The aarch64 vspace API is changed to only have a single pagetable object
and capability type for all intermediate page table levels. The root
vspace object is still a separate object and capability type.

Signed-off-by: Kent McLeod <kent@kry10.com>
  • Loading branch information
kent-mcleod committed Jun 1, 2023
1 parent 24921e8 commit 507f4d3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <allocman/allocman.h>

static inline void allocman_sel4_arch_configure_reservations(allocman_t *alloc) {
allocman_configure_utspace_reserve(alloc, (struct allocman_utspace_chunk) {vka_get_object_size(seL4_ARM_PageDirectoryObject, 0), seL4_ARM_PageDirectoryObject, 1});
allocman_configure_utspace_reserve(alloc, (struct allocman_utspace_chunk) {vka_get_object_size(seL4_ARM_PageUpperDirectoryObject, 0), seL4_ARM_PageUpperDirectoryObject, 1});
allocman_configure_utspace_reserve(alloc, (struct allocman_utspace_chunk) {vka_get_object_size(seL4_ARCH_PageTableObject, 0), seL4_ARCH_PageTableObject, 3});
}

2 changes: 2 additions & 0 deletions libsel4allocman/src/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,9 @@ void bootstrap_configure_virtual_pool(allocman_t *alloc, void *vstart, size_t vs
/* assume we are using 4k pages. maybe this should be a Kconfig option at some point?
* we ignore any errors */
allocman_configure_utspace_reserve(alloc, (struct allocman_utspace_chunk) {vka_get_object_size(seL4_ARCH_4KPage, 0), seL4_ARCH_4KPage, 3});
#ifndef CONFIG_ARCH_AARCH64
allocman_configure_utspace_reserve(alloc, (struct allocman_utspace_chunk) {vka_get_object_size(seL4_ARCH_PageTableObject, 0), seL4_ARCH_PageTableObject, 1});
#endif
allocman_sel4_arch_configure_reservations(alloc);
mspace_dual_pool_attach_virtual(
(mspace_dual_pool_t*)alloc->mspace.mspace,
Expand Down
2 changes: 0 additions & 2 deletions libsel4vka/arch_include/arm/vka/arch/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ vka_arch_get_object_size(seL4_Word objectType)
return seL4_LargePageBits;
case seL4_ARM_PageTableObject:
return seL4_PageTableBits;
case seL4_ARM_PageDirectoryObject:
return seL4_PageDirBits;
case seL4_ARM_VCPUObject:
return seL4_ARM_VCPUBits;
#ifdef CONFIG_TK1_SMMU
Expand Down
2 changes: 2 additions & 0 deletions libsel4vka/sel4_arch_include/aarch32/vka/sel4_arch/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static inline unsigned long vka_arm_mode_get_object_size(seL4_Word objectType)
return seL4_SectionBits;
case seL4_ARM_SuperSectionObject:
return seL4_SuperSectionBits;
case seL4_ARM_PageDirectoryObject:
return seL4_PageDirBits;
default:
/* Unknown object type. */
ZF_LOGE("Unknown object type");
Expand Down
6 changes: 2 additions & 4 deletions libsel4vka/sel4_arch_include/aarch64/vka/sel4_arch/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ vka_arm_mode_get_object_size(seL4_Word objectType)
switch (objectType) {
case seL4_ARM_HugePageObject:
return seL4_HugePageBits;
case seL4_ARM_PageGlobalDirectoryObject:
return seL4_PGDBits;
case seL4_ARM_PageUpperDirectoryObject:
return seL4_PUDBits;
case seL4_ARM_VSpaceObject:
return seL4_VSpaceBits;
default:
/* Unknown object type. */
ZF_LOGE("Unknown object type");
Expand Down

0 comments on commit 507f4d3

Please sign in to comment.