From patchwork Thu Feb 10 07:28:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12741509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41043C433F5 for ; Thu, 10 Feb 2022 07:29:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 304A66B009C; Thu, 10 Feb 2022 02:29:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 28F856B009D; Thu, 10 Feb 2022 02:29:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DFFA6B009E; Thu, 10 Feb 2022 02:29:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id D4AE66B009C for ; Thu, 10 Feb 2022 02:29:49 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 952188EBFC for ; Thu, 10 Feb 2022 07:29:49 +0000 (UTC) X-FDA: 79126045698.08.E2C2F17 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf12.hostedemail.com (Postfix) with ESMTP id 48FFC40007 for ; Thu, 10 Feb 2022 07:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=qEJvj5jIf4S2MMMr/LCtNMMTetslKbN5u1yu7P0vC9s=; b=vn+OWGtap6VYEoG92ZooJ0bvla mmvPM0x/Yox9Lw9LkikggBrhRLW/t0Hs2bZw/Qa+3BtN1stiXq6aSq5vUF0ntrKwYptxczmT6j0nq TWMhhcEOZI6z1g5YhO4edwzohWtxHx8gEI+3jxYOhyPFf9jT7cn2rRLyB8peuKn/YPyHrexxb1hGn Vl08Iv7L2hPj1p1SLDIBT+kLFy2guxYBOhjfAT92E9PSYFNISIj7CpUvGRdoTmPx0M8eNGn4vO0Hm 2jvMX48znRqF5CuJBmuaUeZihzInnJleJZ56fREz+drkHW+Z5IbC8O3x7Hqtew5LyXSn8EkLn4Eod eigVubWw==; Received: from [2001:4bb8:188:3efc:8014:b2f2:fdfd:57ea] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nI3tb-002sN2-C3; Thu, 10 Feb 2022 07:29:39 +0000 From: Christoph Hellwig To: Andrew Morton , Dan Williams Cc: Felix Kuehling , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , Ben Skeggs , Karol Herbst , Lyude Paul , Jason Gunthorpe , Alistair Popple , Logan Gunthorpe , Ralph Campbell , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, Alex Sierra Subject: [PATCH 24/27] tools: update test_hmm script to support SP config Date: Thu, 10 Feb 2022 08:28:25 +0100 Message-Id: <20220210072828.2930359-25-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220210072828.2930359-1-hch@lst.de> References: <20220210072828.2930359-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 48FFC40007 X-Stat-Signature: s84jf7bbswypkm9ribomi7r6nys93ta8 X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=vn+OWGta; spf=none (imf12.hostedemail.com: domain of BATV+4801fb5fa93fa27e8109+6745+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+4801fb5fa93fa27e8109+6745+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Rspamd-Server: rspam05 X-HE-Tag: 1644478189-627854 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Alex Sierra Add two more parameters to set spm_addr_dev0 & spm_addr_dev1 addresses. These two parameters configure the start SP addresses for each device in test_hmm driver. Consequently, this configures zone device type as coherent. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair Popple Signed-off-by: Christoph Hellwig --- tools/testing/selftests/vm/test_hmm.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/test_hmm.sh b/tools/testing/selftests/vm/test_hmm.sh index 0647b525a62564..539c9371e592a1 100755 --- a/tools/testing/selftests/vm/test_hmm.sh +++ b/tools/testing/selftests/vm/test_hmm.sh @@ -40,11 +40,26 @@ check_test_requirements() load_driver() { - modprobe $DRIVER > /dev/null 2>&1 + if [ $# -eq 0 ]; then + modprobe $DRIVER > /dev/null 2>&1 + else + if [ $# -eq 2 ]; then + modprobe $DRIVER spm_addr_dev0=$1 spm_addr_dev1=$2 + > /dev/null 2>&1 + else + echo "Missing module parameters. Make sure pass"\ + "spm_addr_dev0 and spm_addr_dev1" + usage + fi + fi if [ $? == 0 ]; then major=$(awk "\$2==\"HMM_DMIRROR\" {print \$1}" /proc/devices) mknod /dev/hmm_dmirror0 c $major 0 mknod /dev/hmm_dmirror1 c $major 1 + if [ $# -eq 2 ]; then + mknod /dev/hmm_dmirror2 c $major 2 + mknod /dev/hmm_dmirror3 c $major 3 + fi fi } @@ -58,7 +73,7 @@ run_smoke() { echo "Running smoke test. Note, this test provides basic coverage." - load_driver + load_driver $1 $2 $(dirname "${BASH_SOURCE[0]}")/hmm-tests unload_driver } @@ -75,6 +90,9 @@ usage() echo "# Smoke testing" echo "./${TEST_NAME}.sh smoke" echo + echo "# Smoke testing with SPM enabled" + echo "./${TEST_NAME}.sh smoke " + echo exit 0 } @@ -84,7 +102,7 @@ function run_test() usage else if [ "$1" = "smoke" ]; then - run_smoke + run_smoke $2 $3 else usage fi