Skip to content

Commit

Permalink
vm_minimal, QEMU: block aarch32 build
Browse files Browse the repository at this point in the history
The QEMU/aarch32 platform is not supported actively at the moment for
virtualization.

Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
axel-h authored and lsf37 committed Mar 16, 2024
1 parent 6656ebe commit 977022b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/Arm/vm_minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ elseif("${KernelARMPlatform}" STREQUAL "tx2")
AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target)

elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt")

# QEMU supports ARMv7/aarch32 and ARMv8/aarch32, but currently there are
# Linux images for aarch64 only. However, it is unclear if that is the only
# blocker to get this example run in QEMU on aarch32.
if(NOT KernelSel4ArchAarch64)
message(FATAL_ERROR "Only AARCH64 is supported")
endif()

find_package(camkes-vm-linux REQUIRED)
include(${CAMKES_VM_LINUX_HELPERS_PATH})
set(cpp_flags "-DKERNELARMPLATFORM_QEMU-ARM-VIRT")
Expand Down

3 comments on commit 977022b

@j1mst1x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy, so with this change (or maybe with the change that caused this to have to be implemented), you have to initialize the qemu-arm-virt build with -DAARCH64=1 in order to get the qemu-arm-virt examples to work. That's about an hour of my life I want back :-)

Example to get vm_minimal working:

$ cd build
$ ../init-build.sh -DCAMKES_VM_APP=vm_minimal -DPLATFORM=qemu-arm-virt -DAARCH64=1
$ ninja
$ ./simulate

I feel like a hint on the main git page should be added for this or a hint to the compilation error?

Anyways hopefully this saves someone else some time in the future.

@lsf37
Copy link
Member

@lsf37 lsf37 commented on 977022b Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, at least an example and explanation in the docs for qemu-arm-virt would be good. If that was mentioned in the camkes-vm-examples repo README, would you have found it there or did you get here by another path?

@j1mst1x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: I think mentioning it in the notes column in the ARM Features table in the camkes-vm-examples repo README would be sufficient.

Honestly I'm coming back to seL4 for a new project after a few years away and I was doing the tutorials. Well I got to the cross vm tutorial, I remembered it was broken because y'all switched from a character device to a userspace IO device. I went to compile the cross-vm for qemu-arm-virt and it page faulted... which I thought was weird so I tried vm_minimal and it page faulted as well. After some investigation I saw that the default processor was getting set to something like a A15 and that if I set the AARCH64 switch it would use an A53.

Then all of a sudden this commit made a lot more sense to me. Anyways, there's an arguement to be made that this is why vm_minimal64 exists... but then that would break all of the other examples. So I think adding a note in bold in the ARM Features table for QEMU is the way to go.

Please sign in to comment.