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=-15.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 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 6C95DC2B9F4 for ; Sat, 19 Jun 2021 04:23:46 +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 E06156135A for ; Sat, 19 Jun 2021 04:23:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E06156135A 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 D762282B20; Sat, 19 Jun 2021 06:23:41 +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="ys4tfOqt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54A5B82BB3; Sat, 19 Jun 2021 06:23:40 +0200 (CEST) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 69FDB82AE4 for ; Sat, 19 Jun 2021 06:23:36 +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=masami.hiramatsu@linaro.org Received: by mail-io1-xd2a.google.com with SMTP id b14so9273140iow.13 for ; Fri, 18 Jun 2021 21:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=f1aNnCdzaKU+E/3B8gOK2oSW+ABqRNtADRzIfu7J7h8=; b=ys4tfOqtFGdAxXeB5SIDgf/1CJXfv1AI6m7/gLZKMHr+4h8wGKF9bcmHEKYeSOq7bX gFOKrxOa3helV75xR/RKF+j33lDtpf8f2uLdZx7mjgWeR2A3iZKolUEMNeeneWKtRGeE 0FYzrppmnEWVUjUub//7hnwdJ5Myd7U2xVJKBLOgeQHw17QEsVRV5vbYDJfRU6cF71+f f+9cX4JuDIXpPXvnkkCgp2OimuHMg/kjg4t0QGCknPqJg78UZt/5nyv9+yzeeOyZ86IP idUir+zOtTePJNE6RB09I9gw7bP9RnkdEhY+7PBhYE0PLFkmOdx4y6y4Md4yDB4w4TzT 4v1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=f1aNnCdzaKU+E/3B8gOK2oSW+ABqRNtADRzIfu7J7h8=; b=LfyIIpKY0YCtImTjTQxBzWiNZBw6LU6HAqTHvTmZ1i1/r2+OxtMkHo2i66jwQ8KBj6 sZTvQA/yPjHFVCntwgnITII4JueMCjsFdSmRio0g4KwS6vPPm/SkmutAS0MMM5ZMCEei 0JnJx/6d8aVLYC7QkBZ2m3o1YU2XBVx2XFyIPXTGOBMe118KMgz4J+yfk+uPNjuOxVTC 7BDaG1+kJtmdE/Rco7U0/xQXgbHJpK0gk6T4l5t/RurehpxOLs9dx6Kh4S+TlF9Xq8+G z3QjdE0S6eLRYR7e2BiwHa6B+Jd6xwF+bxlPYhFZbXkQggjYIDBUZIvDEqTvFGWYYPSM vY7w== X-Gm-Message-State: AOAM530zO5gK0ELHgrE5L4aFR9P0+DYaHMxuqeKV9T8kb2ccfv11r2wY Gfv3zqKQdsTQxkOmaJIWqKc/e94uyfmUkmCaErUbVQ== X-Google-Smtp-Source: ABdhPJwd7cEOgOlPq31mdi/NeVmmPPnSV9kIucsg6wrJZnMyzbTEoQIiqH2RGHn9yy1aGsnK8X6rtD4vHtEo1+s9b5s= X-Received: by 2002:a02:3b26:: with SMTP id c38mr3216556jaa.12.1624076615009; Fri, 18 Jun 2021 21:23:35 -0700 (PDT) MIME-Version: 1.0 References: <20210618105115.257938-1-ilias.apalodimas@linaro.org> In-Reply-To: From: Masami Hiramatsu Date: Sat, 19 Jun 2021 13:23:24 +0900 Message-ID: Subject: Re: [PATCH 1/3 v2] efi: Fix to use null handle to create new handle for efi_fmp_raw To: Heinrich Schuchardt Cc: Ilias Apalodimas , Takahiro Akashi , Michal Simek , Alexander Graf , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi, 2021=E5=B9=B46=E6=9C=8819=E6=97=A5(=E5=9C=9F) 4:22 Heinrich Schuchardt : > > Am 18. Juni 2021 12:51:12 MESZ schrieb Ilias Apalodimas : > >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. > > instead Oops, it's my typo. > > Is the problem that two protocols with the same GUID are installed on the= same handle? Actually, the returned handle is ignored in both cases. That "handle" is the local variable, and the handle is set to NULL before installing FMP in both cases. > > > > > >=3D> 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=3D1 > > > >To fix this issue, pass the handle variable as same as the efi_fmp_fit > >installation. > > > You can not install twice protocols with the same GUID one one handle > What do you mean by same variable? Ah, yes. The description might not be correct. The handle is initialized right before installing a new protocol with the same GUID (previous one is discarded at that point). > > > > >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' > > I can't see ''depends on" in this patch. Aha, I think that comment is for the 2nd patch in the series. Thank you, > > Best regards > > Heinrich > > > >- 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 =3D NULL; > > ret =3D EFI_CALL(efi_install_multiple_protocol_interfaces= ( > >- &efi_root, > >+ &handle, > > &efi_guid_firmware_management_protocol, > > &efi_fmp_raw, NULL)); > > } > --=20 Masami Hiramatsu