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

[patch-axel-29a] QEMU 32-bit RAM #34

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/plat/qemu-arm-virt/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,19 @@ if(KernelPlatformQEMUArmVirt)
endif()

if(NOT DEFINED QEMU_MEMORY)
# Having 1 GiB of memory as default is a legacy from the past
# that is kept for compatibility. It should be increased to
# 2 GiB, which seems a good trade-off nowadays. It's sufficient
# for test/demo systems, but still something the host can
# provide without running short on resources.
set(QEMU_MEMORY "1024")
if(KernelSel4ArchAarch32)
# The memory starts at 1 GiB (0x40000000), so 3 GiB can be
# accessed using 32-bit addresses. While the LPAE MMU model
# supports accessing a 1 TiB (40-bit) physical address
# space, the 32-bit version of seL4 can access physical
# addresses in the 32-bit range only.
set(QEMU_MEMORY "8192")
else()
# Having 3 GiB of memory as default seems a good trade-off.
# It's sufficient for test/demo systems, but still something
# the host can provide without running short on resources.
set(QEMU_MEMORY "3072")
endif()
endif()

if(KernelMaxNumNodes)
Expand Down Expand Up @@ -219,6 +226,10 @@ if(KernelPlatformQEMUArmVirt)

list(APPEND KernelDTSList "${QEMU_DTS}" "${CMAKE_CURRENT_LIST_DIR}/overlay-qemu-arm-virt.dts")

if(KernelSel4ArchAarch32)
list(APPEND KernelDTSList "${CMAKE_CURRENT_LIST_DIR}/overlay-qemu-arm-virt32.dts")
endif()

if(KernelArmHypervisorSupport OR KernelSel4ArchArmHyp)
list(APPEND KernelDTSList "${CMAKE_CURRENT_LIST_DIR}/overlay-reserve-vm-memory.dts")
endif()
Expand Down
29 changes: 29 additions & 0 deletions src/plat/qemu-arm-virt/overlay-qemu-arm-virt32.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2022, HENSOLDT Cyber
*
* * SPDX-License-Identifier: BSD-3-Clause
*/

/ {
reserved-memory {
#address-cells = <0x02>;
#size-cells = <0x02>;
ranges;

/* The 32-bit version of seL4 can handle a 32-bit physical
* address space (4 GiB) only, even if LPAE allows using a
* 40-bit physical address space. For now, reserving any memory
* starting at 0xffffffff is the easiest way to cope with
* platform configurations having pyhsical memory of exactly
* 4 GiB or above. The long-term fix is improving the seL4 build
* scripts to be aware of the 4 GiB limitation and never create
* any regions above. Furthermore, a way needs to be found to
* support using exactly 4 GiB also.
*/
reserved-memory@ffffffff{
reg = < 0x00000000 0xffffffff 0xffffffff 0x00000001 >;
no-map;
};

};
};
4 changes: 4 additions & 0 deletions src/plat/qemu-riscv-virt/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ if(KernelPlatformQEMURiscVVirt)

list(APPEND KernelDTSList "${QEMU_DTS}" "${CMAKE_CURRENT_LIST_DIR}/overlay-qemu-riscv-virt.dts")

if(KernelSel4ArchRiscV32)
list(APPEND KernelDTSList "${CMAKE_CURRENT_LIST_DIR}/overlay-qemu-riscv-virt32.dts")
endif()

# QEMU emulates a SiFive PLIC/CLINT with 127 interrupt sources by default.
# The CLINT timer pretends to run at 10 MHz, but this speed may not hold in
# practical measurements.
Expand Down
29 changes: 29 additions & 0 deletions src/plat/qemu-riscv-virt/overlay-qemu-riscv-virt32.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2022, HENSOLDT Cyber
*
* * SPDX-License-Identifier: BSD-3-Clause
*/

/ {
reserved-memory {
#address-cells = <0x02>;
#size-cells = <0x02>;
ranges;

/* The 32-bit version of seL4 can handle a 32-bit physical
* address space (4 GiB) only, even if SV32 allows using a
* 34-bit physical address space. For now, reserving any memory
* starting at 0xffffffff is the easiest way to cope with
* platform configurations having pyhsical memory of exactly
* 4 GiB or above. The long-term fix is improving the seL4 build
* scripts to be aware of the 4 GiB limitation and never create
* any regions above. Furthermore, a way needs to be found to
* support using exactly 4 GiB also.
*/
reserved-memory@ffffffff{
reg = < 0x00000000 0xffffffff 0xffffffff 0x00000001 >;
no-map;
};

};
};
Loading