qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to force EL2 mode when booting ELF32 file as kernel on CortexA7


From: Peter Maydell
Subject: Re: How to force EL2 mode when booting ELF32 file as kernel on CortexA7 or CortexA15
Date: Sat, 4 Jul 2020 23:08:37 +0100

On Sat, 4 Jul 2020 at 21:27, Jean-Christophe DUBOIS <jcd@tribudubois.net> wrote:
> When booting an ELF32 file as "kernel" then Qemu seems to always start
> in SVC (EL1) mode.
>
> When booting a "non ELF32" file (a bzimage or any other binary image) as
> "kernel" then Qemu seems to start in HYP (EL2) mode if the processor
> supports this mode (it seems to then emulate the uboot behavior)
>
> Is there a way to tell Qemu to start in HYP (EL2) mode (or even EL3
> mode) when booting an ELF file as kernel (assuming the processor
> supports it)?

QEMU basically supports two booting types for Arm:

(1) "I am a Linux kernel, boot me the way the Linux kernel booting
ABI specifies". This is what you get for -kernel for non-ELF files:
it does a bunch of things, including starting in Hyp if available,
handling secondary CPUs appropriately, and so on.

(2) "I am a bare metal binary, boot me with the CPU the way it
starts up for bare metal". This is what you get for -kernel
for ELF files. A real AArch32 CPU always starts in the highest
available privilege level, so that's Secure SVC if the CPU
has TrustZone, Hyp if it has virtualization but not trustzone,
and (NS) SVC if it has neither: QEMU does the same.
Guest code can always move itself from S-SVC to NS-Hyp if that's
where it would prefer to be.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]