Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp238089rdg; Thu, 12 Oct 2023 04:28:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0Zu7L17PCXlmf/F0UfWHPQ4mczkK1qoAB1prOalUjIaCqQnsQJcb6spQWMhYZc/UmbHyn X-Received: by 2002:a17:903:2646:b0:1c9:e48c:727a with SMTP id je6-20020a170903264600b001c9e48c727amr666054plb.14.1697110132176; Thu, 12 Oct 2023 04:28:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697110132; cv=pass; d=google.com; s=arc-20160816; b=Of7ONpv4G9hyh2QpXFpDqTJVbNb/tqBZwbZwKFkHQsz3FCI8f0S7DYZYYKGLMQAYTl aUduZ8wmtMVjzeOg5bLl+q3aVRWOGzX9cf3fZn45OU2Nh+8ngUNNmrEdqJ3xviWjKB3R YKkmVkxtXZcoQNnKGR2tNscJ5u7MrbKqHwbBcITEtHnNI+ih4Sk7UtV0irbxbiUPMoJ0 Jct99a8IZePpyq4vI+cI9Jq5fby276asVEbP+4RifolZ+Dri+i9oeqcVoMvWUUmQWT/O I4eEQgcsBEfNkQdT+gJcqcqXFaKeKWVoZz3pscMLXkQchth5pvM6hL4fXW6KjJLkRl8j 2+Kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=kzOqzBByf/kQG0tvNeZsa1J2p31LBFhWcuXiHyMqNQs=; fh=ZlntKKftin838qA8by4xxA0ODSE85a8AqrkwdPax7WM=; b=NWLub7Kqfrv7ekO6nviF0/GHllT8y0V0M05zK5XpQ+GVDwecbWiHUZo5jQpux5sbfk 9lJMDFDwbn2W1PJ9wEzzJ7HozgZgRR+C8/XtHwQdNQrizT2IxTfK0JF7MbDaVo/2crdw Qv5CUfcbAHBh0kQRGCYa2NjD1fRX87rspXL3IJ07+hIcBcnNdfdRLPv+pGzKAMOg217G H7YtNaklYt00dhGNm5xTq8+lc3gux54bp/xf6Mnp/4CgcrJieCq+ZzsPr/FhOOs/Hugb xQZN477vOU40cnIG5+hL03PrwAPmO804z8XBtntolmQUPW6i/dkA/kBe+5nN2rLDIKes my5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=SXcbZC1F; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k2-20020a170902c40200b001c59b6ed118si2149435plk.157.2023.10.12.04.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:28:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=SXcbZC1F; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2AEB280DCA4F; Thu, 12 Oct 2023 04:28:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378262AbjJLL2n (ORCPT + 99 others); Thu, 12 Oct 2023 07:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343649AbjJLL2l (ORCPT ); Thu, 12 Oct 2023 07:28:41 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D398691; Thu, 12 Oct 2023 04:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXp1BvKic0CCnVngJyWQEat5aCvaave5t4N2oiOT4og21LguGEPGK9mfFHMUkI4TWeid7eiJmCIdm59LFKGEAGNqExJitMbpMHNPuYn9L5LEYxmhmOygpOkOzaEhbIHFzu1tb61+cBihA0oWTJoU4jdXeZwvNbQ72SeXY7QgQdwBT+RR2MDyIFt2kSti4FAnMjqf1YNQ+/sNPi5T2cyadx3DlJ6mWU3WutOrM+CetHtbLnindezMNQ5Nb6ALBw7jnWlkW/NptgpDInVswuLMxlGq3EYF2BmDEmA0qSfwnOI6wGIecLMxQfzMQGvhhSMBfwPrG6c7QjIN6wSTlmWH6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kzOqzBByf/kQG0tvNeZsa1J2p31LBFhWcuXiHyMqNQs=; b=X5Kp6dcsyy/q9p1Z9PUPAHg4gfKcP1Ih7Jict8gSN45wXMaMd4KoJP8tDR8XFTrVDPJdg06e0jS1bdfMW2FelhDFBvj1TYJbo7VdSnQ3dRKJSjhJV65Z7mP2vgbwlg9uZcjT5SJWK2w1AtU+Jy4enwjDJgL8VeltSamxevHkl3dLA+o9qG2nSGN0KlAA29Rc/Jr72++qYnHpV7uCGS2c/xoIMwUojsKYr3aM8e9TQ35SDp0OFWxtOrAlsCEg9vh1F//x0s2q1D961nkaKzW952gFBBIsdI36BCcOuAp6Wy0JqVMX2bL0ab1yA3GmWo78gCrOm2zm1Fljid9u71oKpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kzOqzBByf/kQG0tvNeZsa1J2p31LBFhWcuXiHyMqNQs=; b=SXcbZC1F8si8gXG97zD41EmMPBQeKqeM4dtdMLs7PMso2I+38oDph7tVKmBFmLTbSKo9TQAlUn8TFKpN6Z5R6xJqVa76ktkrqldKrqDPQmWdp9uWXpVyaxAYRS8Oosp/nOjeBC30oHkZu682xDzOGIMaZEdTP0Ybj/HtN77x42vhY0ipl2UwNO6ZPrVbB8Pu92h4fkLboo9vK1315PVI1QPkb86Je0upV0dFUkuiXHtUbPGfYmnPK+Kg1F10peo0ReziNygNuuIKsTryybjg/ONGTH8VCnE0Nwj0CCI/MsWMtX+IXsJxvGAPXyKM8/aGakIMDpgvmpIRuBZEGaLrtw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from PA4PR04MB7790.eurprd04.prod.outlook.com (2603:10a6:102:cc::8) by PR3PR04MB7435.eurprd04.prod.outlook.com (2603:10a6:102:88::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 11:28:36 +0000 Received: from PA4PR04MB7790.eurprd04.prod.outlook.com ([fe80::edd3:f00:3088:6e61]) by PA4PR04MB7790.eurprd04.prod.outlook.com ([fe80::edd3:f00:3088:6e61%4]) with mapi id 15.20.6863.043; Thu, 12 Oct 2023 11:28:36 +0000 Message-ID: <9346655c-df15-498b-a6e3-f6dd918c663a@suse.com> Date: Thu, 12 Oct 2023 14:28:31 +0300 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86/efistub: Don't try to print after ExitBootService() Content-Language: en-US To: ardb@kernel.org Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, "kirill.shutemov@linux.intel.com" References: <20231011192528.262425-1-nik.borisov@suse.com> <20231012101456.goamenepqlte65jv@box.shutemov.name> From: Nikolay Borisov In-Reply-To: <20231012101456.goamenepqlte65jv@box.shutemov.name> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: VI1PR0102CA0086.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::27) To PA4PR04MB7790.eurprd04.prod.outlook.com (2603:10a6:102:cc::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB7790:EE_|PR3PR04MB7435:EE_ X-MS-Office365-Filtering-Correlation-Id: 284845a1-c1d0-4491-36e5-08dbcb165f7e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9jgHTVgMKzK+hGYGH263AWlUWvQQhpoaCDRex9rQ523F5npUDUvLAvMHIp8ArQBf4Ar95j62it0MXG2HNa3+IECcqoiJ7KCJKAKWMhvLs123R6YJboyxiC/mtdAB90IxMyb2SSGhsCC7pwJuf+E7HfvCtilw0jDTh8+z4QoxAONUhRXUrEZNI++t0jXuvdPRos2adbqGaGJ6aO5ysZNnmuqT6Z+NUDuy3SMdnyenI7HQFkxKomAGbf/IwQY7AleEEi2QDg8CsT+be4Z8bUwyI3luU5rxOSwDuPdO9+HOJA02E/n8QJojak6k003YtLLc2GLvwBY7Au2xldsZtNaVmYSUXZ3GNGctzBnFB/o94DYU+nUiMQszR6Hqcwbi5t2Glk+3E6vFMYjDhI/nW3qV5N569sU4aJCjsjc30pnMDBBpCKn9Ldcjjf+6iaD/jp5nvjg3j5Kp/S8Fajv3Sk5y/+WIvOS4PXsiwXycHAcSw5YFaum43lx1Q4zSS7lSXX61zHlMrCBidI93sr0Ip29Fesw4U/PexBXBFrw/0jZbmfeObwpNku1F69mxb7rY/2/Z722KQ/XLpJu2NBrILBwQwosjNXm5EDnOAJ4Fc5EJjUYv7AcHyL95zsFzx/+PamPP5WW+9PmOPuAQif1euN5jEw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR04MB7790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(396003)(376002)(39860400002)(136003)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(2616005)(6666004)(6512007)(6506007)(86362001)(36756003)(31696002)(38100700002)(83380400001)(66556008)(66476007)(66946007)(316002)(41300700001)(6916009)(2906002)(8936002)(5660300002)(8676002)(4326008)(6486002)(31686004)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NHRRaVk0TEpxbFM0eGZpY2lSbGRZRUl2UkVqa3Z6d1FMOUpCNlZsckxybURW?= =?utf-8?B?VTk4S3k2clhQR09PTk1TVzlhc3V3UXZYZkd0UlFpU0N4SWgyVHVOWnBoNHBB?= =?utf-8?B?ZktVWlBETXBmSCtIYUVSZGg4dXpOQ1d2cDRUUjYxdXNOdmRVSkNod0p1ZFkx?= =?utf-8?B?UHpyMHJwVUczMGdYYSszQmJlYWVZVlFZbVJranFQd1pNN0g2cWN1VmRWdkFE?= =?utf-8?B?M2xrZlRUSElCK2FEaUk4amw5OWZLSlJ0SkMrMWZRT0hqUnR5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OTBLRVl2azhhelJLazFaR2Fob2hDeGVoQnBXZ2hDMTNz?= =?utf-8?B?UGpML3EvSjJOb1F0TGdhekhPdjNRNmxkRHpvL0FwQmlWT2NrYjFma0NuU25D?= =?utf-8?Q?ANjhfnpQbR/YrU2YhhuA3AiBqoRJR7wLhvpj6RqTiFqT?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 284845a1-c1d0-4491-36e5-08dbcb165f7e X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB7790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 11:28:36.5305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lDU2NC+g8A69WRv8COBniWPS0Y2jQjdpKlltl9aN8nEW1Uoz79v94O8wEniaTsSDxOZeAW1iN+2bFAgfd92+RA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7435 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:28:49 -0700 (PDT) On 12.10.23 г. 13:14 ч., kirill.shutemov@linux.intel.com wrote: > On Wed, Oct 11, 2023 at 10:25:28PM +0300, Nikolay Borisov wrote: >> setup_e820() is executed after UEFI's ExitBootService has been called. >> This causes the firmware to throw an exception because Console IO >> protocol handler is supposed to work only during boot service >> environment. As per UEFI 2.9, section 12.1: >> >> "This protocol isused to handle input and output of text-based >> information intended for the system user during the operation of code >> in the boot services environment." >> >> Running a TDX guest with TDVF with unaccepted memory disabled results in >> the following output: > > Oh. My bad. > > But there's other codepath that does the same. If setup_e820() fails with > EFI_BUFFER_TOO_SMALL, efi_stub_entry() would try to print "exit_boot() > failed\n". > > I wouldner if it is feasible to hook up earlyprintk console into > efi_printk() machinery for after ExitBootService() case? Silent boot > failure is not the best UX. > So looking at the code the only thing which would prevent refactoring to exit logic to directly call exit_boot_func etc and setup_e820 before calling efi_exit_boot_services is if the memory map changes. The current code ensures that we really have the latest memory map version and so setup_e820 is called with the latest version. Ard, how likely it is that the memory map can indeed change between the calls to getmemorymap and exitbootservice?