Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4875990pjb; Mon, 27 Jul 2020 07:22:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzs3ghw406tSEC/aTmaTDoke5WsLBQlTXMSXCX4NuSRHA0IMklpvOMLFFA4NgXhlUu6R+j X-Received: by 2002:a17:906:6dd7:: with SMTP id j23mr20585712ejt.529.1595859762753; Mon, 27 Jul 2020 07:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859762; cv=none; d=google.com; s=arc-20160816; b=jAQQ/iFasMLBQTiBBNyMRGHXTMxwSX6a3+k0SlS6dwjfAWwYzceTRc98RFmoY4qKA8 fJS7Ycoei4PH2g7bQAeOm+UqtOXfqhUbTuRgFks430UBo9Wbl8pJeURDHPzU5NnTzblq Bqa1+eCn0TYEulhfX97vnFqWqcmfSxlKCqpf6Zotd6txIl6d2zkm7PBY+XHjiCQIF0BU YpR98T0Om/mgiXclSsJZ6eHUqpN6tuoCHX+6xRjy26nSfmf+ScZECPNi1oyTrTqiKE+W EBEVO/51DuWYB0Iav+CKQIhTfDFx6i5/wHM8b0PsrHrBuWnQZ5tKZRN1MtG2E9Uawf9n G4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h0Uw/elsA572bGc+MaldQEpvVulF5Ua7edFkWWvsuTA=; b=Eu13rUg/l50FeL8/jVFRoxHfaza1gmQJ6KyiMRI9PTq50YaLJI1otEPzdNlDtEH8wc dBTqPOj8y1M5EGXw7no8UXiHjc1ZRTowjTtD4puYvYJPfIY6FM4y4Z2EUvGhANMPt6LT vPFta5KlaLP0b23suD1VrMsxLjtd3ARy7EdagkA8htCBDXSyMz1WLjvHPD4xTQ7xSq0W qyIOhHCKotjbUmtdZV1pQnJbQdyDOrPVpwNNR1hrNwy3vIFlTnB6fz2q9WOGZOiqJssz L61/1sNAnc9tYNJlEUYHqDOMSVcY1izhdpxAbamwMq918QXyZsfE1SYqyLbB81a5Z/nA 2YNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zZwktswB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce15si1420197edb.201.2020.07.27.07.22.19; Mon, 27 Jul 2020 07:22:42 -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=@kernel.org header.s=default header.b=zZwktswB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731635AbgG0OUy (ORCPT + 99 others); Mon, 27 Jul 2020 10:20:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:49240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731588AbgG0OUt (ORCPT ); Mon, 27 Jul 2020 10:20:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DBE7D2075A; Mon, 27 Jul 2020 14:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859648; bh=XPOZuHx0Bmu2whHdaFaD9f4tjNBNzx0/U0ksny33t6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zZwktswBqrsV+FKW8ZdJOEvXNq/Q2uE5W6GTxIPvGYQAYePqQQV4j+HWZR2Lw+Vhi ZPiGMbW0EMHmu2fTTSvGWuXFPJTyDc5Y6+KTEh5au7szghK+0scgcAxDMWTSx7GaVw gYK6DP4PjD4Bun+xFQ4ZsthQVin42ZREbSIsemMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ralph Campbell , Jason Gunthorpe , Ben Skeggs , Sasha Levin Subject: [PATCH 5.7 021/179] drm/nouveau/nouveau: fix page fault on device private memory Date: Mon, 27 Jul 2020 16:03:16 +0200 Message-Id: <20200727134933.700692019@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ralph Campbell [ Upstream commit ed710a6ed797430026aa5116dd0ab22378798b69 ] 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()") Cc: stable@vger.kernel.org Signed-off-by: Ralph Campbell Reviewed-by: Jason Gunthorpe Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- 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 645fedd77e21b..a9ce86740799f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_svm.c +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -534,6 +534,7 @@ static int nouveau_range_fault(struct nouveau_svmm *svmm, .flags = nouveau_svm_pfn_flags, .values = nouveau_svm_pfn_values, .pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT, + .dev_private_owner = drm->dev, }; struct mm_struct *mm = notifier->notifier.mm; long ret; -- 2.25.1