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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F31FECAAA1 for ; Fri, 9 Sep 2022 04:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbiIIEo4 (ORCPT ); Fri, 9 Sep 2022 00:44:56 -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 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?