Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4880661imw; Tue, 19 Jul 2022 15:21:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFFb1E3KIpfSdoKWbRzbbeT8I7gKDtV1q+TWN6TiekiXhZwPuGmsoa/4z+P/xCEDFCIh9U X-Received: by 2002:a17:902:cf12:b0:16c:a263:62b8 with SMTP id i18-20020a170902cf1200b0016ca26362b8mr24888238plg.31.1658269319605; Tue, 19 Jul 2022 15:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658269319; cv=none; d=google.com; s=arc-20160816; b=Hpg9RGljvVkBqw7S57VjmMabC5PQyODETwU1H+VOT9qPE9lJB9j9xVmPkKjAsvGW0i GJ90ru5vY49fAiOmyNsNdvist2Ox+6GwthwiW78aMTtJNp9MwK1+d/K/rpqI0ACedkuQ ls6JUrHd18lap1lr5VgzGZ/TOs9Rityp4uS0U6+WlEajS49VSuKuu4zir9Qk9sWqvsJZ RFzyxIucDFa0eHemgX6xNZaVG9jcW/TtQBC7nbZL8mHGUlJFV2wmjNWpOqQJBJ2JkxUy 0T8GddBcF8gsTZUUKTbDZGtEde9edY7rCUGVcP4gw08IhcmIBCfT5KV2YOYkovbaoWNf dafQ== 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=oa0M24Bcxs9H76v6xn59OW82WOFd78QWDiuhEG9Exmo=; b=bMf51FHLVhEpKgaiZel5vedl2+L7rDYQAC6ltUTb5GkG3Tlf5k43yjwlnzhjCY9Bro I4pk5uecpB9WBcb2hjWxEcE46dAsvkKklwm4fR5ZTLCTZD19c9XSyU7ZcKALfkmVFQ+4 jhFzZCK+2gfYmflJDtCRKnGnwUiiohBFxu6hOJr85aZ3fEpelJvCIiC/m6MDfG4MmhPS wBekt17LIfg/5/TTXOSqBDs8xKiSnh3+Vb+l0XHAZQ9kFRZfsh8O5QHrJz42U9zzbdQo 3BJCMBBvw20jTXdctI/IuZutJm+dPx3qi6c/WGyIAB9u3KegbFiRAncq83ritYT9651N bvMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="bGfk/AnD"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902f79100b0016d0bf9febasi3384084pln.390.2022.07.19.15.21.45; Tue, 19 Jul 2022 15:21:59 -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=@intel.com header.s=Intel header.b="bGfk/AnD"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240496AbiGSWBe (ORCPT + 99 others); Tue, 19 Jul 2022 18:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbiGSWBc (ORCPT ); Tue, 19 Jul 2022 18:01:32 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B2C5F9BD; Tue, 19 Jul 2022 15:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658268091; x=1689804091; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=7YsCljn9/plJ4mNS6po3lPvMpYECRfazDmQwYeZV0aM=; b=bGfk/AnDg+r0IJIPGqf5PeuPI2/Ekgt5WQKLamVlWT1W+pj1KHZrAXAU TqaJRR19xSI16y8SUIQvqzYmx9vyn9Gyo2Vu1GvZ+kafHJ/SdyN6IAM5p n5ZaC/TBjlfdUSJffJf/u4+Rif+VHvXf4n/6ScEXU+25o7bKmfVCD/agf bghvc/gytg2wpB9twESZk9VV0yKJ+1ncHeA2szahXF5SL8PC/Y1JfzPlO cVNWAXj0b4voeT4FyAI4VTQ/oMosCuh+aIILHa3ML7A7bIHoSOYPqzXq2 kaqgU9dFdaeRtwDFmLOgsl0ziHGox/Zvb2o16JaAFEDgpphQUv2U/asFL A==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="266396423" X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="266396423" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 15:01:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="924964668" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Jul 2022 15:01:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id E322510E; Wed, 20 Jul 2022 01:01:28 +0300 (EEST) Date: Wed, 20 Jul 2022 01:01:28 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov , Peter Gonda Cc: Dave Hansen , Ard Biesheuvel , Dionna Amalie Glaze , 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" Subject: Re: [PATCHv7 00/14] mm, x86/cc: Implement support for unaccepted memory Message-ID: <20220719220128.xl7yo4lk6uxwxilf@black.fi.intel.com> References: <20220718172159.4vwjzrfthelovcty@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, 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 On Tue, Jul 19, 2022 at 11:50:57PM +0200, Borislav Petkov wrote: > On Tue, Jul 19, 2022 at 02:35:45PM -0700, Dave Hansen wrote: > > They're trying to design something that can (forever) handle guests that > > might not be able to accept memory. > > Wait, what? > > If you can't modify those guests to teach them to accept memory, how do > you add TDX or SNP guest support to them? > > I.e., you need to modify the guests and then you can add memory > acceptance. Basically, your point below... > > > It's based on the idea that *something* needs to assume control and > > EFI doesn't have enough information to assume control. > > > > I wish we didn't need all this complexity, though. > > > > There are three entities that can influence how much memory is accepted: > > > > 1. The host > > 2. The guest firmware > > 3. The guest kernel (or bootloader or something after the firmware) > > > > This whole thread is about how #2 and #3 talk to each other and make > > sure *someone* does it. > > > > I kinda think we should just take the guest firmware out of the picture. > > There are only going to be a few versions of the kernel that can boot > > under TDX (or SEV-SNP) and *can't* handle unaccepted memory. It seems a > > bit silly to design this whole interface for a few versions of the OS > > that TDX folks tell me can't be used anyway. > > > > I think we should just say if you want to run an OS that doesn't have > > unaccepted memory support, you can either: > > > > 1. Deal with that at the host level configuration > > 2. Boot some intermediate thing like a bootloader that does acceptance > > before running the stupid^Wunenlightended OS > > 3. Live with the 4GB of pre-accepted memory you get with no OS work. > > > > Yeah, this isn't convenient for some hosts. But, really, this is > > preferable to doing an EFI/OS dance until the end of time. > > Ack. Definitely. I like it too as it is no-code solution :P Peter, I'm pretty sure unaccepted memory support hits upstream well before TDX get adopted widely in production. I think it is pretty reasonable to deal with it on host side in meanwhile. Any objections? -- Kirill A. Shutemov