Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1495113rwn; Thu, 8 Sep 2022 22:05:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6dZulPOjyzVKmYwQXl2jQcxLVKKabphCUp+Nh4xEyZTMMwhQThHpo5k+hsSQYY/w6TceLq X-Received: by 2002:a05:6a00:2789:b0:531:c43:6290 with SMTP id bd9-20020a056a00278900b005310c436290mr12367471pfb.21.1662699947029; Thu, 08 Sep 2022 22:05:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662699947; cv=none; d=google.com; s=arc-20160816; b=a+dffWNMvG5F0K3yN+NQ0gdzX+nKsAWh1P5d1JuqaN6lMlRtgF1vk5b+QhFY8fP6LF orvhJzCl6QTR8vK0UBj0sVm10BpN2sUIMEKrBtb683l4G5BJ+mnhGP3tQGtACAklK1/v I+5x3RhIQAWEd7REi1MxJ1BddPUEMAwD7EGVt1FBBSm9MTHC4+WmgYjDFrt9+1ePPRC7 JtC9XoSn8hVx04gpk4lYiKXczvj06mpger4JvFlcE2VsXxbpNnu6jyFpwFQQI6Il1vCM b3eNe2hWtc7ATjpyRp/Tvq80Ua6OrH87uVLZ+XYB2AViUuHBBG/8P5jRJy9YoBKz+INM lz4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kjE0kj08iKv2CuxokPHPxSN/FM27jijVjFCJFgth5Dg=; b=dMqnuz+geP0rPcRTHF/EXUAPBO66162Xs2rbnZGi1UuNkicKACXSGPPt5QqyawiMnl zBAX+33/dwBvjzXezkf4iCx+Z961wnFgmj+z6OnJ8V+5Fw2JuTDq0iihzl0q2zzU6QJR Wq7uwoUKs7XsAxWHJYC8rvJMJAKpb9b2Xne3K3+XcihMca/nKAiLsoutp9WGK0PuF4u+ xFtZN8SdnaaC8rgQSCpfhNPsMkruTDK0tNVTgcw+2DgBs78hlpA0o3fUkoSetMtfcVcP 8IDdOvq9To/WEYAhVMc0Ylz99X5iOCPh7x+nPCq7ODtodXaXEEFUXxrfA34la2RLGF1h KBaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cLrhFtKH; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a170903230600b00177f82f07a1si1114870plh.298.2022.09.08.22.05.25; Thu, 08 Sep 2022 22:05:47 -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=@kernel.org header.s=k20201202 header.b=cLrhFtKH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229679AbiIIEoy (ORCPT + 99 others); Fri, 9 Sep 2022 00:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiIIEou (ORCPT ); Fri, 9 Sep 2022 00:44:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBFCF37FAB; Thu, 8 Sep 2022 21:44:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 424D360E73; Fri, 9 Sep 2022 04:44:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E45CC433C1; Fri, 9 Sep 2022 04:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662698687; bh=enEwLIV4OwLmN/RgbTuEUX2L54sFfCWJPwewzGbYInE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cLrhFtKHGXINYvsGREelVRIrtsdDSdhyssoSgqKj1qRrv8lKr0eHelXtdnDQr85sC vUhwAfnsNzkQoKexpnXMoJMT2YKwm5XKP5lz/55VUhKJAfkOYJlwEC7BQKT5XWACfI 1k3vOOYkyrSJreY+nrZBkF7nlWbJdvuk7q1CKzdUycNfapzFNnsGW/qGhV4hFmnntR OfJ8zVRoAu1qi5JA6EiUBZ7jakY55X0EANPYhumQNRuDzDBGpuIpiLT6sCkdfGVwZE 3o0LkAEWoAGTiudx3mSdHcf7Y878UhbbaZuVzxJ+2HSUPNQIqSpy8GPq8284tGcG6p KiZxc67uW85HQ== Message-ID: <48f7d192-993d-1df1-db0a-f985e61669b6@kernel.org> Date: Thu, 8 Sep 2022 21:44:44 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Content-Language: en-US To: "Kirill A . Shutemov" , Hugh Dickins Cc: Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , 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 , "Gupta, Pankaj" References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220818132421.6xmjqduempmxnnu2@box> From: Andy Lutomirski In-Reply-To: <20220818132421.6xmjqduempmxnnu2@box> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,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 8/18/22 06:24, Kirill A . Shutemov wrote: > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: >> On Wed, 6 Jul 2022, Chao Peng wrote: >>> This is the v7 of this series which tries to implement the fd-based KVM >>> guest private memory. >> >> Here at last are my reluctant thoughts on this patchset. >> >> fd-based approach for supporting KVM guest private memory: fine. >> >> Use or abuse of memfd and shmem.c: mistaken. >> >> memfd_create() was an excellent way to put together the initial prototype. >> >> But since then, TDX in particular has forced an effort into preventing >> (by flags, seals, notifiers) almost everything that makes it shmem/tmpfs. >> >> Are any of the shmem.c mods useful to existing users of shmem.c? No. >> Is MFD_INACCESSIBLE useful or comprehensible to memfd_create() users? No. >> >> What use do you have for a filesystem here? Almost none. >> IIUC, what you want is an fd through which QEMU can allocate kernel >> memory, selectively free that memory, and communicate fd+offset+length >> to KVM. And perhaps an interface to initialize a little of that memory >> from a template (presumably copied from a real file on disk somewhere). >> >> You don't need shmem.c or a filesystem for that! >> >> If your memory could be swapped, that would be enough of a good reason >> to make use of shmem.c: but it cannot be swapped; and although there >> are some references in the mailthreads to it perhaps being swappable >> in future, I get the impression that will not happen soon if ever. >> >> If your memory could be migrated, that would be some reason to use >> filesystem page cache (because page migration happens to understand >> that type of memory): but it cannot be migrated. > > Migration support is in pipeline. It is part of TDX 1.5 [1]. And swapping > theoretically possible, but I'm not aware of any plans as of now. > > [1] https://www.intel.com/content/www/us/en/developer/articles/technical/intel-trust-domain-extensions.html > This thing? https://cdrdv2.intel.com/v1/dl/getContent/733578 That looks like migration between computers, not between NUMA nodes. Or am I missing something?