Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp30467ybt; Tue, 30 Jun 2020 14:09:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVLuhPStqxzjP0DNhHgyzggcVTfbsdNhEUX7rOAKpSYnQ+ugHxN2/N28Gh0CEiEQZQF28D X-Received: by 2002:a17:906:6a14:: with SMTP id o20mr20436734ejr.128.1593550911610; Tue, 30 Jun 2020 14:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593550911; cv=none; d=google.com; s=arc-20160816; b=dGldGlJl2E4WPmmiNntPBDm8gXA3WZ0Meb9AU/xnpLb5fB0lH8HRByL4eqgenn30aO nP9PnyUEZQtHVeskEnQmCJBZ+m8UUrNpgFM5votcMXY5cQnfcJMWoUZPUAoebI4dBu29 d5MCmNdkiqGbGM3BcWMCtvYcF4t68XGHSOZZnP6o1eUiQz3sPwUO1hPjSNu1ej9EpO6F 1Ap9LwjCE5Xg6k4TnTzJSrDzd4zgXuWr3R/4CJ2trwe44aZKx37ltAXGoDiSMo7pLJ+S W8mxbnVlT3tVRT/KbxF3mAAPtzf2akPyOsMSghrAxQaQyRvQsNULjpcZToNko8yhT4XG YJzw== 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 :mime-version:message-id:date:subject:cc:to:from; bh=98oQk6P7sljyBfLagdhiCZSymARD8p0G5MvhlqPtOuI=; b=Z9UPcbWOAWISSJpWjsI1L2V7uH+U4v2zhfY/ab0BIjNyu3br2gpXnuhMJwpO+M7DwJ 2pXp2ulVEJqunTvkQWkxsXohzzZDxWzG8lX34qvGowOUux7SWJmirOSJzZPmlm1P3GsW SFVzY60zF46cy/+uWYlg1Hp7fWYeGPdYih5aBfCrBAKq3w/7tc0rwiTawQ4+0M9q6ZHX 9QH3fgj6pBF6v/QWrWDKyMZl5+XKtL9ACk6HlHZ8KU9/S1gMOVBAev9H17hVxlArX0wU MrykuCM93qLM1KStStDn77cQmFI7tHyUTbaHfx5572nhZ4o/Zqu1YiW4uwM0Ob6luAth C0IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=hrPV+ZVB; 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 f14si2363801edm.269.2020.06.30.14.01.28; Tue, 30 Jun 2020 14:01:51 -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=hrPV+ZVB; 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 S1728907AbgF3T6R (ORCPT + 99 others); Tue, 30 Jun 2020 15:58:17 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:19054 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728842AbgF3T6Q (ORCPT ); Tue, 30 Jun 2020 15:58:16 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 30 Jun 2020 12:58:02 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 30 Jun 2020 12:58:15 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 30 Jun 2020 12:58:15 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 30 Jun 2020 19:58:07 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 30 Jun 2020 19:58:07 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 30 Jun 2020 12:58:07 -0700 From: Ralph Campbell To: , , , , CC: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , "Andrew Morton" , Shuah Khan , "Ben Skeggs" , Ralph Campbell Subject: [PATCH v2 0/5] mm/hmm/nouveau: add PMD system memory mapping Date: Tue, 30 Jun 2020 12:57:32 -0700 Message-ID: <20200630195737.8667-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1593547082; bh=98oQk6P7sljyBfLagdhiCZSymARD8p0G5MvhlqPtOuI=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Transfer-Encoding: Content-Type; b=hrPV+ZVB0MZZj74Ygk9F8iCc0v3Ioc8Uq7yJvHmvkGMSxfeHrott/ebMNWV4E7Klo nLVevppXcSr0gOa5ghpgHjZ8BJU4dDL3JwmCywTJnxCxOMybTJGN0SeL8TgySRz8ul nehOkehgeVx8Vuk9OiHHmgSVrnjZAMyAtj22W2kYZqu5vs3MD5ul5+gjpsOzhsSsP2 gEATZDFV1CIoaMm4QkC+mpxV7nJ8AfWtL7W4ZvPMzIxL5erMUDv7XSpU3DjbKz8MaI UGOphT1of9WD75YdGWOGdl7PvAelFIGQULYku2dA5/navSm3JyRTpJqQydqajcILqm 3HihpKmAGLvdw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The goal for this series is to introduce the hmm_range_fault() output array flags HMM_PFN_PMD and HMM_PFN_PUD. This allows a device driver to know that a given 4K PFN is actually mapped by the CPU using either a PMD sized or PUD sized CPU page table entry and therefore the device driver can safely map system memory using larger device MMU PTEs. The series is based on 5.8.0-rc3 and is intended for Jason Gunthorpe's hmm tree. These were originally part of a larger series: https://lore.kernel.org/linux-mm/20200619215649.32297-1-rcampbell@nvidia.co= m/ Changes in v2: Make the hmm_range_fault() API changes into a separate series and add two output flags for PMD/PUD instead of a single compund page flag as suggested by Jason Gunthorpe. Make the nouveau page table changes a separate patch as suggested by Ben Skeggs. Only add support for 2MB nouveau mappings initially since changing the 1:1 CPU/GPU page table size assumptions requires a bigger set of changes. Rebase to 5.8.0-rc3. Ralph Campbell (5): nouveau/hmm: fault one page at a time mm/hmm: add output flags for PMD/PUD page mapping nouveau: fix mapping 2MB sysmem pages nouveau/hmm: support mapping large sysmem pages hmm: add tests for HMM_PFN_PMD flag drivers/gpu/drm/nouveau/nouveau_svm.c | 238 ++++++++---------- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 5 +- .../drm/nouveau/nvkm/subdev/mmu/vmmgp100.c | 82 ++++++ include/linux/hmm.h | 11 +- lib/test_hmm.c | 4 + lib/test_hmm_uapi.h | 4 + mm/hmm.c | 13 +- tools/testing/selftests/vm/hmm-tests.c | 76 ++++++ 8 files changed, 290 insertions(+), 143 deletions(-) --=20 2.20.1