Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp201810rdg; Thu, 12 Oct 2023 03:15:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhCIkUxKPHnQogmYDxOvqbllCU9YXuR+QIoiEjKkSFAJHzPiDBjsNUVumSSfXGiu3s7Dmr X-Received: by 2002:a17:902:a402:b0:1c7:7e00:809e with SMTP id p2-20020a170902a40200b001c77e00809emr20305779plq.67.1697105711497; Thu, 12 Oct 2023 03:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697105711; cv=none; d=google.com; s=arc-20160816; b=xj5MUAwsDJ5xU6dl2voawWauCOJjKGEHAz5qgkS9UtV22NM26CdpvMpuKITpSEl1eJ i5YXvscqCfF3m7bpJbe64Hc6GmNqNjRY3t9jQSdNQ6HtGqhSpNJtFOrvEbj4NIZOhiqP 0EfQcv/VTYYIhEFycKXPphhgstcaJjTLJph/j71Dza/03KOIOo7fJ9XE6EFge8I7Pqdk Hwod3tNMq3vKZnszgvpZ0dZVgCwW55/8c74/N6dnM+PrlQuqZMvYc97xtiOEyQpyJlh0 GiY5lqYxRG9vGPStHC2m6NYkd8eaBW0kL3lS9lxHwn38WBoQ/ikkEE4uLVeIBIGcFZ1U ckIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s9961GPotfXxyT25RkS6VFPHFtG4QHnLw5BH5pyNSkM=; fh=XBhBNqXahCQYrClVKLVoP+N4FTQFAxGzI62uT9iiwwI=; b=NDWt4mmWJY+uHGmPYnVuDVPxnnmfORJBApiuh7e1rW7z+FgPe17YHrPqpdCupjblak J3c3XEZq98wLxeEB+OAESEXlRiHM2xk9wLYuV8O/p2JaLKV76TCnjasYZJh36nozOd/q 3I13CIRfxArqbHFGMjrlkdGwXl0Mefss6axb7VB+FwKbGSCwWsY377iWrIIgmDRUUK8L m6SJoUHsE00cUwscoVU4hsvSSiIWXlgXvZDbg//ckHATBYWTpBzGahRKW8KZmFlflo97 1vBV61UPVb07OzggqRgk/jPIJ7OdgFshJ+YrBPYBkGUNfgKrGvy8NIom99UIWbkh94Gg PDSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=llBmfMiw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w7-20020a170902d70700b001c45291b6ebsi795673ply.272.2023.10.12.03.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 03:15:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=llBmfMiw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9ECA68061158; Thu, 12 Oct 2023 03:15:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343688AbjJLKPG (ORCPT + 99 others); Thu, 12 Oct 2023 06:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234179AbjJLKPD (ORCPT ); Thu, 12 Oct 2023 06:15:03 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A372D9D; Thu, 12 Oct 2023 03:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697105701; x=1728641701; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=dYC9BvIZGZ9sEAjxJUBPvKlJQCnqSQLaN/33GRubX9w=; b=llBmfMiwz7U6zf/cjNLj2N8EMxkOhthz5X31ICzD/Y/jli7yH/KVeefN wSZfTSdgsBq+cK7SKcq6FhRDBuUE73fvo9swc0wUGwLfLVgW8RUcsibkG jstnTScc8CxlnN+J/uAmaSNYXakceWo+7yw0VNfn+iUiODpWLg3jwu1+3 UU9j50tWWMw4RLv91DoYTDzZec3S97Gr905qqPUaov3APW6FYD4iiNtMQ IZVG3be70MrOehNf8BRQpoxSgPj0wlwdZwJmCPSEt1X2nuV6moZuPeuDc GTLZlwGxtB+DxJ5/nrBHp+iu2RnKUG2eC7KCnZRDlsnPdVOo/Zcq+lMct A==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="383747368" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="383747368" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 03:15:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="878059340" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="878059340" Received: from nmalinin-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.58.130]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 03:14:59 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id B666810A1B1; Thu, 12 Oct 2023 13:14:56 +0300 (+03) Date: Thu, 12 Oct 2023 13:14:56 +0300 From: kirill.shutemov@linux.intel.com To: Nikolay Borisov Cc: ardb@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/efistub: Don't try to print after ExitBootService() Message-ID: <20231012101456.goamenepqlte65jv@box.shutemov.name> References: <20231011192528.262425-1-nik.borisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231011192528.262425-1-nik.borisov@suse.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 03:15:10 -0700 (PDT) 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. -- Kiryl Shutsemau / Kirill A. Shutemov