From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6257CC19F2D for ; Tue, 9 Aug 2022 21:09:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A455B8E0002; Tue, 9 Aug 2022 17:09:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F42B8E0001; Tue, 9 Aug 2022 17:09:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 894B78E0002; Tue, 9 Aug 2022 17:09:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7A5068E0001 for ; Tue, 9 Aug 2022 17:09:25 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4FFAE1C68EB for ; Tue, 9 Aug 2022 21:09:25 +0000 (UTC) X-FDA: 79781295090.24.40BE56B Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by imf29.hostedemail.com (Postfix) with ESMTP id EFA62120165 for ; Tue, 9 Aug 2022 21:09:24 +0000 (UTC) Received: by mail-yb1-f172.google.com with SMTP id i62so20330166yba.5 for ; Tue, 09 Aug 2022 14:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=4AnOLC3meWulFDlunnxqr8ro1/97TD7nuiX27zsgi3w=; b=NsJ2BZTYrfxq6UgoEZX7cFaurvwf57FlPR++8OifPr2sNTUZQ5ptP/BMu38FsOwGjw lRPwqjEF2FELM29RAO6PCR2PGj9SE2siJGQvqUMCV1ySeEEnMmbMX9X95vPwVEMns8ea fCE3B7DkUIaaLPQlhs7KKL9mAxtsRgr2K21uJuNxiI6N3R+vgxM9mRXchkJiSToKafDO /X8fwRmEqel5qz/q/ln06VGZZLzsUCiFAC7rFg94E+7DM0VUc6Odfcy/QHblavevj7Bz Rf4ForjNKA2m3+Y2uIa+2Knapldn44WxYqdaRYAb6JNt1ETCRs7LKorphFBb+FbGIGHq 0O/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=4AnOLC3meWulFDlunnxqr8ro1/97TD7nuiX27zsgi3w=; b=6MPBl99sPH5+Pydn92YHrTCnTXuTzHae36+dGCJE8EqJJwFkkGY8bhQGPzn1U++miu p2vZVIjUGNjxICVO/gnNVyGnfR/tHoBOBgoFJ/Kx1QQTYRsPifCp17p6Wiszfhxf+Jv+ rP7JAKei9UBzmTK1wczfezpyFoYkMJ9pAfVJsJkfs+G3is6Q5qMjB9i3uK+ChZlW160R LjGtgfQ+2Ptqpz614i9Ggdo5Y8oVf9U10VOLVBDJhaA1Orev7aIYHXNCh90ggYtB//iV 81AROu+I+3dmE1btURISmRIs4OCtwsjpKEJY3yKfLMOHRR8LlJKDCMotkPLWqU1cqDPb +m/Q== X-Gm-Message-State: ACgBeo2wZvuv1ppeHeY4TtYhFRsg54ug6T+AuBolirQCq3R1weAqzBFI T9Y9fU7ntKfoegH5kvXumb0wtBwNasVsXvQZPUj3QQ== X-Google-Smtp-Source: AA6agR4c14r85y/vAuWCM7cekVD5gahj8uuXMIUH2AxcX3QY04lGwJ8N8fHdMcgi3pCAM3B8RV9vPYU7J/SICBLs4SM= X-Received: by 2002:a25:fb06:0:b0:677:5a84:9f61 with SMTP id j6-20020a25fb06000000b006775a849f61mr20527053ybe.560.1660079364031; Tue, 09 Aug 2022 14:09:24 -0700 (PDT) MIME-Version: 1.0 References: <22d54786-bc12-ecc5-2b37-cbaa56090aa8@intel.com> <20220809111436.kudwg2nprnnsfvuh@box.shutemov.name> <20220809115427.bmkbap434oupinq2@box.shutemov.name> In-Reply-To: <20220809115427.bmkbap434oupinq2@box.shutemov.name> From: Dionna Amalie Glaze Date: Tue, 9 Aug 2022 14:09:12 -0700 Message-ID: Subject: Re: [PATCHv7 00/14] mm, x86/cc: Implement support for unaccepted memory To: "Kirill A. Shutemov" Cc: Ard Biesheuvel , Dave Hansen , Marc Orr , Borislav Petkov , Peter Gonda , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Mike Rapoport , David Hildenbrand , Marcelo Cerri , tim.gardner@canonical.com, Khalid ElMously , philip.cox@canonical.com, "the arch/x86 maintainers" , Linux Memory Management List , linux-coco@lists.linux.dev, linux-efi , LKML , "Yao, Jiewen" Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660079365; a=rsa-sha256; cv=none; b=5BygfGCr2hG2Nz6H7dfzeohkfzog0zW65U2CPTRkmYdxbWf5FbqSdY131sCW8kSU4+OHFL UeOt62fgI99dc2iRNkmGdKYum59G6IsoY9gL/4lP6inpg/5Vw/QjfSfMeVHesdAvkeubnV /1GAbxNmsfAs9XdNgRPFThJZYy6upRo= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=NsJ2BZTY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf29.hostedemail.com: domain of dionnaglaze@google.com designates 209.85.219.172 as permitted sender) smtp.mailfrom=dionnaglaze@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660079365; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4AnOLC3meWulFDlunnxqr8ro1/97TD7nuiX27zsgi3w=; b=p6SmT2Xs5exVi4XPZQ6E/6IRUMSPz/k44nrrphQRrMzVJ9hxJJLo4lk3Hq4AM9wkXn0hBf 9MnfT20RUBJ2m7xENY4i5GOq2SB+ddw2/pgqhQ/jIjnCQu17t7LuKX5VlvMQY7DqVYiEKN n8WF1UeJXjwv1104GNVmxPsAZVTEIvc= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EFA62120165 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=NsJ2BZTY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf29.hostedemail.com: domain of dionnaglaze@google.com designates 209.85.219.172 as permitted sender) smtp.mailfrom=dionnaglaze@google.com X-Rspam-User: X-Stat-Signature: jsjoberakuybkxnz7rjus96gdj8p6jsh X-HE-Tag: 1660079364-996796 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > > > > EFI is basically our existing embodiment of this fw/kernel negotiation > > > > thing, and iff we need it, I have no objection to using it for this > > > > purpose, i.e., to allow the firmware to infer whether or not it should > > > > accept all available memory on behalf of the OS before exiting boot > > > > services. But if we don't need this, even better. > > > > > > FW/kernel negotiation does not work if there's a boot loader in the middle > > > that does ExitBootServices(). By the time kernel can announce if it > > > supports unaccepted memory there's nobody to announce to. > > > > > > > Why would you want to support such bootloaders for TDX anyway? TDX > > heavily relies on measured boot abstractions and other things that are > > heavily tied to firmware. > > I don't understand it either. And, yet, there's demand for it. > I think there's no good solution for this bad upgrade path that the UEFI spec stuck us with, so I think I'm going to stick to what many folks have suggested: just have the host require external information. What this means is that at VM creation time, the user has to specify an extra flag that all memory has to be accepted in firmware before booting the guest OS. Failure to provide the flag leads to the unfortunate outcome that the VM only has access to the lower 4GB of RAM. We can only hope that the VM OOMs shortly after they start up the machine and the user reads an FAQ that they should add this flag. I'll do a round of appeals to distributions to include this patch set and AMD's follow-up that defines accept_memory for SEV-SNP to reduce the time that people need to know about this flag. -- -Dionna Glaze, PhD (she/her)