All of lore.kernel.org
 help / color / mirror / Atom feed
* Help to boot QEMU ARM64 UEFI
@ 2022-10-28 12:31 Clément Péron
  2022-10-28 14:10 ` Jon Mason
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Péron @ 2022-10-28 12:31 UTC (permalink / raw)
  To: meta-arm

Dear Meta-arm Maintainers/Contributors,

I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
emulation on Apple Silicon).

I'm really noob at UEFI and was used to boot my ARM devices using
u-boot but to keep coherency with other QEMU machines x86-64, I would
like to have a bootflow like this:
OVMF -> GRUB -> Kernel

I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi

Then i'm booting my qemu machine like this:
----
qemu-system-aarch64 \
  -machine virt \
  -name "Virtual ARM64" \
  -m 4G \
  -smp 6 \
  -cpu cortex-a57 \
  -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
  -bios ./QEMU_EFI.fd \
  -nographic
----

The output seems stuck after Grub and never properly jump into the kernel

----
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
Welcome to GRUB!



EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...
----

Did I miss something in my kernel configuration?

Thanks for your help
Regards,
Clement


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2022-10-28 12:31 Help to boot QEMU ARM64 UEFI Clément Péron
@ 2022-10-28 14:10 ` Jon Mason
  2022-10-28 20:00   ` Clément Péron
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Mason @ 2022-10-28 14:10 UTC (permalink / raw)
  To: Clément Péron; +Cc: meta-arm

On Fri, Oct 28, 2022 at 02:31:38PM +0200, Cl�ment P�ron wrote:
> Dear Meta-arm Maintainers/Contributors,
> 
> I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> emulation on Apple Silicon).
> 
> I'm really noob at UEFI and was used to boot my ARM devices using
> u-boot but to keep coherency with other QEMU machines x86-64, I would
> like to have a bootflow like this:
> OVMF -> GRUB -> Kernel
> 
> I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> 
> Then i'm booting my qemu machine like this:
> ----
> qemu-system-aarch64 \
>   -machine virt \
>   -name "Virtual ARM64" \
>   -m 4G \
>   -smp 6 \
>   -cpu cortex-a57 \
>   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
>   -bios ./QEMU_EFI.fd \
>   -nographic
> ----
> 
> The output seems stuck after Grub and never properly jump into the kernel
> 
> ----
> BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> Welcome to GRUB!
> 
> 
> 
> EFI stub: Booting Linux Kernel...
> EFI stub: Using DTB from configuration table
> EFI stub: Exiting boot services and installing virtual address map...
> ----
> 
> Did I miss something in my kernel configuration?


qemuarm64 and efi/edk2 generally works and we test it every night
https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680

meta-arm does have the following we are adding
meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg

I do have a patch out to the yocto linux kernel recipe that has a
config fragment that might be missing for your setup (in place of the
above).  
https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
That patch has been accepted, but might not be in your tree (depending
on what version you are running).

Thanks,
Jon


> 
> Thanks for your help
> Regards,
> Clement
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2022-10-28 14:10 ` Jon Mason
@ 2022-10-28 20:00   ` Clément Péron
  2023-06-05  7:38     ` Clément Péron
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Péron @ 2022-10-28 20:00 UTC (permalink / raw)
  To: Jon Mason; +Cc: meta-arm

Hi Jon,

On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Fri, Oct 28, 2022 at 02:31:38PM +0200, Clément Péron wrote:
> > Dear Meta-arm Maintainers/Contributors,
> >
> > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > emulation on Apple Silicon).
> >
> > I'm really noob at UEFI and was used to boot my ARM devices using
> > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > like to have a bootflow like this:
> > OVMF -> GRUB -> Kernel
> >
> > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> >
> > Then i'm booting my qemu machine like this:
> > ----
> > qemu-system-aarch64 \
> >   -machine virt \
> >   -name "Virtual ARM64" \
> >   -m 4G \
> >   -smp 6 \
> >   -cpu cortex-a57 \
> >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> >   -bios ./QEMU_EFI.fd \
> >   -nographic
> > ----
> >
> > The output seems stuck after Grub and never properly jump into the kernel
> >
> > ----
> > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > Welcome to GRUB!
> >
> >
> >
> > EFI stub: Booting Linux Kernel...
> > EFI stub: Using DTB from configuration table
> > EFI stub: Exiting boot services and installing virtual address map...
> > ----
> >
> > Did I miss something in my kernel configuration?
>
>
> qemuarm64 and efi/edk2 generally works and we test it every night
> https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
>
> meta-arm does have the following we are adding
> meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
>
> I do have a patch out to the yocto linux kernel recipe that has a
> config fragment that might be missing for your setup (in place of the
> above).
> https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> That patch has been accepted, but might not be in your tree (depending
> on what version you are running).

Correct, patch applied and now it works :)

Thank you for taking the time to answer my question.
Regards,
Clement

>
> Thanks,
> Jon
>
>
> >
> > Thanks for your help
> > Regards,
> > Clement
> >


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2022-10-28 20:00   ` Clément Péron
@ 2023-06-05  7:38     ` Clément Péron
  2023-06-05 15:34       ` [meta-arm] " Josef Holzmayr
  2023-06-05 15:44       ` Jon Mason
  0 siblings, 2 replies; 11+ messages in thread
From: Clément Péron @ 2023-06-05  7:38 UTC (permalink / raw)
  To: Jon Mason; +Cc: meta-arm

Hi,

On Fri, 28 Oct 2022 at 22:00, Clément Péron <peron.clem@gmail.com> wrote:
>
> Hi Jon,
>
> On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> >
> > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Clément Péron wrote:
> > > Dear Meta-arm Maintainers/Contributors,
> > >
> > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > emulation on Apple Silicon).
> > >
> > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > like to have a bootflow like this:
> > > OVMF -> GRUB -> Kernel
> > >
> > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > >
> > > Then i'm booting my qemu machine like this:
> > > ----
> > > qemu-system-aarch64 \
> > >   -machine virt \
> > >   -name "Virtual ARM64" \
> > >   -m 4G \
> > >   -smp 6 \
> > >   -cpu cortex-a57 \
> > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > >   -bios ./QEMU_EFI.fd \
> > >   -nographic
> > > ----
> > >
> > > The output seems stuck after Grub and never properly jump into the kernel
> > >
> > > ----
> > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > Welcome to GRUB!
> > >
> > >
> > >
> > > EFI stub: Booting Linux Kernel...
> > > EFI stub: Using DTB from configuration table
> > > EFI stub: Exiting boot services and installing virtual address map...
> > > ----
> > >
> > > Did I miss something in my kernel configuration?

I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
meta-arm and now I have the exact same problem.

I have still the same patch applied and check that the cfg/efi.scc is
properly applied but doesn't succeed to boot.

I have tried with the previous grub and with the new one and both
failed so it seems more related to linux kernel.

I have tried to enable EFI_EARLYCON + append to cmdline
"earlycon=pl011,0x9000000" same print. I'm not sure at all about
this...

Do you know if there is a new CONFIG to enable?

Thanks in advance,
Regards,
Clement


