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 AB071C433F5 for ; Tue, 23 Nov 2021 14:31:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F4946B006C; Tue, 23 Nov 2021 09:31:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CB586B0071; Tue, 23 Nov 2021 09:31:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B9A26B0073; Tue, 23 Nov 2021 09:31:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id EDB366B006C for ; Tue, 23 Nov 2021 09:31:37 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B1137184F16E3 for ; Tue, 23 Nov 2021 14:31:27 +0000 (UTC) X-FDA: 78840432972.07.1DD9241 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf24.hostedemail.com (Postfix) with ESMTP id A32ABB00083A for ; Tue, 23 Nov 2021 14:31:23 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="321262462" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="321262462" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.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) X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A32ABB00083A X-Stat-Signature: nhunzikqy9e114zr8s3wr151sx373km3 Authentication-Results: imf24.hostedemail.com; dkim=none; spf=none (imf24.hostedemail.com: domain of chao.p.peng@linux.intel.com has no SPF policy when checking 192.55.52.43) smtp.mailfrom=chao.p.peng@linux.intel.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none) X-HE-Tag: 1637677883-386264 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 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