Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp460691ybl; Thu, 15 Aug 2019 21:47:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOPf5ExNWxFZFpYCE1+6Jy/fVwLCUnD2f5zmZm6sSLPIYX6kSsaqtYT3Q8pVDc6JB251et X-Received: by 2002:a62:f245:: with SMTP id y5mr8969478pfl.156.1565930834286; Thu, 15 Aug 2019 21:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565930834; cv=none; d=google.com; s=arc-20160816; b=GXKBMUmkyUa5mxORhpQmz/HbNiniV+Mc9PKC94lqxBjG4sWLC6VqR/39rr9DFZvm+9 WzKMvXewEuKEeUwBo56tLLQEFd6X4e7xU0SfuKSovVNk7LIYbd/e7r3EGG1SmE0LjSUR sj2MHGmiE6+2qL7Ym9rHe7Od6lPxNCllqHH3Ce9Jy5PtvL5WFXOkbYnu5hgfS76ZWmH3 y/s9pjgxA+r5UlgdQzlv4/KzDdlLn3mdz/QgaIpx/5SZpMkviv5jZ965dgXsDbmoS7Es 8XMcJp4eUKV4KRePatT3RfpTWhvloxiL7poA9/pK6kbk8B1Pli/nMWFMwps9z6XJxDgQ R36A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ojIRYPmVOgNWPpJecKeFdXM73RgrZ5ScNUMcU9AV2Sc=; b=HhKrsJrJsj2N5v+WhuIs4My3Ihvh3/gIpvuQTR1H/IpkcP1Qy4olKZ4QVHCC03M4Gl eHEDOvKvAcUZLAB/2MvBs3c9fFvhuX0o15+o0aNgGdV0YjZvW9OGBcZDZtxDWroRORys bsycqZ9L5a87RTWpnYmZQhoqN4VgSbW4dMtTjnXrYhe1R978QQW1EIeiR9Rmn+L+/rMC bHgEFRX65tgmpMTLpazUw/18evkF6CGDLrhGOZQfOoYQPfLqrlxpVJb/QyJmXruMsBqo TrCWBQ2Uv9SBELgrKvouUQj+Ym2bgMo6atLffZr+8t/meOzhmQtkDLdTko01UkXMx0Ck 4Z4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si3323590plt.310.2019.08.15.21.46.58; Thu, 15 Aug 2019 21:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbfHPEow (ORCPT + 99 others); Fri, 16 Aug 2019 00:44:52 -0400 Received: from verein.lst.de ([213.95.11.211]:52000 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfHPEow (ORCPT ); Fri, 16 Aug 2019 00:44:52 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B1DD368AFE; Fri, 16 Aug 2019 06:44:48 +0200 (CEST) Date: Fri, 16 Aug 2019 06:44:48 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Jerome Glisse , Dan Williams , Christoph Hellwig , Ben Skeggs , Felix Kuehling , Ralph Campbell , "linux-mm@kvack.org" , "nouveau@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk Message-ID: <20190816044448.GB4093@lst.de> References: <20190814132746.GE13756@mellanox.com> <20190815180325.GA4920@redhat.com> <20190815194339.GC9253@redhat.com> <20190815203306.GB25517@redhat.com> <20190815204128.GI22970@mellanox.com> <20190815205132.GC25517@redhat.com> <20190816004303.GC9929@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190816004303.GC9929@mellanox.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 16, 2019 at 12:43:07AM +0000, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 04:51:33PM -0400, Jerome Glisse wrote: > > > struct page. In this case any way we can update the > > nouveau_dmem_page() to check that page page->pgmap == the > > expected pgmap. > > I was also wondering if that is a problem.. just blindly doing a > container_of on the page->pgmap does seem like it assumes that only > this driver is using DEVICE_PRIVATE. > > It seems like something missing in hmm_range_fault, it should be told > what DEVICE_PRIVATE is acceptable to trigger HMM_PFN_DEVICE_PRIVATE > and fault all others? The whole device private handling in hmm and migrate_vma seems pretty broken as far as I can tell, and I have some WIP patches. Basically we should not touch (or possibly eventually call migrate to ram eventually in the future) device private pages not owned by the caller, where I try to defined the caller by the dev_pagemap_ops instance.