From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94A85C48BDF for ; Fri, 18 Jun 2021 10:51:27 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F02A61003 for ; Fri, 18 Jun 2021 10:51:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F02A61003 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 85BCD82B3D; Fri, 18 Jun 2021 12:51:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cFwBsa9Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90A3082B3D; Fri, 18 Jun 2021 12:51:22 +0200 (CEST) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 51A4382B00 for ; Fri, 18 Jun 2021 12:51:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x332.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso8391864wmi.3 for ; Fri, 18 Jun 2021 03:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lYKkw/lKpjkWBOfHbDI3okXrGfg7APnrxtVVamH3fz0=; b=cFwBsa9ZHAWkTjHCNGVvFyhJvMPl+No5OG8TNknCQMD41P8WAyNAkO1Roylj91i6bD SHNFZcRcXI9glC/mWiVjLLhHB5kWZlknSq1us7ZPCmJJRHO52DHZoNUR+iBBVEX+ZHzn mgQ4S5LasBlrnyiH7lY/hrKtk9nEO3x5jfEY3YSsCO666XLvaBUoldIgudQgveJ6ccwJ VJtwwSjSW2JsPVUOA8N5+rKVOPmtbIiiSJEHnNMq+16XbHeeIXbHYaAZW+/1pTgUGhNH x1HpSEB6LyZgNoty+J1K8DdO7CN8NDeRg4xaI+Xel587FG1MmtQ3aFeikzUHBRxey0Ui nlFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lYKkw/lKpjkWBOfHbDI3okXrGfg7APnrxtVVamH3fz0=; b=HhgLpjPokPG7O7FxnVg8GIBpufi4V/KrXzaC31zYuu27GAwdWunPOM18Z/5re8l9Yj jhTd3nGePKUfDAYEZjbTxJlW705l8RWiK0Iy63oPTz7a9Jp0aX+wrRM704aKt0ULcw9r 9PGXOeUSfc/tPeDuwByGuMnKKJVtum1XUCvYt08jPfbDaCDgNeyl0IL9EVoc7z7cSyVd LB/HOKZl85vRtuF/veGez3/9yoffP0yiSoa+ArqAna7QpwzNlfO7XauvNQySeZN/L0MV tEjuIZ5+ubjB67X3hrDfSj+FDdR4Jj5Vz4gXzYmpRDAnl+sXtixnblioddZwBzG0bKts GtBg== X-Gm-Message-State: AOAM533V+HOfKtfptuT0klXKMimWQNq+Lf3QtdxNE4YyZaisFzDR7Ily 1iPltkmmVJdQKxxo3jHoqtLJWQ== X-Google-Smtp-Source: ABdhPJxkPfAdP0BbK2VteNc++v2s7m+y20eAaC0mTAmsLqjAauFdUXXt9KpOuaCXmZ+BYY0qkTGjOA== X-Received: by 2002:a05:600c:5128:: with SMTP id o40mr10516158wms.43.1624013478855; Fri, 18 Jun 2021 03:51:18 -0700 (PDT) Received: from localhost.localdomain (athedsl-269684.home.otenet.gr. [85.73.101.18]) by smtp.gmail.com with ESMTPSA id o18sm11377758wmq.23.2021.06.18.03.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:18 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: masami.hiramatsu@linaro.org, takahiro.akashi@linaro.org, Ilias Apalodimas , Michal Simek , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH 1/3 v2] efi: Fix to use null handle to create new handle for efi_fmp_raw Date: Fri, 18 Jun 2021 13:51:12 +0300 Message-Id: <20210618105115.257938-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Masami Hiramatsu When running the efidebug capsule disk-update command, the efi_fmp_raw protocol installation is failed with 2 (EFI_INVALID_PARAMETER) as below. This is because the code passes efi_root instaed of handle. => efidebug capsule disk-update EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbaf5988, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8) EFI: new handle 00000000fbb37520 EFI: Exit: efi_install_protocol_interface: 0 EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 0 EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbfec648, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18) EFI: handle 00000000fbaf8520 EFI: Exit: efi_install_protocol_interface: 2 EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 2 EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) Command failed, result=1 To fix this issue, pass the handle variable as same as the efi_fmp_fit installation. Signed-off-by: Masami Hiramatsu Signed-off-by: Ilias Apalodimas --- v1 is at https://lists.denx.de/pipermail/u-boot/2021-June/452097.html changes since v1: - split patches - pick up Masami's patch fixing the efi_root issue - Don't use 'choice' on Kconfig sicne we need both of the FMPs installed for sandbox testing instead just make them mutually exclusive with 'depends on' - Only install the FMPs if CONFIG_EFI_HAVE_CAPSULE_SUPPORT is selected lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 9ead0d2c7816..71d3d1e523ce 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -939,7 +939,7 @@ efi_status_t __weak arch_efi_load_capsule_drivers(void) if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { handle = NULL; ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &efi_root, + &handle, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)); } -- 2.32.0.rc0