Hi Elliot,

On 2026-07-30T19:37:45, Elliot Berman <[email protected]> wrote:
> qemu-x86: Wire support for applying capsule updates to pflash

The other two patches use the 'x86: qemu:' / 'x86: emulation:' prefix
— please make this one consistent (e.g., 'x86: qemu: Wire support for
capsule updates to pflash').

>
> Following the flow used for qemu-arm64, probe the pflash MTD device
> and set dfu_alt_info/mtdparts for qemu-x86 and qemu-x86_64 so EFI
> capsule updates can target the u-boot pflash partition.
>
> Signed-off-by: Elliot Berman <[email protected]>
>
> board/emulation/common/Kconfig         |  2 ++
>  board/emulation/common/qemu_dfu.c      |  6 ++++--
>  board/emulation/common/qemu_mtdparts.c |  6 ++++--
>  board/emulation/qemu-x86/Kconfig       |  3 +++
>  board/emulation/qemu-x86/Makefile      |  3 +++
>  board/emulation/qemu-x86/qemu-x86.c    | 38 
> ++++++++++++++++++++++++++++++++++
>  6 files changed, 54 insertions(+), 4 deletions(-)

> diff --git a/board/emulation/qemu-x86/Kconfig 
> b/board/emulation/qemu-x86/Kconfig
> @@ -24,5 +24,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy
>       imply VIRTIO_NET
>       imply VIRTIO_BLK
>       imply CMD_SMBIOS
> +     imply SET_DFU_ALT_INFO
> +     imply SYS_MTDPARTS_RUNTIME

These are only useful when EFI capsule updates are wanted. qemu-arm
gates them by putting them in a separate 'if TARGET_QEMU_ARM_64BIT &&
!TFABOOT' block that also sources common/Kconfig - please follow the
same pattern here.

> diff --git a/board/emulation/qemu-x86/Makefile 
> b/board/emulation/qemu-x86/Makefile
> @@ -0,0 +1,3 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +
> +obj-y        += qemu-x86.o

The whole body of qemu-x86.c is wrapped in #if
IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT). Please gate the object
here instead and drop the outer #if:

    obj-$(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) += qemu-x86.o

> diff --git a/board/emulation/qemu-x86/qemu-x86.c 
> b/board/emulation/qemu-x86/qemu-x86.c
> @@ -0,0 +1,38 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +#include <config.h>
> +#include <efi.h>
> +#include <efi_loader.h>

ARRAY_SIZE() is used below, so please add #include <linux/kernel.h>
explicitly (matches qemu-arm.c) rather than relying on transitive
includes.

> diff --git a/board/emulation/qemu-x86/qemu-x86.c 
> b/board/emulation/qemu-x86/qemu-x86.c
> @@ -0,0 +1,38 @@
> +#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
> +struct efi_fw_image fw_images[] = {
> +#if defined(CONFIG_TARGET_QEMU_X86)
> +     {
> +             .image_type_id = QEMU_X86_UBOOT_IMAGE_GUID,
> +             .fw_name = u"Qemu-X86-UBOOT",
> +             .image_index = 1,
> +     },
> +#elif defined(CONFIG_TARGET_QEMU_X86_64)

Please use IS_ENABLED() consistently rather than mixing it with #if
defined(). qemu-arm.c does the same thing, but new code should prefer
the modern form.

Regards,
Simon

Reply via email to