Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp779784ybt; Fri, 26 Jun 2020 11:20:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH8WLtRaIEHdTPvjW8jzyAwm3A1d6qlrn3KvH4NUynzD1aUrsxBX1sXQG9SLT3cLG0DR7Y X-Received: by 2002:a17:907:7283:: with SMTP id dt3mr3806037ejc.195.1593195613318; Fri, 26 Jun 2020 11:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195613; cv=none; d=google.com; s=arc-20160816; b=gBb6gb+DFKEt6Qg9mCYxg81/tn0hW2lexdMdGvEUt8hVTns8Ki648CCYXsHKtV25ud nguBdBmO3RLKsk8ONanu4Y4dKOT5dLtwK77E1U77TtTty3rx5HN1AOiRHNFMewa83ORK LvV0qbygFE0oIe0eqCeYAxglKj/+Gl/j3NCaMAVq964KvV9liqDx8ZKi4F3fOGdQzr7N EtrTDfHgM/T/CXzv52y1x0ABOc/h39UucSloJFpYb1mmMMTqC9y/WFeW4bn5hX1r9gKy nurReO8R4S2BMiZT0fuG9hd7nuxRCyEzLVRxxUNBlfJKYCPYJUfbJMux7g05hB4soOri P3GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lF0NHlRJ9U5vcuOjDQlU6SK5ZMyTZW7c0DGF0OGH/Zk=; b=G7R+X1s5SwokjnoR5R7mWXcgn1tizcNKi93A36FqrsPfOD6YyTwynXobWw8kejxkr7 Yi1mVcZV5+K9+Z6mJMPZ61k+kcxxR1AC8xP3avRgZLgsZ01SlI5roo4iq/L/Lvq0KE8l WUHjyCErr/W090/Gf+9I839GSw3CIVeP23DDk93W6U02QQDlO6VS+RGar3Id/JPAHHak xPLmoEHk6Ww6S9AD2PIiSp2S2NO5KkO8pRSNkuQZEg2TirlKFHOU/BhpqhOMO9/qb+pf w1WOY4z9ngCt478zOWEVX1/L4fi36AzCGk/+MY98dGamMTbCFxalEAiMd6mQk+lEtkQU bQdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=O4G6ngbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rk8si8116963ejb.578.2020.06.26.11.19.50; Fri, 26 Jun 2020 11:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=O4G6ngbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725952AbgFZSFW (ORCPT + 99 others); Fri, 26 Jun 2020 14:05:22 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:16501 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgFZSFW (ORCPT ); Fri, 26 Jun 2020 14:05:22 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 26 Jun 2020 11:03:46 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 26 Jun 2020 11:05:21 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 26 Jun 2020 11:05:21 -0700 Received: from [10.2.63.78] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 26 Jun 2020 18:05:15 +0000 Subject: Re: [PATCH] nouveau: fix page fault on device private memory To: Ralph Campbell , , CC: Jerome Glisse , Christoph Hellwig , "Jason Gunthorpe" , Ben Skeggs References: <20200626172626.19207-1-rcampbell@nvidia.com> From: John Hubbard Message-ID: <1c004a46-c818-7d4c-254a-60b5c932d67b@nvidia.com> Date: Fri, 26 Jun 2020 11:05:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200626172626.19207-1-rcampbell@nvidia.com> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1593194626; bh=lF0NHlRJ9U5vcuOjDQlU6SK5ZMyTZW7c0DGF0OGH/Zk=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=O4G6ngbUXmHGYZJL6ExQnArGPrlPdsrAjxo5lkbj+eLe08fYepTn8r9vQoNZFLSQd tv7Xiga8xgokzgyUttBf7ANP38MJDOqIIquNceGCrqlJppE5O7QnyKU/h+PI+sHZfb wQCUGSQD5jXGIelJeYWbtHBcN40BXMlhqdWCEcTRZ+u4mZWtRSrvrHusGqdm+AzsaD 0diHZdIFG1biwKMPJUgt9e1tZRExfHvuM2E5oxfq+wUQAGqCxnmUcwysBpP+2i02cS CjkxFAH0CHBFN04jAhAUKeoUqN6PCj8HAKk0j7m7vjvVLUgNxM+PNCZHFfIT+1zS2O O1ZMCjb6/0arA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-26 10:26, Ralph Campbell wrote: > If system memory is migrated to device private memory and no GPU MMU > page table entry exists, the GPU will fault and call hmm_range_fault() > to get the PFN for the page. Since the .dev_private_owner pointer in > struct hmm_range is not set, hmm_range_fault returns an error which > results in the GPU program stopping with a fatal fault. > Fix this by setting .dev_private_owner appropriately. > > Fixes: 08ddddda667b ("mm/hmm: check the device private page owner in hmm_range_fault()") > Signed-off-by: Ralph Campbell > --- > > This is based on Linux-5.8.0-rc2 and is for Ben Skeggs nouveau tree. > It doesn't depend on any of the other nouveau/HMM changes I have > recently posted. Maybe cc stable, seeing as how the problem affect Linux 5.7? thanks, -- John Hubbard NVIDIA > > drivers/gpu/drm/nouveau/nouveau_svm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c > index ba9f9359c30e..6586d9d39874 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_svm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c > @@ -562,6 +562,7 @@ static int nouveau_range_fault(struct nouveau_svmm *svmm, > .end = notifier->notifier.interval_tree.last + 1, > .pfn_flags_mask = HMM_PFN_REQ_FAULT | HMM_PFN_REQ_WRITE, > .hmm_pfns = hmm_pfns, > + .dev_private_owner = drm->dev, > }; > struct mm_struct *mm = notifier->notifier.mm; > int ret; >