[PATCH v4 14/24] efi_loader: fwu: fwu_arm_psa: Skip accepting the payload after set_image()
Ilias Apalodimas
ilias.apalodimas at linaro.org
Wed Aug 20 14:37:57 CEST 2025
?
On Fri, 25 Jul 2025 at 18:50, <abdellatif.elkhlifi at arm.com> wrote:
>
> From: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
>
> Do not update the acceptance metadata bit after updating an image
>
> The update agent (secure world) is responsible of setting the acceptance
[...]
>
> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> index 234e3c1b3c0..1dac691d24d 100644
> --- a/lib/efi_loader/efi_capsule.c
> +++ b/lib/efi_loader/efi_capsule.c
> @@ -696,17 +696,20 @@ static efi_status_t efi_capsule_update_firmware(
> status = fwu_clear_accept_image(image_type_id,
> update_index);
> }
> - ret = fwu_to_efi_error(status);
> - if (ret != EFI_SUCCESS) {
> - log_err("Unable to %s the accept bit for the image %pUs\n",
> - fw_accept_os ? "clear" : "set",
> - image_type_id);
> - goto out;
> - }
>
> - log_debug("%s the accepted bit for Image %pUs\n",
> - fw_accept_os ? "Cleared" : "Set",
> - image_type_id);
> + if (!IS_ENABLED(CONFIG_FWU_ARM_PSA)) {
The function above always returns EFI_SUCCESS if PSA is enabled
> + ret = fwu_to_efi_error(status);
> + if (ret != EFI_SUCCESS) {
> + log_err("Unable to %s the accept bit for the image %pUs\n",
> + fw_accept_os ? "clear" : "set",
> + image_type_id);
> + goto out;
> + }
> +
> + log_debug("%s the accepted bit for Image %pUs\n",
> + fw_accept_os ? "Cleared" : "Set",
> + image_type_id);
I don't think we need more ifdefery here. Just slightly tweak the %s
prints in case PSA is enabled.
Something like
log_debug("%s %s the accepted bit for image %pUs\n",
IS_ENABLED(CONFIG_FWU_ARM_PSA) ? "PSA will" : "", fw_accept_os ?
"Cleared" : "Set", etc etc
> + }
> }
>
> }
> diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c
> index 7f085a0211f..46b6f9356a7 100644
> --- a/lib/fwu_updates/fwu.c
> +++ b/lib/fwu_updates/fwu.c
> @@ -1,6 +1,11 @@
> // SPDX-License-Identifier: GPL-2.0-or-later
> /*
> * Copyright (c) 2022, Linaro Limited
> + *
> + * Copyright 2025 Arm Limited and/or its affiliates <open-source-office at arm.com>
> + *
> + * Author:
> + * Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
> */
I've pinged Tom about the copyright updates, I don't think this is
such a big change that justifies it
>
> #include <dm.h>
> @@ -586,6 +591,14 @@ out:
> */
> int fwu_accept_image(efi_guid_t *img_type_id, u32 bank)
> {
> + /*
> + * In case of Arm PSA accepting images is either
[...]
Thanks
/Ilias
More information about the U-Boot
mailing list