From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754321AbcGFPux (ORCPT ); Wed, 6 Jul 2016 11:50:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753826AbcGFPuw (ORCPT ); Wed, 6 Jul 2016 11:50:52 -0400 Date: Wed, 6 Jul 2016 09:50:50 -0600 From: Alex Williamson To: Paolo Bonzini Cc: Xiao Guangrong , Neo Jia , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Kirti Wankhede , Andrea Arcangeli , Radim =?UTF-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 0/2] KVM: MMU: support VMAs that got remap_pfn_range-ed Message-ID: <20160706095050.01d88d69@t450s.home> In-Reply-To: <4eb9131a-d2cb-9142-1db3-d7138bf03309@redhat.com> References: <1467291711-3230-1-git-send-email-pbonzini@redhat.com> <20160705054147.GA27138@nvidia.com> <577C664E.3080802@linux.intel.com> <4eb9131a-d2cb-9142-1db3-d7138bf03309@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 06 Jul 2016 15:50:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Jul 2016 08:05:15 +0200 Paolo Bonzini wrote: > On 06/07/2016 04:00, Xiao Guangrong wrote: > > > > > > On 07/05/2016 08:18 PM, Paolo Bonzini wrote: > >> > >> > >> On 05/07/2016 07:41, Neo Jia wrote: > >>> On Thu, Jun 30, 2016 at 03:01:49PM +0200, Paolo Bonzini wrote: > >>>> The vGPU folks would like to trap the first access to a BAR by setting > >>>> vm_ops on the VMAs produced by mmap-ing a VFIO device. The fault > >>>> handler > >>>> then can use remap_pfn_range to place some non-reserved pages in the > >>>> VMA. > >>>> > >>>> KVM lacks support for this kind of non-linear VM_PFNMAP mapping, and > >>>> these > >>>> patches should fix this. > >>> > >>> Hi Paolo, > >>> > >>> I have tested your patches with the mediated passthru patchset that > >>> is being > >>> reviewed in KVM and QEMU mailing list. > >>> > >>> The fault handler gets called successfully and the previously mapped > >>> memory gets > >>> unmmaped correctly via unmap_mapping_range. > >> > >> Great, then I'll include them in 4.8. > > > > Code is okay, but i still suspect if this implementation, fetch mmio > > pages in fault handler, is needed. We'd better include these patches > > after the design of vfio framework is decided. > > I think that this fixes a bug anyway, the previous handling of VM_PFNMAP > is too simplistic. Agreed, no reason to hold off on this, it's a valid interaction that needs to be fixed regardless of how or if the vfio mediated driver makes use of it. Thanks, Alex