From patchwork Thu Jun 15 06:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 693001 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp375196wru; Wed, 14 Jun 2023 23:57:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qR7ZeuxJbzCcEpo6aKYgnCkDHo+BQQGUIdmw4ipxNNECKt3A4JDng9UPNMv/S1HMNWx1u X-Received: by 2002:a17:902:b214:b0:1b0:6480:1788 with SMTP id t20-20020a170902b21400b001b064801788mr12585071plr.61.1686812272580; Wed, 14 Jun 2023 23:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686812272; cv=none; d=google.com; s=arc-20160816; b=fU/z4F8BDE4D+VyVhbZutCiS2uDzV+OWGHoq/MaX+NTT8Tcp7yPZ73QNytRFHFaA+q a8pyVl+7gjLVltwmHxSmt0DUnJllFmF+ItcmFAkpq7WiNW1eh7T0M2jQM4ZMdSPXQ+dm mixYJq6or2g6uEEy7C8FEqIF8JJn9U8WXtFZIUMFGFtHOR4FnqsGxM962mxxRS6Vjp2q /JBtS3gria2Lrf9IgUXUj4UWBj07ywTXlVFv7p9hx06ZbOuRRkn/pl+jISsG2WOvs8ZC 0dPtWskwzEJTizAiuDFhtKCTWyzeshgMGfJ+WfosTJZSHETaXnV5orywmcbkqQc+oy4E tfFA== 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=DSfkMY5H7sSI4bzRshsxDlraPM7DGCFbiDNm+0RqXLQ=; b=xeNTMHurKvspcxKw3v5ggC//wLWblR5imuLvXi/jJvBrce6vnbrOT7jGE2ntZfZIqK eO/AOILvy/N65Xwmu57ZJoTdS+72UJB9imFPV4tJJXGBk1mThbmtBSqLW5kHW2lspC8X UDuriDSfaKEIUtGNt9InwKA/7cCRYCNpFZAoHhQV1r5IKDI24g8Lri2uHbS0ppeiVyn0 rxmKYxrcr5x9UMHdjXf9ZfOfg491InR4ZFTSSIScBQ0mxWeNJTZgQwj3RIg09krlz8Ea UYtrxBNdpZ0JAHf5JlBpFWQg91vEbqAnBZ4jt+WuVTBeSR5ywHVmFpzlvxZGzUpvQKxW GSwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fuluVc55; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id s6-20020a170902ea0600b001ab29e16b3asi8135577plg.286.2023.06.14.23.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 23:57:52 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fuluVc55; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 DE22186201; Thu, 15 Jun 2023 08:57:45 +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="fuluVc55"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB1A28622D; Thu, 15 Jun 2023 08:57:43 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 45C0280B98 for ; Thu, 15 Jun 2023 08:57: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=ilias.apalodimas@linaro.org Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f62cf9755eso9846345e87.1 for ; Wed, 14 Jun 2023 23:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686812260; x=1689404260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DSfkMY5H7sSI4bzRshsxDlraPM7DGCFbiDNm+0RqXLQ=; b=fuluVc55Yaqq48Md+6Qlvvf2h3BDkYuPFtuW3EwoE73Pz0faLAIk1mo3ZHKK09fmsQ c3VTCWosebE0nfB18b8wlcXZNk0Xt0bxYNTOG4X0FaTcIZm3abdXYwD72P95wcF6RGBw 1VB34UIskW2u33Ji+8kRsiTEXgEgmMb+hZb0c9oRTWAk3zTZlzhUKEbfnDcMdWoqfYGo rHHQ7MnbXWzP/nuMQg7RW2VC1NbWY5JlfK0NyaHznZZNZhPXWgwRHfG1Ni9B9D8sm/pF 4P+qzxwAfchpnBxEOG9u5Y25VqX/xBuNHrxbIZe0KBYC53E2fbktZWBxCf3AUBQmpJ9S O8hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686812260; x=1689404260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DSfkMY5H7sSI4bzRshsxDlraPM7DGCFbiDNm+0RqXLQ=; b=VIuLylLwTiCPkBntdKSQ9qn4eFjht6DPxdCQMxN1M/qQi0xm5/3eQlbmaqTW7srf4y KH0NREzHoa9zgnXSJs8U6Ax05PlZX+D+5zJ/FYCqybpPCZf1vy70Wc2p5CTitni2g+tG YHcVyUUDYJpa0kIHuQqmY7SUU3YHaQcW2ICY1KBGxBzWJmFb01nTYxRq5KbQLyIYvpvU //wX0aq0ZlLZqV7J3QTUbz6pUHS+9yI2emMBmAQDeI1Ga+W6PFmUgO+MXun5k9+yFvV6 J8yU5o1K0vvwe5F3l3iepV9PDcQucPGeQiuDoBeXJ30KucieYkbp5+wk5E+vMC3Zbf7u mlXw== X-Gm-Message-State: AC+VfDwZcNSqyxCCPirQrFMckPt0Ci+fLlxi2w2VL2s+B0eWw7/ak3Pt u15qKt28Zuu9+LG2rQlmrf6fBgQ8EALAjQgHU8TgXw== X-Received: by 2002:a05:6512:457:b0:4f3:a91c:23d0 with SMTP id y23-20020a056512045700b004f3a91c23d0mr10094018lfk.31.1686812260483; Wed, 14 Jun 2023 23:57:40 -0700 (PDT) Received: from localhost.localdomain (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id r15-20020adfda4f000000b002fe96f0b3acsm20172607wrl.63.2023.06.14.23.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 23:57:40 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH 1/2] efi_loader: use efi_install_multiple_protocol_interfaces() Date: Thu, 15 Jun 2023 09:57:36 +0300 Message-Id: <20230615065737.323329-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean The tcg protocol currently adds and removes protocols with efi_(add/remove)_protocol(). Although this works fine protocol interfaces should be installed using the EFI API functions instead of the internal API ones Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_tcg2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index a83ae7a46cf3..49f8a5e77cbf 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -1680,8 +1680,8 @@ void tcg2_uninit(void) if (!is_tcg2_protocol_installed()) return; - ret = efi_remove_protocol(efi_root, &efi_guid_tcg2_protocol, - (void *)&efi_tcg2_protocol); + ret = efi_uninstall_multiple_protocol_interfaces(efi_root, &efi_guid_tcg2_protocol, + &efi_tcg2_protocol, NULL); if (ret != EFI_SUCCESS) log_err("Failed to remove EFI TCG2 protocol\n"); } @@ -2507,8 +2507,8 @@ efi_status_t efi_tcg2_register(void) goto fail; } - ret = efi_add_protocol(efi_root, &efi_guid_tcg2_protocol, - (void *)&efi_tcg2_protocol); + ret = efi_install_multiple_protocol_interfaces(&efi_root, &efi_guid_tcg2_protocol, + &efi_tcg2_protocol, NULL); if (ret != EFI_SUCCESS) { tcg2_uninit(); goto fail;