qemu-arm
[Top][All Lists]
Advanced

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

Re: Question on UEFI ACPI tables setup and probing on arm64


From: Ard Biesheuvel
Subject: Re: Question on UEFI ACPI tables setup and probing on arm64
Date: Wed, 4 Nov 2020 22:57:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 11/4/20 10:46 PM, Laszlo Ersek wrote:
...

(9) (Ard, please correct the below if necessary; thanks.)

The UEFI stub of the guest kernel (which is a UEFI application) uses a
device tree as its main communication channel to the (later-started)
kernel entry point, AIUI.

The UEFI stub basically inverts the importance of the UEFI system table
versus the device tree -- the UEFI stub *converts* the UEFI system table
(the multitude of UEFI config tables) into a device tree. This is my
understanding anyway.


Not entirely. The UEFI stub uses DT to communicate with the kernel proper, just like a non-EFI bootloader does. There are two pieces of information regarding EFI that the stub passes via the device tree:
- the EFI system table address
- the EFI memory map (address, size, descriptor size etc)

(Aside: unfortunately, we cannot pass the latter information via a EFI configuration table, given that we call SetVirtualAddressMap() in the stub, which causes the config_tables member of the system table to be converted into a virtual address. That virtual address can only be converted into a physical address if we have access to the EFI memory map.)

All other information passed between the EFI stub and the kernel proper is passed via Linux-specific EFI configuration tables.

(9a) If ACPI was disabled on the QEMU command line, then the guest
kernel *adopts* the device tree that was forwarded to it in (6), via the
UEFI config table marked with DEVICE_TREE_GUID.


Yes, although the EFI stub updates/augments it with the two data items mentioned above, as well as the kernel command line, initrd base and size and a KASLR seed [if enabled].

(9b) If ACPI was enabled on the QEMU command line, then the UEFI stub
creates a brand new (empty) device tree (AIUI).


... unless GRUB executed first and loaded a initrd, and passed this information via the device tree. In this case, GRUB creates an empty DT (Note that I posted the GRUB patches to implement LoadFile2 based initrd loading just a week or so ago)

Either way, the UEFI system table is linked *under* the -- adopted or
new -- device tree, through the "chosen" node. And so, if ACPI was
enabled, the ACPI RSD PTR (coming from step (7)) becomes visible to the
kernel proper as well, through the UEFI config table with
ACPI_20_TABLE_GUID.

I believe this is implemented under "drivers/firmware/efi/libstub" in
the kernel tree.

Thanks,
Laszlo





reply via email to

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