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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A4F8C433EF for ; Tue, 23 Nov 2021 14:33:07 +0000 (UTC) Received: from localhost ([::1]:53966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpWr4-0006xN-2q for qemu-devel@archiver.kernel.org; Tue, 23 Nov 2021 09:33:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpWpl-0006Fr-2F for qemu-devel@nongnu.org; Tue, 23 Nov 2021 09:31:45 -0500 Received: from mga18.intel.com ([134.134.136.126]:13155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpWpi-0002uV-Kb for qemu-devel@nongnu.org; Tue, 23 Nov 2021 09:31:44 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="221909682" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="221909682" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 06:31:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="509429128" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.192.101]) by orsmga008.jf.intel.com with ESMTP; 23 Nov 2021 06:31:17 -0800 Date: Tue, 23 Nov 2021 22:30:31 +0800 From: Chao Peng To: Paolo Bonzini Subject: Re: [RFC v2 PATCH 04/13] KVM: Add fd-based memslot data structure and utils Message-ID: <20211123143031.GC32088@chaop.bj.intel.com> References: <20211119134739.20218-1-chao.p.peng@linux.intel.com> <20211119134739.20218-5-chao.p.peng@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Received-SPF: none client-ip=134.134.136.126; envelope-from=chao.p.peng@linux.intel.com; helo=mga18.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Chao Peng Cc: Wanpeng Li , jun.nakajima@intel.com, kvm@vger.kernel.org, david@redhat.com, qemu-devel@nongnu.org, "J . Bruce Fields" , linux-mm@kvack.org, "H . Peter Anvin" , ak@linux.intel.com, Jonathan Corbet , Joerg Roedel , x86@kernel.org, Hugh Dickins , Ingo Molnar , Borislav Petkov , luto@kernel.org, Thomas Gleixner , Vitaly Kuznetsov , Jim Mattson , dave.hansen@intel.com, Sean Christopherson , susie.li@intel.com, Jeff Layton , linux-kernel@vger.kernel.org, john.ji@intel.com, Yu Zhang , linux-fsdevel@vger.kernel.org, Andrew Morton , "Kirill A . Shutemov" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Nov 23, 2021 at 09:41:34AM +0100, Paolo Bonzini wrote: > On 11/19/21 14:47, Chao Peng wrote: > > For fd-based memslot store the file references for shared fd and the > > private fd (if any) in the memslot structure. Since there is no 'hva' > > concept we cannot call hva_to_pfn() to get a pfn, instead kvm_memfd_ops > > is added to get_pfn/put_pfn from the memory backing stores that provide > > these fds. > > > > Signed-off-by: Yu Zhang > > Signed-off-by: Chao Peng > > --- > > What about kvm_read/write_guest? Hmm, that would be another area KVM needs to change. Not totally undoable. > Maybe the proposal which kept > userspace_addr for the shared fd is more doable (it would be great to > ultimately remove the mandatory userspace mapping for the shared fd, but I > think KVM is not quite ready for that). Agree for short term keeping shared part unchanged would be making work easy:) Let me try that to see if any blocker. > > Paolo