> >
> >
> > qemuarm64 and efi/edk2 generally works and we test it every night
> > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> >
> > meta-arm does have the following we are adding
> > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> >
> > I do have a patch out to the yocto linux kernel recipe that has a
> > config fragment that might be missing for your setup (in place of the
> > above).
> > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > That patch has been accepted, but might not be in your tree (depending
> > on what version you are running).
>
> Correct, patch applied and now it works :)
>
> Thank you for taking the time to answer my question.
> Regards,
> Clement
>
> >
> > Thanks,
> > Jon
> >
> >
> > >
> > > Thanks for your help
> > > Regards,
> > > Clement
> > >


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] Help to boot QEMU ARM64 UEFI
  2023-06-05  7:38     ` Clément Péron
@ 2023-06-05 15:34       ` Josef Holzmayr
  2023-06-05 15:44       ` Jon Mason
  1 sibling, 0 replies; 11+ messages in thread
From: Josef Holzmayr @ 2023-06-05 15:34 UTC (permalink / raw)
  To: Clément Péron; +Cc: Jon Mason, meta-arm

[-- Attachment #1: Type: text/plain, Size: 4396 bytes --]

Hi Clement,

there is a qemuarm64+UEFI-based demo setup in
https://github.com/mendersoftware/meta-mender-community/tree/kirkstone/meta-mender-qemu-community.
You can just leave out the Mender bits if you don't want/need them and
should be good to go, I think.

Greetz,
Josef

On Mon, Jun 5, 2023 at 9:38 AM Clément Péron <peron.clem@gmail.com> wrote:

> Hi,
>
> On Fri, 28 Oct 2022 at 22:00, Clément Péron <peron.clem@gmail.com> wrote:
> >
> > Hi Jon,
> >
> > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > >
> > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Clément Péron wrote:
> > > > Dear Meta-arm Maintainers/Contributors,
> > > >
> > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > emulation on Apple Silicon).
> > > >
> > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > like to have a bootflow like this:
> > > > OVMF -> GRUB -> Kernel
> > > >
> > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > >
> https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > >
> > > > Then i'm booting my qemu machine like this:
> > > > ----
> > > > qemu-system-aarch64 \
> > > >   -machine virt \
> > > >   -name "Virtual ARM64" \
> > > >   -m 4G \
> > > >   -smp 6 \
> > > >   -cpu cortex-a57 \
> > > >   -drive
> file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > >   -bios ./QEMU_EFI.fd \
> > > >   -nographic
> > > > ----
> > > >
> > > > The output seems stuck after Grub and never properly jump into the
> kernel
> > > >
> > > > ----
> > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from
> PciRoot(0x0)/Pci(0x2,0x0)
> > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from
> PciRoot(0x0)/Pci(0x2,0x0)
> > > > Welcome to GRUB!
> > > >
> > > >
> > > >
> > > > EFI stub: Booting Linux Kernel...
> > > > EFI stub: Using DTB from configuration table
> > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > ----
> > > >
> > > > Did I miss something in my kernel configuration?
>
> I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> meta-arm and now I have the exact same problem.
>
> I have still the same patch applied and check that the cfg/efi.scc is
> properly applied but doesn't succeed to boot.
>
> I have tried with the previous grub and with the new one and both
> failed so it seems more related to linux kernel.
>
> I have tried to enable EFI_EARLYCON + append to cmdline
> "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> this...
>
> Do you know if there is a new CONFIG to enable?
>
> Thanks in advance,
> Regards,
> Clement
>
>
> > >
> > >
> > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > >
> > > meta-arm does have the following we are adding
> > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > >
> > > I do have a patch out to the yocto linux kernel recipe that has a
> > > config fragment that might be missing for your setup (in place of the
> > > above).
> > >
> https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > That patch has been accepted, but might not be in your tree (depending
> > > on what version you are running).
> >
> > Correct, patch applied and now it works :)
> >
> > Thank you for taking the time to answer my question.
> > Regards,
> > Clement
> >
> > >
> > > Thanks,
> > > Jon
> > >
> > >
> > > >
> > > > Thanks for your help
> > > > Regards,
> > > > Clement
> > > >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#4721):
> https://lists.yoctoproject.org/g/meta-arm/message/4721
> Mute This Topic: https://lists.yoctoproject.org/mt/94625180/4689568
> Group Owner: meta-arm+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [
> jester@theyoctojester.info]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 6653 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2023-06-05  7:38     ` Clément Péron
  2023-06-05 15:34       ` [meta-arm] " Josef Holzmayr
@ 2023-06-05 15:44       ` Jon Mason
  2023-06-05 20:57         ` Clément Péron
  1 sibling, 1 reply; 11+ messages in thread
From: Jon Mason @ 2023-06-05 15:44 UTC (permalink / raw)
  To: Clément Péron; +Cc: meta-arm

On Mon, Jun 05, 2023 at 09:38:18AM +0200, Cl�ment P�ron wrote:
> Hi,
> 
> On Fri, 28 Oct 2022 at 22:00, Cl�ment P�ron <peron.clem@gmail.com> wrote:
> >
> > Hi Jon,
> >
> > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > >
> > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Cl�ment P�ron wrote:
> > > > Dear Meta-arm Maintainers/Contributors,
> > > >
> > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > emulation on Apple Silicon).
> > > >
> > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > like to have a bootflow like this:
> > > > OVMF -> GRUB -> Kernel
> > > >
> > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > >
> > > > Then i'm booting my qemu machine like this:
> > > > ----
> > > > qemu-system-aarch64 \
> > > >   -machine virt \
> > > >   -name "Virtual ARM64" \
> > > >   -m 4G \
> > > >   -smp 6 \
> > > >   -cpu cortex-a57 \
> > > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > >   -bios ./QEMU_EFI.fd \
> > > >   -nographic
> > > > ----
> > > >
> > > > The output seems stuck after Grub and never properly jump into the kernel
> > > >
> > > > ----
> > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > Welcome to GRUB!
> > > >
> > > >
> > > >
> > > > EFI stub: Booting Linux Kernel...
> > > > EFI stub: Using DTB from configuration table
> > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > ----
> > > >
> > > > Did I miss something in my kernel configuration?
> 
> I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> meta-arm and now I have the exact same problem.
> 
> I have still the same patch applied and check that the cfg/efi.scc is
> properly applied but doesn't succeed to boot.
> 
> I have tried with the previous grub and with the new one and both
> failed so it seems more related to linux kernel.
> 
> I have tried to enable EFI_EARLYCON + append to cmdline
> "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> this...
> 
> Do you know if there is a new CONFIG to enable?
> 
> Thanks in advance,
> Regards,
> Clement

Okay, I'm being super lazy here.  So, it's possible I'm missing
something.

On the mickledore and master branch, I see no error using kas
$ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/edk2.yml:ci/testimage.yml
passes without issue and I'm then able to run 
$ runqemu slirp serialstdio
which boots to prompt

So, with kas and the kirkstone branch, with the same build and test,
works as expected.  However, with runqemu I do see an error

runqemu - ERROR - Failed to run qemu: qemu-system-aarch64: -display sdl,show-cursor=on: SDL display supported is not available in this binary

To get around that, I disable vga and it boots to prompt there.
$ runqemu slirp serialstdio novga

I was concerned that it could possibly be because meta-oe was present.
So, I used kas with that as a parameter and it passed testimage as
expected.

$ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/edk2.yml:ci/testimage.yml


The autogenerated (by kas) conf files are:

build/conf/bblayers.conf

BBLAYERS ?= " \
    ${TOPDIR}/../meta-arm \
    ${TOPDIR}/../meta-arm-bsp \
    ${TOPDIR}/../meta-arm-toolchain \
    ${TOPDIR}/../meta-openembedded/meta-filesystems \
    ${TOPDIR}/../meta-openembedded/meta-networking \
    ${TOPDIR}/../meta-openembedded/meta-oe \
    ${TOPDIR}/../meta-openembedded/meta-python \
    ${TOPDIR}/../poky/meta \
    ${TOPDIR}/../poky/meta-poky"
BBPATH ?= "${TOPDIR}"
BBFILES ??= ""


build/conf/local.conf

# base
BB_SERVER_TIMEOUT = "60"
CONF_VERSION = "2"
BB_NUMBER_THREADS = "16"
PARALLEL_MAKE = "-j16"
LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"

# bootfirmware
PREFERRED_PROVIDER_virtual/bootloader = "edk2-firmware"
MACHINE_FEATURES += "efi"
TFA_UBOOT = "0"
TFA_UEFI = "1"

# kvm
QEMU_USE_KVM = ""

# perf
CORE_IMAGE_EXTRA_INSTALL += "perf"

# setup
PACKAGE_CLASSES = "package_ipk"
PACKAGECONFIG:remove:pn-qemu-system-native = "gtk+ sdl"
EXTRA_IMAGE_FEATURES:append = " debug-tweaks"
PACKAGECONFIG:append:pn-perf = " coresight"
INHERIT += "rm_work"
DISTRO_FEATURES:remove = "ptest"

# slirp
TEST_RUNQEMUPARAMS = "slirp"
TEST_SERVER_IP = "127.0.0.1"
QEMU_USE_SLIRP = "1"

# sshd
IMAGE_FEATURES:append = " ssh-server-dropbear"

# sshkeys
CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"

# testimage
IMAGE_CLASSES += "testimage"
TESTIMAGE_AUTO = "1"

MACHINE ??= "qemuarm64"
DISTRO ??= "poky"
BBMULTICONFIG ?= ""


Hopefully this is useful (or let me know what I'm missing to replicate
here).

Thanks,
Jon

> 
> 
> > >
> > >
> > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > >
> > > meta-arm does have the following we are adding
> > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > >
> > > I do have a patch out to the yocto linux kernel recipe that has a
> > > config fragment that might be missing for your setup (in place of the
> > > above).
> > > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > That patch has been accepted, but might not be in your tree (depending
> > > on what version you are running).
> >
> > Correct, patch applied and now it works :)
> >
> > Thank you for taking the time to answer my question.
> > Regards,
> > Clement
> >
> > >
> > > Thanks,
> > > Jon
> > >
> > >
> > > >
> > > > Thanks for your help
> > > > Regards,
> > > > Clement
> > > >
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2023-06-05 15:44       ` Jon Mason
@ 2023-06-05 20:57         ` Clément Péron
  2023-06-06 12:49           ` Jon Mason
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Péron @ 2023-06-05 20:57 UTC (permalink / raw)
  To: Jon Mason, Josef Holzmayr; +Cc: meta-arm

