Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3583791rwb; Tue, 16 Aug 2022 05:45:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Gfm6XWw5cNaYcJEUUEgU63432l/evqZHAx9QZbu+RuKIjNM/NZrOnmotQXC5LBcAMHYWm X-Received: by 2002:a05:6402:400b:b0:43d:b0a1:dee with SMTP id d11-20020a056402400b00b0043db0a10deemr18919474eda.223.1660653946651; Tue, 16 Aug 2022 05:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660653946; cv=none; d=google.com; s=arc-20160816; b=BhXfUZMWakFAtf/Xho4dzQEIrF+L1PsQGcrjakTBS/P2POK6TgF9NvPZprIoXvMGsg y3S7CX9J14OaNkWGhlUxvj4GcQBq1fHhCx3HSAfkoKj+PhjCGJsN7mWiO2XCWfv3I3b0 GX+ZMVWYDGiycDoJBpvOE0d4zUeiIMi0EAT4zSQRo+6Bp71nWULdE+N2JZwHlQoI+S3+ Tt+ZYZVIPvH88slXSinF4JiUMwOsuArYl+gMPwduD8PnGyvc8rERPCxGCFfOmOu6GHhR MLZ7Bp9HSG9tQamB7HviV8o/0UFyXzvVEFN0OVSUO+bA2iAWEDGONTgRsm/puF4xl9CW OWRQ== 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=nP7nUuidZW4hNzTqKU45P4PsyG6Glx3zHv3sZb4A4o0=; b=hn9JCqXsPyacvsjv2O+d1Yx1loQbrcaOFHDGFKwz/ZeQQg1xqPjQ4gl1lWvXh1w2wr aa6XTbkIVAVm3Hpi2++Uf9CvNRe0SaPW76+v5toA2gF6/0nYCYQif1Iq2rj5e+Jq4BEk xPCUX9m+YOjIMsDiWImoSeAcvG15BzS+nCvKCKHUvs/rmluV9WTKVjTQv43ItKlmd4TS gbO0485Vxqe2L+2KJ8YIDEcrys4nMl5YUnznoKFZ8wyBMyVf+pjhIMupoB8z1A6ad5Wj j8lJzR5ScNtaIT0Q0/27tzbYO7GcaWG9ZmCqXBprIT9Va1E/3kPhsojj3mVMZ2RLNWiJ ccVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Tifp/ISU"; 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 hc30-20020a170907169e00b0072b02ef4ad9si12509041ejc.307.2022.08.16.05.45.20; Tue, 16 Aug 2022 05:45:46 -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="Tifp/ISU"; 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 S231578AbiHPMWI (ORCPT + 99 others); Tue, 16 Aug 2022 08:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbiHPMWF (ORCPT ); Tue, 16 Aug 2022 08:22:05 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B4CA25C68; Tue, 16 Aug 2022 05:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660652525; x=1692188525; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=B3uUd/yG6wpuTb/aR5iTfAme30Qm6tQlD5VU32Fh/CI=; b=Tifp/ISUfjpNRaPP/CY94u94leOZ91YRfJkuv3BDszBornbMs5Q6XRQ7 Ixcw0xfxSGlJ1Jg0hiYU0p5uFCXRilB6YP1Oef6lmkw0edqQbDB88Z1Zk 92hPzlG/ufTn1JT3E+1Bor79jl97sbJHqhdZcxEGuqk0Z1IAVbJxaAgBF 8TkLB0HHACBU+bOr/uWseGqjadJawZfkVjkgEF0OV/8Hm9kAqrgBq7FeF TucuT2O8paNDEBJxQExyYRDVCGdFPd1jsimk54wcpS0qKHTZDzhCHAQ47 lhhOfV7Q2m5H6OH4cSsSeil9POTww0F/BnV3p9UUmF5ySbm27HvydlkBK g==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="289773234" X-IronPort-AV: E=Sophos;i="5.93,241,1654585200"; d="scan'208";a="289773234" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 05:22:03 -0700 X-IronPort-AV: E=Sophos;i="5.93,241,1654585200"; d="scan'208";a="675194031" Received: from damianos-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.40.45]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 05:21:54 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 4FB31104A4E; Tue, 16 Aug 2022 15:24:57 +0300 (+03) Date: Tue, 16 Aug 2022 15:24:57 +0300 From: "Kirill A . Shutemov" To: "Gupta, Pankaj" Cc: Chao Peng , "Nikunj A. Dadhania" , Sean Christopherson , Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , bharata@amd.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Message-ID: <20220816122457.2fjyd4uz5hp5cani@box.shutemov.name> References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <9e86daea-5619-a216-fe02-0562cf14c501@amd.com> <9dc91ce8-4cb6-37e6-4c25-27a72dc11dd0@amd.com> <422b9f97-fdf5-54bf-6c56-3c45eff5e174@amd.com> <1407c70c-0c0b-6955-10bb-d44c5928f2d9@amd.com> <1136925c-2e37-6af4-acac-be8bed9f6ed5@amd.com> <1b02db9d-f2f1-94dd-6f37-59481525abff@amd.com> <20220815130411.GA1073443@chaop.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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, Aug 16, 2022 at 01:33:00PM +0200, Gupta, Pankaj wrote: > Hi Chao, > > > > > Actually the current version allows you to delay the allocation to a > > later time (e.g. page fault time) if you don't call fallocate() on the > > private fd. fallocate() is necessary in previous versions because we > > treat the existense in the fd as 'private' but in this version we track > > private/shared info in KVM so we don't rely on that fact from memory > > backstores. > > Does this also mean reservation of guest physical memory with secure > processor (both for SEV-SNP & TDX) will also happen at page fault time? > > Do we plan to keep it this way? If you are talking about accepting memory by the guest, it is initiated by the guest and has nothing to do with page fault time vs fallocate() allocation of host memory. I mean acceptance happens after host memory allocation but they are not in lockstep, acceptance can happen much later. -- Kiryl Shutsemau / Kirill A. Shutemov