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 A471CC433EF for ; Tue, 23 Nov 2021 14:31:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238198AbhKWOee (ORCPT ); Tue, 23 Nov 2021 09:34:34 -0500 Received: from mga01.intel.com ([192.55.52.88]:5996 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234867AbhKWOee (ORCPT ); Tue, 23 Nov 2021 09:34:34 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="258899965" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="258899965" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.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 Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, qemu-devel@nongnu.org, Jonathan Corbet , Sean Christopherson , 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 , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, john.ji@intel.com, susie.li@intel.com, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com Subject: Re: [RFC v2 PATCH 04/13] KVM: Add fd-based memslot data structure and utils Message-ID: <20211123143031.GC32088@chaop.bj.intel.com> Reply-To: Chao Peng 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) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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