Hi Jon and Josef,

On Mon, 5 Jun 2023 at 17:44, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Mon, Jun 05, 2023 at 09:38:18AM +0200, Clément Péron wrote:
> > Hi,
> >
> > On Fri, 28 Oct 2022 at 22:00, Clément Péron <peron.clem@gmail.com> wrote:
> > >
> > > Hi Jon,
> > >
> > > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > > >
> > > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Clément Péron wrote:
> > > > > Dear Meta-arm Maintainers/Contributors,
> > > > >
> > > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > > emulation on Apple Silicon).
> > > > >
> > > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > > like to have a bootflow like this:
> > > > > OVMF -> GRUB -> Kernel
> > > > >
> > > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > > >
> > > > > Then i'm booting my qemu machine like this:
> > > > > ----
> > > > > qemu-system-aarch64 \
> > > > >   -machine virt \
> > > > >   -name "Virtual ARM64" \
> > > > >   -m 4G \
> > > > >   -smp 6 \
> > > > >   -cpu cortex-a57 \
> > > > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > > >   -bios ./QEMU_EFI.fd \
> > > > >   -nographic
> > > > > ----
> > > > >
> > > > > The output seems stuck after Grub and never properly jump into the kernel
> > > > >
> > > > > ----
> > > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > Welcome to GRUB!
> > > > >
> > > > >
> > > > >
> > > > > EFI stub: Booting Linux Kernel...
> > > > > EFI stub: Using DTB from configuration table
> > > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > > ----
> > > > >
> > > > > Did I miss something in my kernel configuration?
> >
> > I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> > meta-arm and now I have the exact same problem.
> >
> > I have still the same patch applied and check that the cfg/efi.scc is
> > properly applied but doesn't succeed to boot.
> >
> > I have tried with the previous grub and with the new one and both
> > failed so it seems more related to linux kernel.
> >
> > I have tried to enable EFI_EARLYCON + append to cmdline
> > "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> > this...
> >
> > Do you know if there is a new CONFIG to enable?
> >
> > Thanks in advance,
> > Regards,
> > Clement
>
> Okay, I'm being super lazy here.  So, it's possible I'm missing
> something.

Thanks a lot to both of you, your answers were fast and helped me a lot.
I notice one big difference that I didn't check, is that I need both
CONFIG_EFI and CONFIG_ACPI to be enabled

Strangely, the CONFIG_ACPI is not enabled in my kernel config?

I tried to have a look at meta-arm and yocto-kernel-cache and I don't
see where CONFIG_ACPI should be enabled.

I will try to debug more tomorrow, but I have forced the CONFIG_ACPI
and it works perfectly :)

Thanks for helping me on this,
Regards,

