From: Alison Schofield <[email protected]>

This test tries to use DAX regions created from efi_fake_mem devices.
A recent kernel change removed efi_fake_mem support causing this test
to SKIP because no DAX regions can be found.

Alas, a new source of DAX regions is available: CXL. Use that now.
Other than selecting a different region provider, the functionality
of the test remains the same.

Signed-off-by: Alison Schofield <[email protected]>
---
 test/daxctl-create.sh | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
index d968e7bedd82..1ef70f2ff186 100755
--- a/test/daxctl-create.sh
+++ b/test/daxctl-create.sh
@@ -7,6 +7,9 @@ rc=77
 
 trap 'cleanup $LINENO' ERR
 
+modprobe -r cxl_test
+modprobe cxl_test
+
 cleanup()
 {
        printf "Error at line %d\n" "$1"
@@ -18,18 +21,10 @@ find_testdev()
 {
        local rc=77
 
-       # The hmem driver is needed to change the device mode, only
-       # kernels >= v5.6 might have it available. Skip if not.
-       if ! modinfo dax_hmem; then
-               # check if dax_hmem is builtin
-               if [ ! -d "/sys/module/device_hmem" ]; then
-                       printf "Unable to find hmem module\n"
-                       exit $rc
-               fi
-       fi
+       # find a victim region provided by cxl_test
+       bus="$("$CXL" list -b "$CXL_TEST_BUS" | jq -r '.[] | .bus')"
+       region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | 
contains(\"$bus\")) | .id")"
 
-       # find a victim region provided by dax_hmem
-       region_id="$("$DAXCTL" list -R | jq -r '.[] | select(.path | 
contains("hmem")) | .id')"
        if [[ ! "$region_id" ]]; then
                printf "Unable to find a victim region\n"
                exit "$rc"
@@ -413,4 +408,5 @@ daxctl_test5
 daxctl_test6
 daxctl_test7
 reset_dev
+modprobe -r cxl_test
 exit 0
-- 
2.37.3


Reply via email to