qemu-discuss
[Top][All Lists]
Advanced

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

Re: How to start an armv8 machine in EL3?


From: Alex Bennée
Subject: Re: How to start an armv8 machine in EL3?
Date: Wed, 03 Mar 2021 10:05:17 +0000
User-agent: mu4e 1.5.8; emacs 28.0.50

ckim@etri.re.kr writes:

> Hello all,
>
> I found out in a baremetal program I run for qemu aarch64 'virt' machine
> (cpu is cortex-a72), 
>
> the "msr sp_el1, x0" instruction causes trap making PC jump to 0x200 which
> is the vector address for synchronous exception, from current EL while using
> SP_ELx (if the vector base address was 0, which is the case).
>
> (Ref : https://developer.arm.com/documentation/102412/0100/The-vector-tables
> )
>
> When I read the 'EL' value by 'msr x8, currentel', x8 became '0x4' so it is
> EL1
> (https://community.arm.com/developer/ip-products/processors/f/cortex-a-forum
> /10303/armv8-a-currentel-register-definition)
>
> How come cortex-a72 machines started at EL1?

Are you booting a kernel directly? In this case the kernel will boot
into EL1 unless you specify -machine type=virt,virtualization=on in
which case it will boot into EL2 and allow the kernel to utilise the
virtualisation extensions.

> And if I want to make the virtual machine start at EL3 (this baremetal code
> assumes it should be in EL3 after reset, and it runs ok in rtl sim.), what
> should I do?

Generally as only firmware deals with EL3 you would have it running on
some sort of flash device which the model would boot to directly in EL3
rather than running the stub loader we have for the kernel. For example
to load the EDK firmware you would have:

   -drive if=pflash,file=/usr/share/AAVMF/AAVMF_CODE.fd,format=raw,readonly=on \
   -drive if=pflash,file=/home/alex/models/qemu-arm64-efivars,format=raw

as part of your command line. You also need to enable secure mode in the
machine options (-machine type=virt,secure=on).

>
> Thank you very much for reading.
>
> Chan Kim
>
>  


-- 
Alex Bennée



reply via email to

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