Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1063616ybz; Wed, 22 Apr 2020 12:52:11 -0700 (PDT) X-Google-Smtp-Source: APiQypLGeX8ODaEuIzy4DKm1OzzToQI5zKqap5pn9pQyhcMvPLYjb0Y4yOMOyJdPgIvHgK7Xbeob X-Received: by 2002:a05:6402:2032:: with SMTP id ay18mr232062edb.16.1587585131048; Wed, 22 Apr 2020 12:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587585131; cv=none; d=google.com; s=arc-20160816; b=HEqvAJJOoynE+mL6SNTQKeohwP5OywBHwstmrIVUIuyoqQoxVE5AFPEG6xh1Bq2wSl oWwjne7Fc7uXi3u7/L7/TtfF5DTIchBv3hOSSY+L7TgqGFlPSuiBQYaNDW4+OkU793b4 YzxDcz0eTCBv2t13dgoHfHN4ERuq4J/82TL1mOVMXomjmuHjEsxJqkhjkfKS+eUXWryl a/Mf/Ls71GsmsT5Kls7ipELInhsxEFknHVTnQL1vXmGay+HyTUpVB2aq6UdIqEOJA9EA PZSSR+qD+fIg8wNNjX7i/X5/We+mJLWh6AVZ/XO5G+Ty7Qzoog6DoLWBYO4cCNcf05lf q4PQ== 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=tQslaTxOwr/1HMEaEgJ5onqwCDIFWBtI9FSraeL17vE=; b=kE8M3n59C1arZ3ipub/tnxLla3mLuoH7S9n3kAI/LhRsW2Ejbcbamohp+SkDfOJRRM y/iD4/N7g+z+C6c4ELU0VkWtVefSJGmDqT3019tUoxBFmZuj9fLpGHkfurDW6NT6xaDV g0DLewxG954nVQNRpU2AeVx+pnFCqjBGqu992Xy7PbBBd9wtH+OC15/THrNNqZTaTsUg gC1YeLwUoLs58YJC7GlIbZhMfvnolde+blmHMjH1knn8xDB2VBruGYSOv0kFxzcPBrQR fW2Rfu+C4f5NhhzIFmP9cHf81ISfBNm+LVrmNPIAkm7G7SIhuwY4/J2MYQ3kqggFtQhv vPbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=CrwTNWk1; 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 y9si70852edv.534.2020.04.22.12.51.47; Wed, 22 Apr 2020 12:52:11 -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=CrwTNWk1; 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 S1726558AbgDVTur (ORCPT + 99 others); Wed, 22 Apr 2020 15:50:47 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:18200 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgDVTuq (ORCPT ); Wed, 22 Apr 2020 15:50:46 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 22 Apr 2020 12:48:49 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 22 Apr 2020 12:50:45 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 22 Apr 2020 12:50:45 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 22 Apr 2020 19:50:42 +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; Wed, 22 Apr 2020 19:50:42 +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 ; Wed, 22 Apr 2020 12:50:41 -0700 From: Ralph Campbell To: , , , CC: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , "Andrew Morton" , Shuah Khan , "Ralph Campbell" Subject: [PATCH v10 0/3] mm/hmm/test: add self tests for HMM Date: Wed, 22 Apr 2020 12:50:25 -0700 Message-ID: <20200422195028.3684-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1587584929; bh=tQslaTxOwr/1HMEaEgJ5onqwCDIFWBtI9FSraeL17vE=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; b=CrwTNWk1dZywtqSd01Bo2vOEtMf3n/uUsh1ixYuiEWppZn3keB2tB/VQEPVoUpA5v KUiXQn4GrXWDydsaGiakqTXFIIoR+jp9aj3tyBGUT39mQux/CC03+C8USTw0WXK2zY 0O9AFfNlnRhW4VOHPfDPCTvSeinFEsGuWcQA/xDx4wLV+leIcTi4GoGAadIovezCoA wH03q0sJCUwewqvItWB6VXXm7AbtlIFXeOqzK7rfbwKYNeXsys1/tJnw2mBAbc5zbK q6LxnN787j7EB2NVneac6uy4bdiKvzTGXkTgDXOCIP9yoqtArI6305jqhyqdI8O7O0 J39dQuuPpNAfg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds basic self tests for HMM and are intended for Jason Gunthorpe's rdma tree since he is making some HMM related changes that this can help test. Changes v9 -> v10: Patches 1 & 2 include Jason's changes from his cover letter: https://lkml.org/lkml/2020/4/21/1320 Patch 3 now adds the files alphbetically and removed the outdated reference to include/uapi/linux. Changes v8 -> v9: Rebased to linux-5.7.0-rc1. Moved include/uapi/linux/test_hmm.h to lib/test_hmm_uapi.h Added calls to release_mem_region() to free device private addresses Applied Jason's suggested changes for v8. Added a check for no VMA read access before migrating to device private memory. Changes v7 -> v8: Rebased to Jason's rdma/hmm tree, plus Jason's 6 patch series "Small hmm_range_fault() cleanups". Applied a number of changes from Jason's comments. Changes v6 -> v7: Rebased to linux-5.6.0-rc6 Reverted back to just using mmu_interval_notifier_insert() and making this series only introduce HMM self tests. Changes v5 -> v6: Rebased to linux-5.5.0-rc6 Refactored mmu interval notifier patches Converted nouveau to use the new mmu interval notifier API Changes v4 -> v5: Added mmu interval notifier insert/remove/update callable from the invalidate() callback Updated HMM tests to use the new core interval notifier API Changes v1 -> v4: https://lore.kernel.org/linux-mm/20191104222141.5173-1-rcampbell@nvidia.com Ralph Campbell (3): mm/hmm/test: add selftest driver for HMM mm/hmm/test: add selftests for HMM MAINTAINERS: add HMM selftests MAINTAINERS | 2 + lib/Kconfig.debug | 13 + lib/Makefile | 1 + lib/test_hmm.c | 1149 ++++++++++++++++++++ lib/test_hmm_uapi.h | 59 + tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile | 3 + tools/testing/selftests/vm/config | 2 + tools/testing/selftests/vm/hmm-tests.c | 1359 ++++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests | 16 + tools/testing/selftests/vm/test_hmm.sh | 97 ++ 11 files changed, 2702 insertions(+) create mode 100644 lib/test_hmm.c create mode 100644 lib/test_hmm_uapi.h create mode 100644 tools/testing/selftests/vm/hmm-tests.c create mode 100755 tools/testing/selftests/vm/test_hmm.sh --=20 2.25.2