On Wed, Mar 11, 2026 at 03:24:04PM -0700, Pierrick Bouvier wrote: > Hi Luigi, > > On 3/11/26 6:43 AM, Luigi Leonardi wrote: > > Add a machine property to pass a debug level to EDK2 firmware via the > > device tree. The value is set as an "edk2,debug-level" property on all > > pl011 UART nodes. > > > > This is to create a runtime parameter to set the verbosity of the debug > > log on the serial ports in edk2. Currently, the only way to set the > > verbosity is a compile-time option. > > > > DT is used because the fw_cfg interface is not yet initialized in early > > boot phases. > > > > Corresponding edk2 PR: https://github.com/tianocore/edk2/pull/12277 > > > > Suggested-by: Gerd Hoffmann <[email protected]> > > Signed-off-by: Luigi Leonardi <[email protected]> > > --- > > docs/system/arm/virt.rst | 6 ++++++ > > hw/arm/virt.c | 38 ++++++++++++++++++++++++++++++++++++++ > > include/hw/arm/virt.h | 2 ++ > > 3 files changed, 46 insertions(+) > > > > I am not sure if maintainer want to have bootloader specific options in > machine code.
Does that mean "yes" or "no" or "maybe" ? Some background: Traditionally firmware logging in edk2/ArmVirtPkg is a compile time option, so typically distributions ship two builds, one with logging turned on and one with logging turned off. Last year edk2 got support for logging to a memory buffer which can be accessed from the booted OS or via qemu monitor. Ideally we have this always enabled, but without also spamming the serial console with the firmware log (by default). While working on that it would be nice to also get rid of the two builds by moving from a compile time to a runtime switch for the serial debug log. > Alternatively, it's possible to dump virt dtb, modify it, and pass it. > $ ./build/qemu-system-aarch64 -M virt,dtb=file.dtb > $ ... modify dt ... > $ ./build/qemu-system-aarch64 -M virt,dtb=file.dtb I'd like to have something more convenient than that to turn on firmware debug logging. On x86 we have a dedicated device for firmware logging (isa-debugcon), so logging can be easily enabled on the qemu command line by adding that device. So the idea here is to have a dt property added to serial port to setup firmware logging, so we have something roughly comparable to the x86 functionality ... take care, Gerd