>
> On the mickledore and master branch, I see no error using kas
> $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/edk2.yml:ci/testimage.yml
> passes without issue and I'm then able to run
> $ runqemu slirp serialstdio
> which boots to prompt
>
> So, with kas and the kirkstone branch, with the same build and test,
> works as expected.  However, with runqemu I do see an error
>
> runqemu - ERROR - Failed to run qemu: qemu-system-aarch64: -display sdl,show-cursor=on: SDL display supported is not available in this binary
>
> To get around that, I disable vga and it boots to prompt there.
> $ runqemu slirp serialstdio novga
>
> I was concerned that it could possibly be because meta-oe was present.
> So, I used kas with that as a parameter and it passed testimage as
> expected.
>
> $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/edk2.yml:ci/testimage.yml
>
>
> The autogenerated (by kas) conf files are:
>
> build/conf/bblayers.conf
>
> BBLAYERS ?= " \
>     ${TOPDIR}/../meta-arm \
>     ${TOPDIR}/../meta-arm-bsp \
>     ${TOPDIR}/../meta-arm-toolchain \
>     ${TOPDIR}/../meta-openembedded/meta-filesystems \
>     ${TOPDIR}/../meta-openembedded/meta-networking \
>     ${TOPDIR}/../meta-openembedded/meta-oe \
>     ${TOPDIR}/../meta-openembedded/meta-python \
>     ${TOPDIR}/../poky/meta \
>     ${TOPDIR}/../poky/meta-poky"
> BBPATH ?= "${TOPDIR}"
> BBFILES ??= ""
>
>
> build/conf/local.conf
>
> # base
> BB_SERVER_TIMEOUT = "60"
> CONF_VERSION = "2"
> BB_NUMBER_THREADS = "16"
> PARALLEL_MAKE = "-j16"
> LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
>
> # bootfirmware
> PREFERRED_PROVIDER_virtual/bootloader = "edk2-firmware"
> MACHINE_FEATURES += "efi"
> TFA_UBOOT = "0"
> TFA_UEFI = "1"
>
> # kvm
> QEMU_USE_KVM = ""
>
> # perf
> CORE_IMAGE_EXTRA_INSTALL += "perf"
>
> # setup
> PACKAGE_CLASSES = "package_ipk"
> PACKAGECONFIG:remove:pn-qemu-system-native = "gtk+ sdl"
> EXTRA_IMAGE_FEATURES:append = " debug-tweaks"
> PACKAGECONFIG:append:pn-perf = " coresight"
> INHERIT += "rm_work"
> DISTRO_FEATURES:remove = "ptest"
>
> # slirp
> TEST_RUNQEMUPARAMS = "slirp"
> TEST_SERVER_IP = "127.0.0.1"
> QEMU_USE_SLIRP = "1"
>
> # sshd
> IMAGE_FEATURES:append = " ssh-server-dropbear"
>
> # sshkeys
> CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"
>
> # testimage
> IMAGE_CLASSES += "testimage"
> TESTIMAGE_AUTO = "1"
>
> MACHINE ??= "qemuarm64"
> DISTRO ??= "poky"
> BBMULTICONFIG ?= ""
>
>
> Hopefully this is useful (or let me know what I'm missing to replicate
> here).
>
> Thanks,
> Jon
>
> >
> >
> > > >
> > > >
> > > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > > >
> > > > meta-arm does have the following we are adding
> > > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > > >
> > > > I do have a patch out to the yocto linux kernel recipe that has a
> > > > config fragment that might be missing for your setup (in place of the
> > > > above).
> > > > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > > That patch has been accepted, but might not be in your tree (depending
> > > > on what version you are running).
> > >
> > > Correct, patch applied and now it works :)
> > >
> > > Thank you for taking the time to answer my question.
> > > Regards,
> > > Clement
> > >
> > > >
> > > > Thanks,
> > > > Jon
> > > >
> > > >
> > > > >
> > > > > Thanks for your help
> > > > > Regards,
> > > > > Clement
> > > > >
> >


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2023-06-05 20:57         ` Clément Péron
@ 2023-06-06 12:49           ` Jon Mason
  2023-06-06 15:01             ` Clément Péron
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Mason @ 2023-06-06 12:49 UTC (permalink / raw)
  To: Clément Péron; +Cc: Josef Holzmayr, meta-arm

On Mon, Jun 05, 2023 at 10:57:22PM +0200, Cl�ment P�ron wrote:
> Hi Jon and Josef,
> 
> On Mon, 5 Jun 2023 at 17:44, Jon Mason <jdmason@kudzu.us> wrote:
> >
> > On Mon, Jun 05, 2023 at 09:38:18AM +0200, Cl�ment P�ron wrote:
> > > Hi,
> > >
> > > On Fri, 28 Oct 2022 at 22:00, Cl�ment P�ron <peron.clem@gmail.com> wrote:
> > > >
> > > > Hi Jon,
> > > >
> > > > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > > > >
> > > > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Cl�ment P�ron wrote:
> > > > > > Dear Meta-arm Maintainers/Contributors,
> > > > > >
> > > > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > > > emulation on Apple Silicon).
> > > > > >
> > > > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > > > like to have a bootflow like this:
> > > > > > OVMF -> GRUB -> Kernel
> > > > > >
> > > > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > > > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > > > >
> > > > > > Then i'm booting my qemu machine like this:
> > > > > > ----
> > > > > > qemu-system-aarch64 \
> > > > > >   -machine virt \
> > > > > >   -name "Virtual ARM64" \
> > > > > >   -m 4G \
> > > > > >   -smp 6 \
> > > > > >   -cpu cortex-a57 \
> > > > > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > > > >   -bios ./QEMU_EFI.fd \
> > > > > >   -nographic
> > > > > > ----
> > > > > >
> > > > > > The output seems stuck after Grub and never properly jump into the kernel
> > > > > >
> > > > > > ----
> > > > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > Welcome to GRUB!
> > > > > >
> > > > > >
> > > > > >
> > > > > > EFI stub: Booting Linux Kernel...
> > > > > > EFI stub: Using DTB from configuration table
> > > > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > > > ----
> > > > > >
> > > > > > Did I miss something in my kernel configuration?
> > >
> > > I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> > > meta-arm and now I have the exact same problem.
> > >
> > > I have still the same patch applied and check that the cfg/efi.scc is
> > > properly applied but doesn't succeed to boot.
> > >
> > > I have tried with the previous grub and with the new one and both
> > > failed so it seems more related to linux kernel.
> > >
> > > I have tried to enable EFI_EARLYCON + append to cmdline
> > > "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> > > this...
> > >
> > > Do you know if there is a new CONFIG to enable?
> > >
> > > Thanks in advance,
> > > Regards,
> > > Clement
> >
> > Okay, I'm being super lazy here.  So, it's possible I'm missing
> > something.
> 
> Thanks a lot to both of you, your answers were fast and helped me a lot.
> I notice one big difference that I didn't check, is that I need both
> CONFIG_EFI and CONFIG_ACPI to be enabled
> 
> Strangely, the CONFIG_ACPI is not enabled in my kernel config?
> 
> I tried to have a look at meta-arm and yocto-kernel-cache and I don't
> see where CONFIG_ACPI should be enabled.
> 
> I will try to debug more tomorrow, but I have forced the CONFIG_ACPI
> and it works perfectly :)

meta-arm had to add CONFIG_ACPI.  See
meta-arm/recipes-kernel/linux/files/efi.cfg

I tried to fix that upstream but got pushback from Bruce.  See
https://lists.yoctoproject.org/g/linux-yocto/message/12210

Thanks,
Jon


> Thanks for helping me on this,
> Regards,
> 
> >
> > On the mickledore and master branch, I see no error using kas
> > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/edk2.yml:ci/testimage.yml
> > passes without issue and I'm then able to run
> > $ runqemu slirp serialstdio
> > which boots to prompt
> >
> > So, with kas and the kirkstone branch, with the same build and test,
> > works as expected.  However, with runqemu I do see an error
> >
> > runqemu - ERROR - Failed to run qemu: qemu-system-aarch64: -display sdl,show-cursor=on: SDL display supported is not available in this binary
> >
> > To get around that, I disable vga and it boots to prompt there.
> > $ runqemu slirp serialstdio novga
> >
> > I was concerned that it could possibly be because meta-oe was present.
> > So, I used kas with that as a parameter and it passed testimage as
> > expected.
> >
> > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/edk2.yml:ci/testimage.yml
> >
> >
> > The autogenerated (by kas) conf files are:
> >
> > build/conf/bblayers.conf
> >
> > BBLAYERS ?= " \
> >     ${TOPDIR}/../meta-arm \
> >     ${TOPDIR}/../meta-arm-bsp \
> >     ${TOPDIR}/../meta-arm-toolchain \
> >     ${TOPDIR}/../meta-openembedded/meta-filesystems \
> >     ${TOPDIR}/../meta-openembedded/meta-networking \
> >     ${TOPDIR}/../meta-openembedded/meta-oe \
> >     ${TOPDIR}/../meta-openembedded/meta-python \
> >     ${TOPDIR}/../poky/meta \
> >     ${TOPDIR}/../poky/meta-poky"
> > BBPATH ?= "${TOPDIR}"
> > BBFILES ??= ""
> >
> >
> > build/conf/local.conf
> >
> > # base
> > BB_SERVER_TIMEOUT = "60"
> > CONF_VERSION = "2"
> > BB_NUMBER_THREADS = "16"
> > PARALLEL_MAKE = "-j16"
> > LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
> >
> > # bootfirmware
> > PREFERRED_PROVIDER_virtual/bootloader = "edk2-firmware"
> > MACHINE_FEATURES += "efi"
> > TFA_UBOOT = "0"
> > TFA_UEFI = "1"
> >
> > # kvm
> > QEMU_USE_KVM = ""
> >
> > # perf
> > CORE_IMAGE_EXTRA_INSTALL += "perf"
> >
> > # setup
> > PACKAGE_CLASSES = "package_ipk"
> > PACKAGECONFIG:remove:pn-qemu-system-native = "gtk+ sdl"
> > EXTRA_IMAGE_FEATURES:append = " debug-tweaks"
> > PACKAGECONFIG:append:pn-perf = " coresight"
> > INHERIT += "rm_work"
> > DISTRO_FEATURES:remove = "ptest"
> >
> > # slirp
> > TEST_RUNQEMUPARAMS = "slirp"
> > TEST_SERVER_IP = "127.0.0.1"
> > QEMU_USE_SLIRP = "1"
> >
> > # sshd
> > IMAGE_FEATURES:append = " ssh-server-dropbear"
> >
> > # sshkeys
> > CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"
> >
> > # testimage
> > IMAGE_CLASSES += "testimage"
> > TESTIMAGE_AUTO = "1"
> >
> > MACHINE ??= "qemuarm64"
> > DISTRO ??= "poky"
> > BBMULTICONFIG ?= ""
> >
> >
> > Hopefully this is useful (or let me know what I'm missing to replicate
> > here).
> >
> > Thanks,
> > Jon
> >
> > >
> > >
> > > > >
> > > > >
> > > > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > > > >
> > > > > meta-arm does have the following we are adding
> > > > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > > > >
> > > > > I do have a patch out to the yocto linux kernel recipe that has a
> > > > > config fragment that might be missing for your setup (in place of the
> > > > > above).
> > > > > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > > > That patch has been accepted, but might not be in your tree (depending
> > > > > on what version you are running).
> > > >
> > > > Correct, patch applied and now it works :)
> > > >
> > > > Thank you for taking the time to answer my question.
> > > > Regards,
> > > > Clement
> > > >
> > > > >
> > > > > Thanks,
> > > > > Jon
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks for your help
> > > > > > Regards,
> > > > > > Clement
> > > > > >
> > >
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2023-06-06 12:49           ` Jon Mason
@ 2023-06-06 15:01             ` Clément Péron
  2023-06-07 15:09               ` Jon Mason
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Péron @ 2023-06-06 15:01 UTC (permalink / raw)
  To: Jon Mason; +Cc: Josef Holzmayr, meta-arm

