From patchwork Fri Jun 18 10:51:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 463038 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1348510jae; Fri, 18 Jun 2021 03:51:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyToUsDjSIRhtdiVHjbXrYhp9u7LCIg8ybUoO69FE2fibdFgrEiPGbhcObYfwHAzOAIf1T4 X-Received: by 2002:a17:907:a95:: with SMTP id by21mr10644490ejc.514.1624013488007; Fri, 18 Jun 2021 03:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624013488; cv=none; d=google.com; s=arc-20160816; b=C15IfpH1QIUS63fmgDHiWsT/EBMjCuRaNX1wiDgje3S66YmEEOvVS5hZv+uaQnE64c +pZurabZBQikRCHsOtdUNcK+j4lNJ1oIXtUjGFDhwHdhD9t8YvRGobb9+80ZKcVvIez8 zW8yIw4MpCj0Nh5c7Y8T4tRmLVJhqFxlslw4S5BhNz0720AezhpcAADe3ZUDIAkOdLhW CsaCjii2SivnUiHu2VQk+dCTbGXsQkgoapj8lkFp2EhTAkyJt8lNYsaazPsF5UrcR7YZ 4ZezjIkQCoJqcVWhrPsVJxokprvBWPwdSJoPtpMoZ6aN4QCz6p4ILRX7tdl4QTS8zChH EJ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=lYKkw/lKpjkWBOfHbDI3okXrGfg7APnrxtVVamH3fz0=; b=Gl4J2nyWuSIkQ3gPpz5jQd4mpcQMiEH0QJmDEpjrZLhafshQscHjQSfEbjP4h3bOgh oS1p52nZouVTO4/8sF1g14XdOvh3HWjGqxk7qgiBxlDEMqCOjNixlxrkWg31UPKCWhWj DLhOw7BijqMF16f6C0tMrjX7oA6JUEkoB1VASUGocALyD18AKf7RKPJSqMTZVeNTNE0q wX453daG5Zp1Ynbh1PziafwZ0iOg2jRufSnNu57jBqefhbkGRdutW6RjD0jjn40MT49d x5xngLtxQwrrVG1s/woqRJ/WTtZR81wvQVOX64DfJdz9Awq11bRTxd3Y4q/uWLI4sv/A pYfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cFwBsa9Z; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id m19si2108953edd.117.2021.06.18.03.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cFwBsa9Z; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 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-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 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(-) -- 2.32.0.rc0 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)); }