Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6512592rwl; Tue, 4 Apr 2023 14:05:14 -0700 (PDT) X-Google-Smtp-Source: AKy350YXk2vv9TlbxbMIKQFe+Ye8Z3vZKXJy+SA0pu/WJAnqi4x4rUccq5Kq1KOPVgGfXg5Zh0DA X-Received: by 2002:a17:906:2b0d:b0:93f:fbe:c389 with SMTP id a13-20020a1709062b0d00b0093f0fbec389mr816133ejg.13.1680642314460; Tue, 04 Apr 2023 14:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680642314; cv=none; d=google.com; s=arc-20160816; b=MaUKJirg9r3tadBuu9uSHFD+a1lC0MpcoMgN/8L9UM+09gJRe86/TT1ifCluVK7pqp bbGvPaDeeg5g4d0TJfRrXjKSxazcaYHNkAAKvB7ArfWecWt7HJp8cC3BVndV/H2ibo7D x/ocqp+Q5yQvH7cQ2/JiUDJ9PzHCo5OdZ3Z6v8mWhS0b8EQ42ab0oSCuduOtN5O1F/IE K3nOtiSSfsq8vF+5PWojQGrjo7SY9PYpY1bGP/X1jTu3eqrk0bvOFRy7+fLKLmUDfnAj h1pIs36g1gdiWsEIZdmBkKL2RMoZb0gCrlTworji3uAWCFw3Cx0Db/DF7tvvRHpz+0qz mqWw== 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=lijSnSmLcaAFcUlvqXgtuVKUdAarFaz8tX2jIVimq1A=; b=HlAj7S/CoF3iBHYJsnSV37RnAy01265qEqjtRI/cNfqzIJyUx2oeUd1tCZlOiTiFkn AXmW1Kf0b1mOIRbk7CXoefd6HRbHJZQePAHaBa4xMtZhw62NpRcdfrBgWfhUN3hoCzza Dqz1FgcoDQNwb4vzv582SDd2uZ4NT7pCzs/qz0rR2t+4u6b1GADHAnx28JJC29NHBZI+ XtYuRt0hlf4WF//TanIQ048E83fm5VGYpWu0AGAC4N1MNqF1Unw+DvJh1w2Sl/+DZqBP 0HfwBDco6XJYqSpJuLF8g0bjazma03WTd9pG+EcckR3eULbGUAzg01e+Z/wvxSkSGyBg iB3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm1 header.b=jTzAXm0T; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Kb1ibZly; 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 fj10-20020a1709069c8a00b00947f53fcddesi2723955ejc.158.2023.04.04.14.04.49; Tue, 04 Apr 2023 14:05:14 -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=jTzAXm0T; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Kb1ibZly; 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 S235861AbjDDVE1 (ORCPT + 99 others); Tue, 4 Apr 2023 17:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjDDVEZ (ORCPT ); Tue, 4 Apr 2023 17:04:25 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 292854ED6 for ; Tue, 4 Apr 2023 14:03:59 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C764232003AC; Tue, 4 Apr 2023 17:01:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 04 Apr 2023 17:02:00 -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=1680642117; x= 1680728517; bh=lijSnSmLcaAFcUlvqXgtuVKUdAarFaz8tX2jIVimq1A=; b=j TzAXm0TTIfjdt+dSpPGZY0wPf09zRFNkLWIhbXB3T0hFu49kcWBqhnBIhDrgtTy5 RWbld6m2djhnAWFCFO0rFQK6V7K2MQplm+CL3JkVw5Yo/bUJgsFvfNG7hf/5wTg+ nrr7e7Eo3S84X/QMIzTWsXL6jxjACrCsqkj6pcgjhVKxDo4s4SwOZ+kwEPr9Tqph l7cDEyiQsBz4l9dFh7KeV7VHfPoSrSWJ2v0NPbepZlmXIVF2jIJBidO4NUNrEFzF unSVIpgNm5Uc/kcWMRFTtvG1QhKxec2sKWo318hvAIL04Nt4IpXG0HFM8KK449Yu IzcllL4PvAThbfdmdHWJA== 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=1680642117; x=1680728517; bh=lijSnSmLcaAFc UlvqXgtuVKUdAarFaz8tX2jIVimq1A=; b=Kb1ibZlySuDNFOodGM+HC3laU0aqX bA8rOcPXohR8aecc7mglIc9ExY5Od0A1ELq37YHUNEng6rxvWWEdkW9oOhXTS2RY /RAOXpBh8R1jNjgyyEB/cQ9gUQWhWa9rTWUjl4eaCNZTVJEa+PMSWnRxU0XFmIFf G0QN4FpGplGQ04xgrPWTOtzvv4Jy5lX5iVgn/y1wHinOMG9QWmoWHJS3EQjOlrC/ +8KbtLeU3nfUdoiuTqa95LsmK25lEQAXpWDLJJKv34l6jkBfV2CvsBp/olLb7FP0 LXN5kq5ZWg8fUvRR/5X9ObCw6TJBfkXoEVKQc0LO1/vEU0XayB+SI2dSg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeiledgudehjecutefuodetggdotefrod 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 17:01:55 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 755CE10C32D; Wed, 5 Apr 2023 00:01:53 +0300 (+03) Date: Wed, 5 Apr 2023 00:01:53 +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: <20230404210153.tll2mojlglx4rfsa@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> <20230404202445.6qkl7hz67qgievqz@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 10:41:02PM +0200, Ard Biesheuvel wrote: > On Tue, 4 Apr 2023 at 22:24, Kirill A. Shutemov wrote: > > > > 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. > > > > So how does the VMM get informed about what it is running? How does it > distinguish between kernels that support unaccepted memory and ones > that don't? And how does it predict which kernel a guest is going to > load? User will specify if it wants unaccepted memory or not for the VM. And if it does it is his responsibility to have kernel that supports it. And you have not addressed my question: How is it different from any other feature the kernel is not [yet] aware of? -- Kiryl Shutsemau / Kirill A. Shutemov