Hi Jon,

On Tue, 6 Jun 2023 at 14:49, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Mon, Jun 05, 2023 at 10:57:22PM +0200, Clément Péron wrote:
> > Hi Jon and Josef,
> >
> > On Mon, 5 Jun 2023 at 17:44, Jon Mason <jdmason@kudzu.us> wrote:
> > >
> > > On Mon, Jun 05, 2023 at 09:38:18AM +0200, Clément Péron wrote:
> > > > Hi,
> > > >
> > > > On Fri, 28 Oct 2022 at 22:00, Clément Péron <peron.clem@gmail.com> wrote:
> > > > >
> > > > > Hi Jon,
> > > > >
> > > > > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > > > > >
> > > > > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Clément Péron wrote:
> > > > > > > Dear Meta-arm Maintainers/Contributors,
> > > > > > >
> > > > > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > > > > emulation on Apple Silicon).
> > > > > > >
> > > > > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > > > > like to have a bootflow like this:
> > > > > > > OVMF -> GRUB -> Kernel
> > > > > > >
> > > > > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > > > > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > > > > >
> > > > > > > Then i'm booting my qemu machine like this:
> > > > > > > ----
> > > > > > > qemu-system-aarch64 \
> > > > > > >   -machine virt \
> > > > > > >   -name "Virtual ARM64" \
> > > > > > >   -m 4G \
> > > > > > >   -smp 6 \
> > > > > > >   -cpu cortex-a57 \
> > > > > > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > > > > >   -bios ./QEMU_EFI.fd \
> > > > > > >   -nographic
> > > > > > > ----
> > > > > > >
> > > > > > > The output seems stuck after Grub and never properly jump into the kernel
> > > > > > >
> > > > > > > ----
> > > > > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > > Welcome to GRUB!
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > EFI stub: Booting Linux Kernel...
> > > > > > > EFI stub: Using DTB from configuration table
> > > > > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > > > > ----
> > > > > > >
> > > > > > > Did I miss something in my kernel configuration?
> > > >
> > > > I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> > > > meta-arm and now I have the exact same problem.
> > > >
> > > > I have still the same patch applied and check that the cfg/efi.scc is
> > > > properly applied but doesn't succeed to boot.
> > > >
> > > > I have tried with the previous grub and with the new one and both
> > > > failed so it seems more related to linux kernel.
> > > >
> > > > I have tried to enable EFI_EARLYCON + append to cmdline
> > > > "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> > > > this...
> > > >
> > > > Do you know if there is a new CONFIG to enable?
> > > >
> > > > Thanks in advance,
> > > > Regards,
> > > > Clement
> > >
> > > Okay, I'm being super lazy here.  So, it's possible I'm missing
> > > something.
> >
> > Thanks a lot to both of you, your answers were fast and helped me a lot.
> > I notice one big difference that I didn't check, is that I need both
> > CONFIG_EFI and CONFIG_ACPI to be enabled
> >
> > Strangely, the CONFIG_ACPI is not enabled in my kernel config?
> >
> > I tried to have a look at meta-arm and yocto-kernel-cache and I don't
> > see where CONFIG_ACPI should be enabled.
> >
> > I will try to debug more tomorrow, but I have forced the CONFIG_ACPI
> > and it works perfectly :)
>
> meta-arm had to add CONFIG_ACPI.  See
> meta-arm/recipes-kernel/linux/files/efi.cfg

Yep, I see it on mickledore
https://github.com/jonmason/meta-arm/blob/mickledore/meta-arm/recipes-kernel/linux/files/efi.cfg

But not on kirkstone
https://github.com/jonmason/meta-arm/tree/kirkstone/meta-arm/recipes-kernel/linux

Regards,
Clement

