2 # SPDX-License-Identifier: GPL-2.0
4 # Copyright (C) 2018 Uladzislau Rezki (Sony) <urezki@gmail.com>
6 # This is a test script for the kernel test driver to analyse vmalloc
7 # allocator. Therefore it is just a kernel module loader. You can specify
8 # and pass different parameters in order to:
9 # a) analyse performance of vmalloc allocations;
10 # b) stressing and stability check of vmalloc subsystem.
18 # Kselftest framework requirement - SKIP code is 4.
21 check_test_requirements()
24 if [ $uid -ne 0 ]; then
25 echo "$0: Must be run as root"
29 if ! which modprobe > /dev/null 2>&1; then
30 echo "$0: You need modprobe installed"
34 if ! modinfo $DRIVER > /dev/null 2>&1; then
35 echo "$0: You must have the following enabled in your kernel:"
36 echo "CONFIG_TEST_HMM=m"
44 modprobe $DRIVER > /dev/null 2>&1
47 modprobe $DRIVER spm_addr_dev0=$1 spm_addr_dev1=$2
50 echo "Missing module parameters. Make sure pass"\
51 "spm_addr_dev0 and spm_addr_dev1"
59 modprobe -r $DRIVER > /dev/null 2>&1
64 echo "Running smoke test. Note, this test provides basic coverage."
67 $(dirname "${BASH_SOURCE[0]}")/hmm-tests
77 echo "# Shows help message"
78 echo "./${TEST_NAME}.sh"
80 echo "# Smoke testing"
81 echo "./${TEST_NAME}.sh smoke"
83 echo "# Smoke testing with SPM enabled"
84 echo "./${TEST_NAME}.sh smoke <spm_addr_dev0> <spm_addr_dev1>"
94 if [ "$1" = "smoke" ]; then
102 check_test_requirements