Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6479894rwl; Tue, 4 Apr 2023 13:29:35 -0700 (PDT) X-Google-Smtp-Source: AKy350ZAu8ItuBNeVw/oKULaoLHDUBmj+TpdWkWUYocsWQ5Y7YhwyxBQyv0ciwTISjZx1f9/Mggo X-Received: by 2002:a17:906:f198:b0:944:308f:b977 with SMTP id gs24-20020a170906f19800b00944308fb977mr301069ejb.16.1680640175553; Tue, 04 Apr 2023 13:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680640175; cv=none; d=google.com; s=arc-20160816; b=wEKcf3FTIgoxe95U+W1gZNaAmdguK4GeK8FXSD6rONhL1ZS0KiGZoktzSbkYUOVqjj TcFwZouyHeGk0FpgYRn+u1P+B0nEg+I5mJ/J4HuMFkD+FjqU5d8WWf9ar5gTQYAUf2fU EAQdpIlgh0XJ6svyHZmlnUgPcgrCxIN48/gNxRG28x5p6auJ40huOCakQqA8MKCpsdkn XsPbcrNfkefnciYyyqKC1zbI+mcgPcUCYgblA/cqiIIXRCTEQNVUjh0ojUohqST+V5cR i//ksDJA0ViTF+P1CGUEQjWqk1XBbJ8ZS3181wHPJKrSlKY3Xwb9sYsV5c8aGw+LuaKI rKoA== 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:feedback-id :dkim-signature:dkim-signature; bh=yAP5JQyaROv72dfxTuIX3EHF8NlvyOuNvEZn4uFoTG8=; b=qk/JQ81kh1hnRnqNhBB1DnkilVgFOwJIEVaYYw7kesvv85lBx78a362VXfk/q6eoJ3 nmqX4KvnY7grT2Mrr/CgwGR5V4LXEegpgN5mOR+DG8F3DICU3UMLKBeEQ1CBYw+JXoKB KvLfF8eTctX3AspUIshTt3B+OIz0lddr4Bdpx3A1ABWqnjBgaWysMO2uS7yYR4hfD87m vp0pTyx3UUmf3X68n8yr6r8KlJhyW6gJyj+G0jo9Fh4TsG49x2rUEN/SpRaSP/yb6Wuw CnY+qXqQlarXju2mzr8vlcFp44oAhE9MLPwYBub+w7HiLo2lt4TLGhN9VdvnKXoAjEPt mAtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm1 header.b="A6/TRdHM"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=dL43dxgR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a1709067e4a00b0093d8207777esi1656572ejr.858.2023.04.04.13.29.10; Tue, 04 Apr 2023 13:29:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm1 header.b="A6/TRdHM"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=dL43dxgR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236029AbjDDUZA (ORCPT + 99 others); Tue, 4 Apr 2023 16:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjDDUY6 (ORCPT ); Tue, 4 Apr 2023 16:24:58 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9036846BF for ; Tue, 4 Apr 2023 13:24:54 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 5B6783200952; Tue, 4 Apr 2023 16:24:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 04 Apr 2023 16:24:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1680639889; x= 1680726289; bh=yAP5JQyaROv72dfxTuIX3EHF8NlvyOuNvEZn4uFoTG8=; b=A 6/TRdHMk99ZtXR8iLfcdS9o3xIt4w6zMvl3VTdaRPoj/wEiJyjWp0POXIYShU1M3 L8pT5tDCO3yllfSDsv7HAIRokO0aJP66oHG3ny1SJjLOXzHk7uzEcMERsN9gvCkO N1WETvPfqg+nnkKLTbGE185PeBnFqWUxkPfDhf79flbdX9nRbNAINy0+LpNAiNWn JJfiKGJ7v06/OhnH0qTu1aS6D8xV1d6k4QrngAE3QYKOJUj4DEW7PK+gAkgqQs45 x4cSgdwQmRag5w+Me1Nh807IHUQgSBeAr6MW/Fh1n3EX+noXBimgl58wlsvffhKi N2c5A2FaWIKsb8xyYtPng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1680639889; x=1680726289; bh=yAP5JQyaROv72 dfxTuIX3EHF8NlvyOuNvEZn4uFoTG8=; b=dL43dxgRjcY/IrpJpkEs/eUTFyn+A syvWtGObNaz5sJZVeK9J9ep8QB9zBwdqfAY9B5rfMxVOXMRNoy/MVjFd8KojaXiD alI/kSsJzDiqPn103ae4OSFoB9NO8MWA89WNZTh5a008Qv+6j98FUU5dGjV/V1iu lvzpitTp/ErjnRaQ6D4OLyqqVWBcjd39JcURWjyu+8vfvAAwXIPnHMHywGlWYiDa NCvBSQFleAMxPtzIpynyA2b0WlDdmqMf62RUoFFkl9A3U6Ixqew5YE+jB+QZYR1j oJUnQ0EDnvg9Ynrq9WrxO8mfoUi51M3PRgDcXObthtam/hQhOjy0nPDfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeiledgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttddttddttddvnecuhfhrohhmpedfmfhi rhhilhhlucetrdcuufhhuhhtvghmohhvfdcuoehkihhrihhllhesshhhuhhtvghmohhvrd hnrghmvgeqnecuggftrfgrthhtvghrnhephfeigefhtdefhedtfedthefghedutddvueeh tedttdehjeeukeejgeeuiedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepkhhirhhilhhlsehshhhuthgvmhhovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Apr 2023 16:24:47 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 0CE03109AFC; Tue, 4 Apr 2023 23:24:45 +0300 (+03) Date: Tue, 4 Apr 2023 23:24:45 +0300 From: "Kirill A. Shutemov" To: Ard Biesheuvel Cc: Dave Hansen , Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Michael Roth , Joerg Roedel , Dionna Glaze , Andy Lutomirski , Peter Zijlstra , "Min M. Xu" , Gerd Hoffmann , James Bottomley , Jiewen Yao , Erdem Aktas , "Kirill A. Shutemov" Subject: Re: [PATCH v7 6/6] x86/efi: Safely enable unaccepted memory in UEFI Message-ID: <20230404202445.6qkl7hz67qgievqz@box.shutemov.name> References: <20230330114956.20342-1-kirill.shutemov@linux.intel.com> <1d38d28c2731075d66ac65b56b813a138900f638.1680628986.git.thomas.lendacky@amd.com> <20230404174506.pjdikxvk2fsyy4au@box.shutemov.name> <20230404180917.4fsgkzcdhqvph6io@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 On Tue, Apr 04, 2023 at 09:49:52PM +0200, Ard Biesheuvel wrote: > On Tue, 4 Apr 2023 at 20:09, Kirill A. Shutemov wrote: > > > > On Tue, Apr 04, 2023 at 10:57:52AM -0700, Dave Hansen wrote: > > > On 4/4/23 10:45, Kirill A. Shutemov wrote: > > > > I still think it is a bad idea. > > > > > > > > As I asked before, please include my > > > > > > > > Nacked-by: Kirill A. Shutemov > > > > > > > > into the patch. > > > > > > I was pretty opposed to this when I first saw it too. But, Tom and > > > company have worn down my opposition a bit. > > > > > > The fact is that we have upstream kernels out there with SEV-SNP support > > > that don't know anything about unaccepted memory. They're either > > > relegated to using the pre-accepted memory (4GB??) or _some_ entity > > > needs to accept the memory. That entity obviously can't be the kernel > > > unless we backport unaccepted memory support. > > > > > > This both lets the BIOS be the page-accepting entity _and_ allows the > > > entity to delegate that to the kernel when it needs to. > > > > > > As much as I want to nak this and pretend that that those existing > > > kernel's don't exist, my powers of self-delusion do have their limits. > > > > > > If our AMD friends don't do this, what is their alternative? > > > > The alternative is coordination on the host side: VMM can load a BIOS that > > pre-accepts all memory if the kernel is older. > > > > And how does one identify such a kernel? How does the VMM know which > kernel the guest is going to load after it boots? VMM has to know what it is running. Yes, it is cumbersome. But enabling phase for a feature is often rough. It will get smoother overtime. > > I know that it is not convenient for VMM, but it is technically possible. > > > > Introduce an ABI with an expiration date is much more ugly. And nobody > > will care about the expiration date, until you will try to remove it. > > > > None of us are thrilled about this, but the simple reality is that > there are kernels that do not understand unaccepted memory. How is it different from any other feature the kernel is not [yet] aware of? Like if we boot a legacy kernel on machine with persistent memory or memory attached over CLX, it will not see it as conventional memory. > EFI being > an extensible, generic, protocol based programmatic interface, the > best way of informing the loader that a kernel does understand it is > /not/ by adding some flag to some highly arch and OS specific header, > but to discover a protocol and call it. > > We're past arguing that a legitimate need exists for a solution to > this problem. So what solution are you proposing? I described the solution multiple times. You just don't like it. -- Kiryl Shutsemau / Kirill A. Shutemov