Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422860rdh; Sun, 29 Oct 2023 15:58:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEONUYGWEYNpiXR4wxknClW0dvIfpqOcWy8i934sqaHGGKst3PAj59t4tIOFe5Z+CNt8y+m X-Received: by 2002:a17:903:1cd:b0:1c9:cad9:e6e3 with SMTP id e13-20020a17090301cd00b001c9cad9e6e3mr14200247plh.32.1698620307718; Sun, 29 Oct 2023 15:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620307; cv=none; d=google.com; s=arc-20160816; b=fgUhbfPC3ZZUbM/Gi84T/5EElTIdgq+dAiCc2+Y9S39z7AK9aFNR3c96n9wiymD0jG 74zLRI+NFYW2nSbifUYLEoxXQAv8NeMXTXng5SjN7Me0scvABTgcmmJmvm8ScMdpzBYM utEe5UPNIF3Uy+yM3Ce9Injtluj5lXPmDgXmQ7ze5SGqgaufzDBpxd7Xxkr4iEScpIHk rNKjXtiuG4SKlMPfEUJs2Po5aRGsgXI4mFDijv4kk8VExSpfrvusPXv9Rrb2ap5m+jtL InQ8+FMlQIcqLaeB3BsMtkcV7rGgRgh7Ojsye86/Eefzq9ZGtPI7Q7XwE8ArFg7ufEgP i3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H99ATMS2n4Pki+orP5fK69w52v0cFiP58Pz4K0Xwz5A=; fh=dTNsLmJ/co8ScO/9zXLofllbiLvRXGDchHEUCFiXfLQ=; b=SRaXT60DpkhYxTCattGn2dKHeM8yMUAOlbJhcNteATLkiXtovHIxMZHqPQil7NuIu3 hl++8zdbfJRBxPUfEXe3k6YwbWnmC52ovLs3eMJnVI5S+iDmpW7Ot0fDi4KR1w27T2EH Z0HFbjtrG2mrfIydbUvcvjReov18uTp9ZNGXG2b38pbZiGlH9PAtiuQVVicd163U1/FN Ac4uefW2HWfiPfTKxjUgc5C4ad9L0ZOjNk/8cI5LBOphZ98kkM19Y1voVLOV0HA+v4LC 7YnAbp6yoQ/o/P8heQQxwXxDiLcL/GwFy2TIajxdZUN/kFZggyf+qMAEkwb3grI+Im7b X/FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ulydMYDt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q16-20020a170902dad000b001c62cfff798si4396474plx.372.2023.10.29.15.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:58:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ulydMYDt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EA7C9805C3C9; Sun, 29 Oct 2023 15:58:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbjJ2W6R (ORCPT + 99 others); Sun, 29 Oct 2023 18:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbjJ2W6K (ORCPT ); Sun, 29 Oct 2023 18:58:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E93981FD4; Sun, 29 Oct 2023 15:55:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41ACCC433CC; Sun, 29 Oct 2023 22:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620136; bh=wzcO2YZyhAPiGj+xh3G1vn+3GTn7JHd86F6iAmmOXGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ulydMYDtryU+Tn0q7bwoa1sVJx4azvOVeVDjrfwdKH88YiMqyhmxNeqDFEtoM/w3p 9dhCnSPvPXTdCkfausbUGt9ruj+P0lV4K7j9wpKJYf2wq2veno7UQRwEisJSsuSb0B 954ct7u+OSp2ssdD+kgYCJ4w0xWTE9HJQ0bJFNWJKX9XLKkKZX8xOHBXmVEcjV/qC+ kDfnRcZBQdtBvEywie0ZwngaOQF02+A8z5RjKtLEuHbgPiAEzjsbbmsBX7b3cKjZ3Z +b+K+483Zg+oXGFEhPydgjx6DQXjmg9G1SDqeBm4VWXKUucUlTFCBDZOI+xQ5tgMbI mEfFTfxMTGYQA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nikolay Borisov , Ard Biesheuvel , Sasha Levin , bp@alien8.de, kirill.shutemov@linux.intel.com, bp@suse.de, thomas.lendacky@amd.com, mikel@mikelr.com, dionnaglaze@google.com, linux-efi@vger.kernel.org Subject: [PATCH AUTOSEL 6.5 26/52] x86/efistub: Don't try to print after ExitBootService() Date: Sun, 29 Oct 2023 18:53:13 -0400 Message-ID: <20231029225441.789781-26-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:58:25 -0700 (PDT) From: Nikolay Borisov [ Upstream commit ff07186b4d774ac22a5345d30763045af4569416 ] setup_e820() is executed after UEFI's ExitBootService has been called. This causes the firmware to throw an exception because the Console IO protocol is supposed to work only during boot service environment. As per UEFI 2.9, section 12.1: "This protocol is used to handle input and output of text-based information intended for the system user during the operation of code in the boot services environment." So drop the diagnostic warning from this function. We might add back a warning that is issued later when initializing the kernel itself. Signed-off-by: Nikolay Borisov Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin --- drivers/firmware/efi/libstub/x86-stub.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 146477da2b98c..a5a856a7639e1 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -648,11 +648,8 @@ setup_e820(struct boot_params *params, struct setup_data *e820ext, u32 e820ext_s break; case EFI_UNACCEPTED_MEMORY: - if (!IS_ENABLED(CONFIG_UNACCEPTED_MEMORY)) { - efi_warn_once( -"The system has unaccepted memory, but kernel does not support it\nConsider enabling CONFIG_UNACCEPTED_MEMORY\n"); + if (!IS_ENABLED(CONFIG_UNACCEPTED_MEMORY)) continue; - } e820_type = E820_TYPE_RAM; process_unaccepted_memory(d->phys_addr, d->phys_addr + PAGE_SIZE * d->num_pages); -- 2.42.0