>
> I tried to fix that upstream but got pushback from Bruce.  See
> https://lists.yoctoproject.org/g/linux-yocto/message/12210
>
> Thanks,
> Jon
>
>
> > Thanks for helping me on this,
> > Regards,
> >
> > >
> > > On the mickledore and master branch, I see no error using kas
> > > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/edk2.yml:ci/testimage.yml
> > > passes without issue and I'm then able to run
> > > $ runqemu slirp serialstdio
> > > which boots to prompt
> > >
> > > So, with kas and the kirkstone branch, with the same build and test,
> > > works as expected.  However, with runqemu I do see an error
> > >
> > > runqemu - ERROR - Failed to run qemu: qemu-system-aarch64: -display sdl,show-cursor=on: SDL display supported is not available in this binary
> > >
> > > To get around that, I disable vga and it boots to prompt there.
> > > $ runqemu slirp serialstdio novga
> > >
> > > I was concerned that it could possibly be because meta-oe was present.
> > > So, I used kas with that as a parameter and it passed testimage as
> > > expected.
> > >
> > > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/edk2.yml:ci/testimage.yml
> > >
> > >
> > > The autogenerated (by kas) conf files are:
> > >
> > > build/conf/bblayers.conf
> > >
> > > BBLAYERS ?= " \
> > >     ${TOPDIR}/../meta-arm \
> > >     ${TOPDIR}/../meta-arm-bsp \
> > >     ${TOPDIR}/../meta-arm-toolchain \
> > >     ${TOPDIR}/../meta-openembedded/meta-filesystems \
> > >     ${TOPDIR}/../meta-openembedded/meta-networking \
> > >     ${TOPDIR}/../meta-openembedded/meta-oe \
> > >     ${TOPDIR}/../meta-openembedded/meta-python \
> > >     ${TOPDIR}/../poky/meta \
> > >     ${TOPDIR}/../poky/meta-poky"
> > > BBPATH ?= "${TOPDIR}"
> > > BBFILES ??= ""
> > >
> > >
> > > build/conf/local.conf
> > >
> > > # base
> > > BB_SERVER_TIMEOUT = "60"
> > > CONF_VERSION = "2"
> > > BB_NUMBER_THREADS = "16"
> > > PARALLEL_MAKE = "-j16"
> > > LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
> > >
> > > # bootfirmware
> > > PREFERRED_PROVIDER_virtual/bootloader = "edk2-firmware"
> > > MACHINE_FEATURES += "efi"
> > > TFA_UBOOT = "0"
> > > TFA_UEFI = "1"
> > >
> > > # kvm
> > > QEMU_USE_KVM = ""
> > >
> > > # perf
> > > CORE_IMAGE_EXTRA_INSTALL += "perf"
> > >
> > > # setup
> > > PACKAGE_CLASSES = "package_ipk"
> > > PACKAGECONFIG:remove:pn-qemu-system-native = "gtk+ sdl"
> > > EXTRA_IMAGE_FEATURES:append = " debug-tweaks"
> > > PACKAGECONFIG:append:pn-perf = " coresight"
> > > INHERIT += "rm_work"
> > > DISTRO_FEATURES:remove = "ptest"
> > >
> > > # slirp
> > > TEST_RUNQEMUPARAMS = "slirp"
> > > TEST_SERVER_IP = "127.0.0.1"
> > > QEMU_USE_SLIRP = "1"
> > >
> > > # sshd
> > > IMAGE_FEATURES:append = " ssh-server-dropbear"
> > >
> > > # sshkeys
> > > CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"
> > >
> > > # testimage
> > > IMAGE_CLASSES += "testimage"
> > > TESTIMAGE_AUTO = "1"
> > >
> > > MACHINE ??= "qemuarm64"
> > > DISTRO ??= "poky"
> > > BBMULTICONFIG ?= ""
> > >
> > >
> > > Hopefully this is useful (or let me know what I'm missing to replicate
> > > here).
> > >
> > > Thanks,
> > > Jon
> > >
> > > >
> > > >
> > > > > >
> > > > > >
> > > > > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > > > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > > > > >
> > > > > > meta-arm does have the following we are adding
> > > > > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > > > > >
> > > > > > I do have a patch out to the yocto linux kernel recipe that has a
> > > > > > config fragment that might be missing for your setup (in place of the
> > > > > > above).
> > > > > > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > > > > That patch has been accepted, but might not be in your tree (depending
> > > > > > on what version you are running).
> > > > >
> > > > > Correct, patch applied and now it works :)
> > > > >
> > > > > Thank you for taking the time to answer my question.
> > > > > Regards,
> > > > > Clement
> > > > >
> > > > > >
> > > > > > Thanks,
> > > > > > Jon
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > Thanks for your help
> > > > > > > Regards,
> > > > > > > Clement
> > > > > > >
> > > >
> >


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2023-06-06 15:01             ` Clément Péron
@ 2023-06-07 15:09               ` Jon Mason
  2023-06-07 16:34                 ` Clément Péron
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Mason @ 2023-06-07 15:09 UTC (permalink / raw)
  To: Clément Péron; +Cc: Josef Holzmayr, meta-arm

On Tue, Jun 06, 2023 at 05:01:50PM +0200, Cl�ment P�ron wrote:
> Hi Jon,
> 
> On Tue, 6 Jun 2023 at 14:49, Jon Mason <jdmason@kudzu.us> wrote:
> >
> > On Mon, Jun 05, 2023 at 10:57:22PM +0200, Cl�ment P�ron wrote:
> > > Hi Jon and Josef,
> > >
> > > On Mon, 5 Jun 2023 at 17:44, Jon Mason <jdmason@kudzu.us> wrote:
> > > >
> > > > On Mon, Jun 05, 2023 at 09:38:18AM +0200, Cl�ment P�ron wrote:
> > > > > Hi,
> > > > >
> > > > > On Fri, 28 Oct 2022 at 22:00, Cl�ment P�ron <peron.clem@gmail.com> wrote:
> > > > > >
> > > > > > Hi Jon,
> > > > > >
> > > > > > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > > > > > >
> > > > > > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Cl�ment P�ron wrote:
> > > > > > > > Dear Meta-arm Maintainers/Contributors,
> > > > > > > >
> > > > > > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > > > > > emulation on Apple Silicon).
> > > > > > > >
> > > > > > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > > > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > > > > > like to have a bootflow like this:
> > > > > > > > OVMF -> GRUB -> Kernel
> > > > > > > >
> > > > > > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > > > > > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > > > > > >
> > > > > > > > Then i'm booting my qemu machine like this:
> > > > > > > > ----
> > > > > > > > qemu-system-aarch64 \
> > > > > > > >   -machine virt \
> > > > > > > >   -name "Virtual ARM64" \
> > > > > > > >   -m 4G \
> > > > > > > >   -smp 6 \
> > > > > > > >   -cpu cortex-a57 \
> > > > > > > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > > > > > >   -bios ./QEMU_EFI.fd \
> > > > > > > >   -nographic
> > > > > > > > ----
> > > > > > > >
> > > > > > > > The output seems stuck after Grub and never properly jump into the kernel
> > > > > > > >
> > > > > > > > ----
> > > > > > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > > > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > > > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > > > Welcome to GRUB!
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > EFI stub: Booting Linux Kernel...
> > > > > > > > EFI stub: Using DTB from configuration table
> > > > > > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > > > > > ----
> > > > > > > >
> > > > > > > > Did I miss something in my kernel configuration?
> > > > >
> > > > > I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> > > > > meta-arm and now I have the exact same problem.
> > > > >
> > > > > I have still the same patch applied and check that the cfg/efi.scc is
> > > > > properly applied but doesn't succeed to boot.
> > > > >
> > > > > I have tried with the previous grub and with the new one and both
> > > > > failed so it seems more related to linux kernel.
> > > > >
> > > > > I have tried to enable EFI_EARLYCON + append to cmdline
> > > > > "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> > > > > this...
> > > > >
> > > > > Do you know if there is a new CONFIG to enable?
> > > > >
> > > > > Thanks in advance,
> > > > > Regards,
> > > > > Clement
> > > >
> > > > Okay, I'm being super lazy here.  So, it's possible I'm missing
> > > > something.
> > >
> > > Thanks a lot to both of you, your answers were fast and helped me a lot.
> > > I notice one big difference that I didn't check, is that I need both
> > > CONFIG_EFI and CONFIG_ACPI to be enabled
> > >
> > > Strangely, the CONFIG_ACPI is not enabled in my kernel config?
> > >
> > > I tried to have a look at meta-arm and yocto-kernel-cache and I don't
> > > see where CONFIG_ACPI should be enabled.
> > >
> > > I will try to debug more tomorrow, but I have forced the CONFIG_ACPI
> > > and it works perfectly :)
> >
> > meta-arm had to add CONFIG_ACPI.  See
> > meta-arm/recipes-kernel/linux/files/efi.cfg
> 
> Yep, I see it on mickledore
> https://github.com/jonmason/meta-arm/blob/mickledore/meta-arm/recipes-kernel/linux/files/efi.cfg
> 
> But not on kirkstone
> https://github.com/jonmason/meta-arm/tree/kirkstone/meta-arm/recipes-kernel/linux

It should be in the yocto-kernel-cache for those legacy branches.  If
not, I can make a unique patch to pull it back (as the patch from
upstream where this config frag is added isn't really relevant for the
legacy branches).  Similarily, if this is needed for other branches,
let me know and I'll do a similar patch.

Thanks,
Jon

> 
> Regards,
> Clement
> 
> >
> > I tried to fix that upstream but got pushback from Bruce.  See
> > https://lists.yoctoproject.org/g/linux-yocto/message/12210
> >
> > Thanks,
> > Jon
> >
> >
> > > Thanks for helping me on this,
> > > Regards,
> > >
> > > >
> > > > On the mickledore and master branch, I see no error using kas
> > > > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/edk2.yml:ci/testimage.yml
> > > > passes without issue and I'm then able to run
> > > > $ runqemu slirp serialstdio
> > > > which boots to prompt
> > > >
> > > > So, with kas and the kirkstone branch, with the same build and test,
> > > > works as expected.  However, with runqemu I do see an error
> > > >
> > > > runqemu - ERROR - Failed to run qemu: qemu-system-aarch64: -display sdl,show-cursor=on: SDL display supported is not available in this binary
> > > >
> > > > To get around that, I disable vga and it boots to prompt there.
> > > > $ runqemu slirp serialstdio novga
> > > >
> > > > I was concerned that it could possibly be because meta-oe was present.
> > > > So, I used kas with that as a parameter and it passed testimage as
> > > > expected.
> > > >
> > > > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/edk2.yml:ci/testimage.yml
> > > >
> > > >
> > > > The autogenerated (by kas) conf files are:
> > > >
> > > > build/conf/bblayers.conf
> > > >
> > > > BBLAYERS ?= " \
> > > >     ${TOPDIR}/../meta-arm \
> > > >     ${TOPDIR}/../meta-arm-bsp \
> > > >     ${TOPDIR}/../meta-arm-toolchain \
> > > >     ${TOPDIR}/../meta-openembedded/meta-filesystems \
> > > >     ${TOPDIR}/../meta-openembedded/meta-networking \
> > > >     ${TOPDIR}/../meta-openembedded/meta-oe \
> > > >     ${TOPDIR}/../meta-openembedded/meta-python \
> > > >     ${TOPDIR}/../poky/meta \
> > > >     ${TOPDIR}/../poky/meta-poky"
> > > > BBPATH ?= "${TOPDIR}"
> > > > BBFILES ??= ""
> > > >
> > > >
> > > > build/conf/local.conf
> > > >
> > > > # base
> > > > BB_SERVER_TIMEOUT = "60"
> > > > CONF_VERSION = "2"
> > > > BB_NUMBER_THREADS = "16"
> > > > PARALLEL_MAKE = "-j16"
> > > > LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
> > > >
> > > > # bootfirmware
> > > > PREFERRED_PROVIDER_virtual/bootloader = "edk2-firmware"
> > > > MACHINE_FEATURES += "efi"
> > > > TFA_UBOOT = "0"
> > > > TFA_UEFI = "1"
> > > >
> > > > # kvm
> > > > QEMU_USE_KVM = ""
> > > >
> > > > # perf
> > > > CORE_IMAGE_EXTRA_INSTALL += "perf"
> > > >
> > > > # setup
> > > > PACKAGE_CLASSES = "package_ipk"
> > > > PACKAGECONFIG:remove:pn-qemu-system-native = "gtk+ sdl"
> > > > EXTRA_IMAGE_FEATURES:append = " debug-tweaks"
> > > > PACKAGECONFIG:append:pn-perf = " coresight"
> > > > INHERIT += "rm_work"
> > > > DISTRO_FEATURES:remove = "ptest"
> > > >
> > > > # slirp
> > > > TEST_RUNQEMUPARAMS = "slirp"
> > > > TEST_SERVER_IP = "127.0.0.1"
> > > > QEMU_USE_SLIRP = "1"
> > > >
> > > > # sshd
> > > > IMAGE_FEATURES:append = " ssh-server-dropbear"
> > > >
> > > > # sshkeys
> > > > CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"
> > > >
> > > > # testimage
> > > > IMAGE_CLASSES += "testimage"
> > > > TESTIMAGE_AUTO = "1"
> > > >
> > > > MACHINE ??= "qemuarm64"
> > > > DISTRO ??= "poky"
> > > > BBMULTICONFIG ?= ""
> > > >
> > > >
> > > > Hopefully this is useful (or let me know what I'm missing to replicate
> > > > here).
> > > >
> > > > Thanks,
> > > > Jon
> > > >
> > > > >
> > > > >
> > > > > > >
> > > > > > >
> > > > > > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > > > > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > > > > > >
> > > > > > > meta-arm does have the following we are adding
> > > > > > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > > > > > >
> > > > > > > I do have a patch out to the yocto linux kernel recipe that has a
> > > > > > > config fragment that might be missing for your setup (in place of the
> > > > > > > above).
> > > > > > > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > > > > > That patch has been accepted, but might not be in your tree (depending
> > > > > > > on what version you are running).
> > > > > >
> > > > > > Correct, patch applied and now it works :)
> > > > > >
> > > > > > Thank you for taking the time to answer my question.
> > > > > > Regards,
> > > > > > Clement
> > > > > >
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Jon
> > > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > Thanks for your help
> > > > > > > > Regards,
> > > > > > > > Clement
> > > > > > > >
> > > > >
> > >
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Help to boot QEMU ARM64 UEFI
  2023-06-07 15:09               ` Jon Mason
