[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
Re: How to force EL2 mode when booting ELF32 file as kernel on CortexA7 or CortexA15
Sun, 5 Jul 2020 09:02:54 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0
Le 05/07/2020 à 00:08, Peter Maydell a écrit :
On Sat, 4 Jul 2020 at 21:27, Jean-Christophe DUBOIS <email@example.com> 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
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.