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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B11C1C27C76 for ; Sat, 28 Jan 2023 08:58:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EBB6C852A0; Sat, 28 Jan 2023 09:58:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="b3BqAgHb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9048B85718; Sat, 28 Jan 2023 09:57:59 +0100 (CET) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DFA948514E for ; Sat, 28 Jan 2023 09:57:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-088-152-145-137.um26.pools.vodafone-ip.de [88.152.145.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 0E05A3F303; Sat, 28 Jan 2023 08:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1674896276; bh=IDxXdNo2TWy2Q+jvIRaK/4rXGdp3rSrB7HXBUI2GwTE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=b3BqAgHb1YV/K6/ELwv1noT4R2YMOI/T0B0Px+J2JX8ELuAM5T6WLYfjnE+1wrLtO //ssPDxz1xNHd7gtRliaaZknp2Rr4DhuriJgpUW+W5oPUFOmKoN38GNEw3Mzcu5PFO LRbseCBdaUMuuzWjjjl7V196XmNDZREs6Lg8A+znT6WLhbEMknv1nfszbBR56hePvJ MYq1sqd7Z0uynk+pTwAthaQMn+54qnc1zDVZSq+/NJAYNDnFD1Sil3IbTTX46KGsUB PCeyYkyDY/sgWh+wmCMKTMCZmK93YxeV1MCv4kioB+e25oQOfwV7jQH1QZ30Qk8ypk gBxZ8prZdK64Q== From: Heinrich Schuchardt To: Ilias Apalodimas Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Andre Przywara Subject: [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices() Date: Sat, 28 Jan 2023 09:57:45 +0100 Message-Id: <20230128085745.18389-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean The UEFI specification requires for ExitBootServices() that "the boot services watchdog timer is disabled". We already disable the software watchdog. We should additionally disable the hardware watchdogs. Reported-by: Andre Przywara Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_boottime.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index ba28989f36..71215af9d2 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -2171,6 +2172,11 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, list_del(&evt->link); } + /* Disable watchdogs */ + efi_set_watchdog(0); + if IS_ENABLED(CONFIG_WDT) + wdt_stop_all(); + if (!efi_st_keep_devices) { bootm_disable_interrupts(); if (IS_ENABLED(CONFIG_USB_DEVICE)) @@ -2196,10 +2202,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, /* Recalculate CRC32 */ efi_update_table_header_crc32(&systab.hdr); - - /* Give the payload some time to boot */ - efi_set_watchdog(0); - schedule(); out: if (IS_ENABLED(CONFIG_EFI_TCG2_PROTOCOL)) { if (ret != EFI_SUCCESS) -- 2.38.1