@ 2023-06-07 16:34                 ` Clément Péron
  0 siblings, 0 replies; 11+ messages in thread
From: Clément Péron @ 2023-06-07 16:34 UTC (permalink / raw)
  To: Jon Mason; +Cc: Josef Holzmayr, meta-arm

Hi Jon,

On Wed, 7 Jun 2023 at 17:09, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Tue, Jun 06, 2023 at 05:01:50PM +0200, Clément Péron wrote:
> > Hi Jon,
> >
> > On Tue, 6 Jun 2023 at 14:49, Jon Mason <jdmason@kudzu.us> wrote:
> > >
> > > On Mon, Jun 05, 2023 at 10:57:22PM +0200, Clément Péron wrote:
> > > > Hi Jon and Josef,
> > > >
> > > > On Mon, 5 Jun 2023 at 17:44, Jon Mason <jdmason@kudzu.us> wrote:
> > > > >
> > > > > On Mon, Jun 05, 2023 at 09:38:18AM +0200, Clément Péron wrote:
> > > > > > Hi,
> > > > > >
> > > > > > On Fri, 28 Oct 2022 at 22:00, Clément Péron <peron.clem@gmail.com> wrote:
> > > > > > >
> > > > > > > Hi Jon,
> > > > > > >
> > > > > > > On Fri, 28 Oct 2022 at 16:10, Jon Mason <jdmason@kudzu.us> wrote:
> > > > > > > >
> > > > > > > > On Fri, Oct 28, 2022 at 02:31:38PM +0200, Clément Péron wrote:
> > > > > > > > > Dear Meta-arm Maintainers/Contributors,
> > > > > > > > >
> > > > > > > > > I'm trying to boot a qemuarm64 machine with UEFI boot (to get rid of
> > > > > > > > > emulation on Apple Silicon).
> > > > > > > > >
> > > > > > > > > I'm really noob at UEFI and was used to boot my ARM devices using
> > > > > > > > > u-boot but to keep coherency with other QEMU machines x86-64, I would
> > > > > > > > > like to have a bootflow like this:
> > > > > > > > > OVMF -> GRUB -> Kernel
> > > > > > > > >
> > > > > > > > > I got the OVMF firmware from EDK2-firmware recipe on meta-arm:
> > > > > > > > > https://github.com/jonmason/meta-arm/tree/master/meta-arm/recipes-bsp/uefi
> > > > > > > > >
> > > > > > > > > Then i'm booting my qemu machine like this:
> > > > > > > > > ----
> > > > > > > > > qemu-system-aarch64 \
> > > > > > > > >   -machine virt \
> > > > > > > > >   -name "Virtual ARM64" \
> > > > > > > > >   -m 4G \
> > > > > > > > >   -smp 6 \
> > > > > > > > >   -cpu cortex-a57 \
> > > > > > > > >   -drive file=./core-image-minimal-qemuarm64-efi.uefiimg,if=virtio,format=raw\
> > > > > > > > >   -bios ./QEMU_EFI.fd \
> > > > > > > > >   -nographic
> > > > > > > > > ----
> > > > > > > > >
> > > > > > > > > The output seems stuck after Grub and never properly jump into the kernel
> > > > > > > > >
> > > > > > > > > ----
> > > > > > > > > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > > > > > > > > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > > > > > > > > BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > > > > BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
> > > > > > > > > Welcome to GRUB!
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > EFI stub: Booting Linux Kernel...
> > > > > > > > > EFI stub: Using DTB from configuration table
> > > > > > > > > EFI stub: Exiting boot services and installing virtual address map...
> > > > > > > > > ----
> > > > > > > > >
> > > > > > > > > Did I miss something in my kernel configuration?
> > > > > >
> > > > > > I have just bumped my layer to yocto kirkstone 4.0.10 w/ meta-oe and
> > > > > > meta-arm and now I have the exact same problem.
> > > > > >
> > > > > > I have still the same patch applied and check that the cfg/efi.scc is
> > > > > > properly applied but doesn't succeed to boot.
> > > > > >
> > > > > > I have tried with the previous grub and with the new one and both
> > > > > > failed so it seems more related to linux kernel.
> > > > > >
> > > > > > I have tried to enable EFI_EARLYCON + append to cmdline
> > > > > > "earlycon=pl011,0x9000000" same print. I'm not sure at all about
> > > > > > this...
> > > > > >
> > > > > > Do you know if there is a new CONFIG to enable?
> > > > > >
> > > > > > Thanks in advance,
> > > > > > Regards,
> > > > > > Clement
> > > > >
> > > > > Okay, I'm being super lazy here.  So, it's possible I'm missing
> > > > > something.
> > > >
> > > > Thanks a lot to both of you, your answers were fast and helped me a lot.
> > > > I notice one big difference that I didn't check, is that I need both
> > > > CONFIG_EFI and CONFIG_ACPI to be enabled
> > > >
> > > > Strangely, the CONFIG_ACPI is not enabled in my kernel config?
> > > >
> > > > I tried to have a look at meta-arm and yocto-kernel-cache and I don't
> > > > see where CONFIG_ACPI should be enabled.
> > > >
> > > > I will try to debug more tomorrow, but I have forced the CONFIG_ACPI
> > > > and it works perfectly :)
> > >
> > > meta-arm had to add CONFIG_ACPI.  See
> > > meta-arm/recipes-kernel/linux/files/efi.cfg
> >
> > Yep, I see it on mickledore
> > https://github.com/jonmason/meta-arm/blob/mickledore/meta-arm/recipes-kernel/linux/files/efi.cfg
> >
> > But not on kirkstone
> > https://github.com/jonmason/meta-arm/tree/kirkstone/meta-arm/recipes-kernel/linux
>
> It should be in the yocto-kernel-cache for those legacy branches.  If
> not, I can make a unique patch to pull it back (as the patch from
> upstream where this config frag is added isn't really relevant for the
> legacy branches).  Similarily, if this is needed for other branches,
> let me know and I'll do a similar patch.

I use the linux-yocto, which in kirkstone is 5.15 based.

Which point to this efi.cfg:
https://git.yoctoproject.org/yocto-kernel-cache/tree/cfg/efi.cfg?h=yocto-5.15
=> NO CONFIG_ACPI.

Ok it seems that the patch from Andrei Gherzan has been backported...

https://git.yoctoproject.org/yocto-kernel-cache/commit/cfg/efi.cfg?h=yocto-5.15&id=90bd9b4496b4df0bf18c20980f13f3bb26c37c17

If it can help other users maybe it's better to have the fix in meta-arm

Regards,
Clement


>
> Thanks,
> Jon
>
> >
> > Regards,
> > Clement
> >
> > >
> > > I tried to fix that upstream but got pushback from Bruce.  See
> > > https://lists.yoctoproject.org/g/linux-yocto/message/12210
> > >
> > > Thanks,
> > > Jon
> > >
> > >
> > > > Thanks for helping me on this,
> > > > Regards,
> > > >
> > > > >
> > > > > On the mickledore and master branch, I see no error using kas
> > > > > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/edk2.yml:ci/testimage.yml
> > > > > passes without issue and I'm then able to run
> > > > > $ runqemu slirp serialstdio
> > > > > which boots to prompt
> > > > >
> > > > > So, with kas and the kirkstone branch, with the same build and test,
> > > > > works as expected.  However, with runqemu I do see an error
> > > > >
> > > > > runqemu - ERROR - Failed to run qemu: qemu-system-aarch64: -display sdl,show-cursor=on: SDL display supported is not available in this binary
> > > > >
> > > > > To get around that, I disable vga and it boots to prompt there.
> > > > > $ runqemu slirp serialstdio novga
> > > > >
> > > > > I was concerned that it could possibly be because meta-oe was present.
> > > > > So, I used kas with that as a parameter and it passed testimage as
> > > > > expected.
> > > > >
> > > > > $ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/edk2.yml:ci/testimage.yml
> > > > >
> > > > >
> > > > > The autogenerated (by kas) conf files are:
> > > > >
> > > > > build/conf/bblayers.conf
> > > > >
> > > > > BBLAYERS ?= " \
> > > > >     ${TOPDIR}/../meta-arm \
> > > > >     ${TOPDIR}/../meta-arm-bsp \
> > > > >     ${TOPDIR}/../meta-arm-toolchain \
> > > > >     ${TOPDIR}/../meta-openembedded/meta-filesystems \
> > > > >     ${TOPDIR}/../meta-openembedded/meta-networking \
> > > > >     ${TOPDIR}/../meta-openembedded/meta-oe \
> > > > >     ${TOPDIR}/../meta-openembedded/meta-python \
> > > > >     ${TOPDIR}/../poky/meta \
> > > > >     ${TOPDIR}/../poky/meta-poky"
> > > > > BBPATH ?= "${TOPDIR}"
> > > > > BBFILES ??= ""
> > > > >
> > > > >
> > > > > build/conf/local.conf
> > > > >
> > > > > # base
> > > > > BB_SERVER_TIMEOUT = "60"
> > > > > CONF_VERSION = "2"
> > > > > BB_NUMBER_THREADS = "16"
> > > > > PARALLEL_MAKE = "-j16"
> > > > > LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
> > > > >
> > > > > # bootfirmware
> > > > > PREFERRED_PROVIDER_virtual/bootloader = "edk2-firmware"
> > > > > MACHINE_FEATURES += "efi"
> > > > > TFA_UBOOT = "0"
> > > > > TFA_UEFI = "1"
> > > > >
> > > > > # kvm
> > > > > QEMU_USE_KVM = ""
> > > > >
> > > > > # perf
> > > > > CORE_IMAGE_EXTRA_INSTALL += "perf"
> > > > >
> > > > > # setup
> > > > > PACKAGE_CLASSES = "package_ipk"
> > > > > PACKAGECONFIG:remove:pn-qemu-system-native = "gtk+ sdl"
> > > > > EXTRA_IMAGE_FEATURES:append = " debug-tweaks"
> > > > > PACKAGECONFIG:append:pn-perf = " coresight"
> > > > > INHERIT += "rm_work"
> > > > > DISTRO_FEATURES:remove = "ptest"
> > > > >
> > > > > # slirp
> > > > > TEST_RUNQEMUPARAMS = "slirp"
> > > > > TEST_SERVER_IP = "127.0.0.1"
> > > > > QEMU_USE_SLIRP = "1"
> > > > >
> > > > > # sshd
> > > > > IMAGE_FEATURES:append = " ssh-server-dropbear"
> > > > >
> > > > > # sshkeys
> > > > > CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"
> > > > >
> > > > > # testimage
> > > > > IMAGE_CLASSES += "testimage"
> > > > > TESTIMAGE_AUTO = "1"
> > > > >
> > > > > MACHINE ??= "qemuarm64"
> > > > > DISTRO ??= "poky"
> > > > > BBMULTICONFIG ?= ""
> > > > >
> > > > >
> > > > > Hopefully this is useful (or let me know what I'm missing to replicate
> > > > > here).
> > > > >
> > > > > Thanks,
> > > > > Jon
> > > > >
> > > > > >
> > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > qemuarm64 and efi/edk2 generally works and we test it every night
> > > > > > > > https://gitlab.com/jonmason00/meta-arm/-/jobs/3241022680
> > > > > > > >
> > > > > > > > meta-arm does have the following we are adding
> > > > > > > > meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
> > > > > > > >
> > > > > > > > I do have a patch out to the yocto linux kernel recipe that has a
> > > > > > > > config fragment that might be missing for your setup (in place of the
> > > > > > > > above).
> > > > > > > > https://lore.kernel.org/openembedded-core/20221003004959.1317009-1-jdmason@kudzu.us/T/
> > > > > > > > That patch has been accepted, but might not be in your tree (depending
> > > > > > > > on what version you are running).
> > > > > > >
> > > > > > > Correct, patch applied and now it works :)
> > > > > > >
> > > > > > > Thank you for taking the time to answer my question.
> > > > > > > Regards,
> > > > > > > Clement
> > > > > > >
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Jon
> > > > > > > >
> > > > > > > >
> > > > > > > > >
> > > > > > > > > Thanks for your help
> > > > > > > > > Regards,
> > > > > > > > > Clement
> > > > > > > > >
> > > > > >
> > > >
> >


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-06-07 16:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 12:31 Help to boot QEMU ARM64 UEFI Clément Péron
2022-10-28 14:10 ` Jon Mason
2022-10-28 20:00   ` Clément Péron
2023-06-05  7:38     ` Clément Péron
2023-06-05 15:34       ` [meta-arm] " Josef Holzmayr
2023-06-05 15:44       ` Jon Mason
2023-06-05 20:57         ` Clément Péron
2023-06-06 12:49           ` Jon Mason
2023-06-06 15:01             ` Clément Péron
2023-06-07 15:09               ` Jon Mason
2023-06-07 16:34                 ` Clément Péron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.