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 AC75BECAAD3 for ; Fri, 9 Sep 2022 04:44:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E4978D0003; Fri, 9 Sep 2022 00:44:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 16E368D0002; Fri, 9 Sep 2022 00:44:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00D398D0003; Fri, 9 Sep 2022 00:44:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E031D8D0002 for ; Fri, 9 Sep 2022 00:44:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9FAB3C07F4 for ; Fri, 9 Sep 2022 04:44:49 +0000 (UTC) X-FDA: 79891306698.11.5981BD5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 3709C14008F for ; Fri, 9 Sep 2022 04:44:49 +0000 (UTC) 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 4347D61E94; 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662698689; a=rsa-sha256; cv=none; b=qXuoJLQ1Fy6VkhqWJv++hHYilyAGOkN4VyFe6HJBp/ZV0H6sjb7LiAGs5253UnR5b8cwsS xo9LE4XgADWiBlySUiiNUcPTZcPLDuJUVR2OmDKAUb8C0Ic4PWx6uCwGnEo9tfBzD6tRgx 38ugmBxtqMTKKqo/AOOdyLn34MmaZUI= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cLrhFtKH; spf=pass (imf09.hostedemail.com: domain of luto@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=luto@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662698689; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kjE0kj08iKv2CuxokPHPxSN/FM27jijVjFCJFgth5Dg=; b=SchCZYVljjv+JnkTYAqFZ3EvWox1XbsBujUDhP2m9GEQJeaiEVIY4aCUAbHE0NpJHuqDDW UMUPVp8ObbC8lNzQz/eic4cNQaahO7lBbHWvBYSdEQoDlg7nLPSdvBEaLWCgN3LW8Xfmvk rX12k39mfqOUFWQIt1Iy3NUA6ADFKJE= Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cLrhFtKH; spf=pass (imf09.hostedemail.com: domain of luto@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=luto@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: d8sqznbb9i6jtastu9t7nm7bxw6sk438 X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3709C14008F X-HE-Tag: 1662698689-87449 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: 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?