alison.schofield@ wrote:
> 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.

CXL looks like a useful replacement.

> 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")"

Might as well skip using cxl-list and instead use the known
platform device hosting the cxl_test CXL topology: "cxl_acpi.0"

    region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | 
contains(\"cxl_acpi.0\")) | .id")"

...other than that you can add:

Reviewed-by: Dan Williams <[email protected]>

Reply via email to