Skip to contentSkip to conversation

Questions on getting started

DISCUSSION Eric DeVolder 2 participants 4 messages May 5, 2023 – Jun 20, 2023

lore
Share & tools
lore
#0 lore raw

Hi,
I'm new to CXL and have spent time browsing linux-cxl traffic to get an idea of where to start. I thought that running the tools/testing/cxl was a good place, seeing as I don't yet have any hardware on hand.

Through various nuggets within the linux-cxl messages, I landed on the following:

https://docs.pmem.io/ndctl-user-guide/installing-ndctl/installing-ndctl-from-source-on-linux

Following the instructions within, I was able to observe the running of the CXL related tests.

git clone https://github.com/pmem/ndctl
cd ndctl
rm -fr build
meson setup build \
-Dlibtracevent=disabled \
-Dlibtracefs=disabled \
-Dtest=enabled
meson compile -C build

git clone -b libnvdimm-for-next git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
cd nvdimm
make oldconfig
make -j32
make -j8 INSTALL_MOD_STRIP=1 modules_install install
make M=tools/testing/nvdimm
make M=tools/testing/nvdimm modules_install INSTALL_MOD_DIR=updates
make M=tools/testing/cxl
make M=tools/testing/cxl modules_install INSTALL_MOD_DIR=updates
make -j8 INSTALL_MOD_STRIP=1 modules_install

reboot into this kernel 6.0.0-rc6

cd ndctl
meson test -C build --suite cxl [root@localhost ndctl]# meson test -C build --suite cxl
ninja: Entering directory `/root/ndctl/build' [1/51] Generating version.h with a custom command

[   44.899562] cxl_core: loading out-of-tree module taints kernel.s
[   44.901116] cxl_core: loading test module taints kernel.
1/6 ndctl:cxl / cxl-topology.sh             OK               4.78s
[   49.668891] cxl_mem mem0: at cxl_root_port.0 no parent for dport: platform
[   49.672223] cxl_mem mem1: at cxl_root_port.1 no parent for dport: platform
[   49.674894] cxl_mem mem2: at cxl_root_port.2 no parent for dport: platform
[   49.676408] cxl_mem mem3: at cxl_root_port.3 no parent for dport: platform
[   49.678195] cxl_mem mem4: at cxl_root_port.0 no parent for dport: platform
[   49.679867] cxl_mem mem5: at cxl_root_port.1 no parent for dport: platform
[   49.681792] cxl_mem mem6: at cxl_root_port.2 no parent for dport: platform
[   49.684221] cxl_mem mem7: at cxl_root_port.3 no parent for dport: platform
2/6 ndctl:cxl / cxl-region-sysfs.sh         OK               3.67s
[   53.342170] cxl_mem mem0: at cxl_root_port.0 no parent for dport: platform
[   53.344181] cxl_mem mem1: at cxl_root_port.1 no parent for dport: platform
[   53.347003] cxl_mem mem2: at cxl_root_port.2 no parent for dport: platform
[   53.349285] cxl_mem mem3: at cxl_root_port.3 no parent for dport: platform
[   53.351029] cxl_mem mem4: at cxl_root_port.0 no parent for dport: platform
[   53.353070] cxl_mem mem5: at cxl_root_port.1 no parent for dport: platform
[   53.361240] cxl_mem mem6: at cxl_root_port.2 no parent for dport: platform
[   53.363233] cxl_mem mem7: at cxl_root_port.3 no parent for dport: platform
3/6 ndctl:cxl / cxl-labels.sh               OK               1.74s
[   55.081505] cxl_mem mem0: at cxl_root_port.0 no parent for dport: platform
[   55.088292] cxl_mem mem1: at cxl_root_port.1 no parent for dport: platform
[   55.090247] cxl_mem mem2: at cxl_root_port.2 no parent for dport: platform
[   55.092098] cxl_mem mem3: at cxl_root_port.3 no parent for dport: platform
[   55.094250] cxl_mem mem4: at cxl_root_port.0 no parent for dport: platform
[   55.096137] cxl_mem mem5: at cxl_root_port.1 no parent for dport: platform
[   55.098096] cxl_mem mem6: at cxl_root_port.2 no parent for dport: platform
[   55.101479] cxl_mem mem7: at cxl_root_port.3 no parent for dport: platform
4/6 ndctl:cxl / cxl-create-region.sh        OK               3.79s
[   58.868068] cxl_test: unknown parameter 'interleave_arithmetic' ignored
[   58.870435] cxl_mem mem1: at cxl_root_port.0 no parent for dport: platform
[   58.872472] cxl_mem mem3: at cxl_root_port.1 no parent for dport: platform
[   58.874508] cxl_mem mem5: at cxl_root_port.2 no parent for dport: platform
[   58.876442] cxl_mem mem7: at cxl_root_port.3 no parent for dport: platform
[   58.878542] cxl_mem mem8: at cxl_root_port.0 no parent for dport: platform

[5/6] 🌓 nd[ 58.880934] cxl_mem mem9: at cxl_root_port.1 no parent for dport:m
ctl:cxl / cxl-xo[ 58.883167] cxl_mem mem10: at cxl_root_port.2 no parent for m
r-region.sh [ 58.885336] cxl_mem mem11: at cxl_root_port.3 no parent for m
5/6 ndctl:cxl / cxl-xor-region.sh FAIL 1.07s exit statu1

Quoted 1 line
Quoted 1 line
Quoted 1 line

NDCTL=/root/ndctl/build/ndctl/ndctl DAXCTL=/root/ndctl/build/daxctl/daxctl h

6/6 ndctl:cxl / cxl-security.sh SKIP 0.03s exit statu7

Ok:                 4
Expected Fail:      0
Fail:               1
Unexpected Pass:    0
Skipped:            1
Timeout:            0

Full log written to /root/ndctl/build/meson-logs/testlog.txt

OK! Now, if I repeat the above steps, but with recently tagged 6.3 (perhaps thinking it would yield a passing suite):

[root@localhost linux]# grep NVDIMM .config
CONFIG_LIBNVDIMM=m
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
CONFIG_NVDIMM_KEYS=y
CONFIG_NVDIMM_TEST_BUILD=m
CONFIG_NVDIMM_SECURITY_TEST=y

[root@localhost linux]# grep CXL .config
CONFIG_CXL_BUS=m
CONFIG_CXL_PCI=m
# CONFIG_CXL_MEM_RAW_COMMANDS is not set
CONFIG_CXL_ACPI=m
CONFIG_CXL_PMEM=m
CONFIG_CXL_MEM=m
CONFIG_CXL_PORT=m
CONFIG_CXL_SUSPEND=y
CONFIG_CXL_REGION=y
CONFIG_CXL_REGION_INVALIDATION_TEST=y
CONFIG_DEV_DAX_CXL=m

make oldconfig
make -j32
make -j8 INSTALL_MOD_STRIP=1 modules_install install make M=tools/testing/nvdimm
make M=tools/testing/nvdimm modules_install INSTALL_MOD_DIR=updates make M=tools/testing/cxl
make M=tools/testing/cxl modules_install INSTALL_MOD_DIR=updates make -j8 INSTALL_MOD_STRIP=1 modules_install

reboot into this kernel 6.3.0

cd ndctl
meson test -C build --suite cxl [root@localhost ndctl]# meson test -C build --suite cxl
ninja: Entering directory `/root/ndctl/build' [1/51] Generating version.h with a custom command

[   43.760734] cxl_core: loading out-of-tree module taints kernel.s
[   43.763128] cxl_core: loading test module taints kernel.
[   43.842714] platform cxl_host_bridge.0: host supports CXL
[   43.844520] platform cxl_host_bridge.1: host supports CXL
[   43.845956] platform cxl_host_bridge.2: host supports CXL
[   43.847301] platform cxl_host_bridge.3: host supports CXL (restricted)
[   43.977427] Fallback order for Node 0: 0
[   43.977432] Built 1 zonelists, mobility grouping on.  Total pages: 1921387
[   43.981915] Policy zone: Normal
[   44.020453] systemd-udevd[5549]: segfault at 2d8 ip 00007fe6821188fb sp 00007ffc23b3ddf8 error 6 in libc.so.6[7fe682028000+175000] likely on CPU 10 (core 10, socket 0)
[   44.026953] Code: 38 00 00 00 0f 05 48 3d 00 f0 ff ff 77 39 41 89 c0 85 c0 75 2a 64 48 8b 04 25 10 00 00 00 be 18 00 00 00 48 8d b8 e0 02 00 00 <48> 89 b8 d8 02 00 00 48 89 b8 e0 02 00 00 b8 11 01 00 00 0f 05 44
[   44.030103] systemd-udevd[5546]: segfault at 0 ip 0000000000000000 sp 00007ffc23b3de00 error 14 in udevadm[555bc1b0b000+13000] likely on CPU 21 (core 21, socket 0)
[   44.037169] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   44.038736] systemd-udevd[5542]: segfault at 0 ip 0000000000000000 sp 00007ffc23b3de00 error 14 in udevadm[555bc1b0b000+13000] likely on CPU 16 (core 16, socket 0)
[   44.044359] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   44.054368] systemd-udevd[5521]: segfault at 0 ip 0000555bc1b4039c sp 00007ffc23b39640 error 4 in udevadm[555bc1b1e000+3c000] likely on CPU 3 (core 3, socket 0)
[   44.059207] Code: 00 49 89 f7 48 85 f6 0f 84 e1 01 00 00 48 83 bd f8 b6 ff ff 00 0f 84 f3 01 00 00 48 8b 77 20 49 89 fe 48 8b 5e 08 4c 8b 63 30 <41> 80 3c 24 30 0f 87 ce 49 00 00 41 0f b6 04 24 48 8d 15 8d 40 02
[   44.068095] systemd-udevd[5550]: segfault at 2d8 ip 00007fe6821188fb sp 00007ffc23b3ddf8 error 6 in libc.so.6[7fe682028000+175000] likely on CPU 15 (core 15, socket 0)
[   44.072347] Code: 38 00 00 00 0f 05 48 3d 00 f0 ff ff 77 39 41 89 c0 85 c0 75 2a 64 48 8b 04 25 10 00 00 00 be 18 00 00 00 48 8d b8 e0 02 00 00 <48> 89 b8 d8 02 00 00 48 89 b8 e0 02 00 00 b8 11 01 00 00 0f 05 44
[   44.077917] systemd-udevd[5551]: segfault at 2d8 ip 00007fe6821188fb sp 00007ffc23b3ddf8 error 6 in libc.so.6[7fe682028000+175000] likely on CPU 18 (core 18, socket 0)
[   44.082883] Code: 38 00 00 00 0f 05 48 3d 00 f0 ff ff 77 39 41 89 c0 85 c0 75 2a 64 48 8b 04 25 10 00 00 00 be 18 00 00 00 48 8d b8 e0 02 00 00 <48> 89 b8 d8 02 00 00 48 89 b8 e0 02 00 00 b8 11 01 00 00 0f 05 44
[   44.106770] systemd-udevd[5519]: segfault at 0 ip 0000000000000000 sp 00007ffc23b3de00 error 14 in udevadm[555bc1b0b000+13000] likely on CPU 1 (core 1, socket 0)
[   44.111751] Code: Unable to access opcode bytes at 0xffffffffffffffd6.

[1/6] 🌒 ndctl:cxl / cxl-topology.sh 1/600s

at which point I've lost the system and I have to reset it.

I suspect the faults in udevd have something to do with "plugging" in memory, but I don't have any ability to inspect after this point.

It appears to go boom when attempting the first test in the suite, cxl-topology.sh.

So some basic questions:

- Should the above sequence work with upstream kernel?
- Having noticed that the nvdimm.git kernel went dark, I thus tried the upstream kernel. However, from the mailing list I learned about https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git.
I have tried the same sequence with this kernel and a various few branches/tags. No luck. Is there a branch/tag here for which this sequence should work?
- As these tests utilize a mock driver to emulate various cxl component(s?), I have found that there is no need to run this on a system with CXL components (ie real hardware of qemu), correct?
- Is there other documentation for learning how to run CXL tests other than this pmem.io ndctl write-up?
- Is there a better/preferred way of running tests beyond this? I've seen reference to kdevops, but am equally confused as to what it can do (in part because it appears to use the above mock modules).

I have seen the email thread "Usage of tools/testing/cxl" started by Raghu H, but that didn't seem to answer his question (similar to mine), and instead pointed to run_qemu.sh. I've started to look into this, of course having some difficulty. Perhaps a quick overview of pros/cons of: tools/testing/cxl, kdevops, run_qemu.sh (and anything else that CXL developers use)?

I greatly appreciate insight/help in this regard!

Thanks,
eric

#1 lore raw
Quoted 2 lines · Eric DeVolder

Hi,
I'm new to CXL

Welcome!

Quoted 11 lines

and have spent time browsing linux-cxl traffic to get an idea of where to start. I thought that running the tools/testing/cxl was a good place, seeing as I don't yet have any hardware on hand.

Through various nuggets within the linux-cxl messages, I landed on the following:

https://docs.pmem.io/ndctl-user-guide/installing-ndctl/installing-ndctl-from-source-on-linux

Following the instructions within, I was able to observe the running of the CXL related tests.

[..]

Quoted 1 line

6/6 ndctl:cxl / cxl-security.sh SKIP 0.03s exit statu7

This skip is intermittent and should be fixed as of:

https://github.com/pmem/ndctl/commit/82a0cda5

...were you running with that?

[..]

Quoted 3 lines

OK! Now, if I repeat the above steps, but with recently tagged 6.3 (perhaps thinking it would yield a passing suite):

[..]

Quoted 4 lines

at which point I've lost the system and I have to reset it.

I suspect the faults in udevd have something to do with "plugging" in memory, but I don't have any ability to inspect after this point.

Yes, good insight. I have this setting locally, but the instructions need updating that as of commit:

e9ee9fe3a9d4 ("dax: Assign RAM regions to memory-hotplug by default")

...the test requires booting the kernel with:

memhp_default_state=offline

...or building the kernel with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=n

Quoted 1 line

It appears to go boom when attempting the first test in the suite, cxl-topology.sh.

This is because v6.3 adds a preconfigured ram-region. The test validates that the region is auto-assembled and ready to be onlined. Given there is no actual physical memory behind the fake address ranges used by cxl_test that final "online" step that would happen on real hardware needs to be skipped.

Quoted 3 lines

So some basic questions:

- Should the above sequence work with upstream kernel?

Yes, and with memhp_default_state=offline and ndctl v77 I get:

1/6 ndctl:cxl / cxl-topology.sh             OK              11.90s
2/6 ndctl:cxl / cxl-region-sysfs.sh         OK               7.32s
3/6 ndctl:cxl / cxl-labels.sh               OK              10.58s
4/6 ndctl:cxl / cxl-create-region.sh        OK              18.40s
5/6 ndctl:cxl / cxl-xor-region.sh           OK               4.76s
6/6 ndctl:cxl / cxl-security.sh             OK               4.23s
Ok:                 6   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   
Quoted 2 lines

- Having noticed that the nvdimm.git kernel went dark, I thus tried the upstream kernel. However, from the mailing list I learned about https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git.

Yeah nvdimm.git is only for dax and nvdimm maintenance. The branch you want to track for updates going into the next merge window is cxl.git#next.

Quoted 4 lines

I have tried the same sequence with this kernel and a various few branches/tags. No luck. Is there a branch/tag here for which this sequence should work?
- As these tests utilize a mock driver to emulate various cxl component(s?), I have found that there is no need to run this on a system with CXL components (ie real hardware of qemu), correct?

Correct.

Quoted 1 line

- Is there other documentation for learning how to run CXL tests other than this pmem.io ndctl write-up?

There is some automation for setting up a VM to run the tests in the run_qemu project. That builds a kernel and root-file-system and boots with a canned config that is expected to work:

https://github.com/pmem/run_qemu

I tend to run a custom VM and give feedback to the run_qemu project as needed.

Quoted 2 lines

- Is there a better/preferred way of running tests beyond this? I've seen reference to kdevops, but am equally confused as to what it can do (in part because it appears to use the above mock modules).

I think you're on the right track, it was just that memory-hotplug setting that tripped you up. kdevops incorporates tests from multiple subsystems I would defer to Luis about more details there.

Quoted 6 lines

I have seen the email thread "Usage of tools/testing/cxl" started by Raghu H, but that didn't seem to answer his question (similar to mine), and instead pointed to run_qemu.sh. I've started to look into this, of course having some difficulty. Perhaps a quick overview of pros/cons of:
tools/testing/cxl, kdevops, run_qemu.sh (and anything else that CXL developers use)?

I greatly appreciate insight/help in this regard!

The CXL emulation in QEMU is the primary vehicle for integration testing. While cxl_test (tools/testing/cxl) is for regression testing the kernel-user ABI, and mocking up topologies that are out-of-scope for QEMU (like CXL 1.1 "RCH" topologies). The run_qemu project aims to automate setting up a VM environment that deploys the latest QEMU-CXL emulation as well as cxl_test. kdevops has aims to be an all encompassing test environment for multiple subsystems where cxl_test comes along for the ride.

#2 lore raw
Quoted 5 lines · Dan Williams
Quoted 2 lines · Eric DeVolder

Hi,
I'm new to CXL

Welcome!

Dan, thank you! I'm keen to make forward progress with CXL!

Quoted 12 lines
Quoted 5 lines

and have spent time browsing linux-cxl traffic to get an idea of where to start. I thought that running the tools/testing/cxl was a good place, seeing as I don't yet have any hardware on hand.

Quoted 7 lines

Through various nuggets within the linux-cxl messages, I landed on the following:

https://docs.pmem.io/ndctl-user-guide/installing-ndctl/installing-ndctl-from-source-on-linux

Following the instructions within, I was able to observe the running of the CXL related tests.

Quoted 8 lines

[..]

Quoted 1 line

6/6 ndctl:cxl / cxl-security.sh SKIP 0.03s exit statu7

This skip is intermittent and should be fixed as of:

https://github.com/pmem/ndctl/commit/82a0cda5

...were you running with that?

Yes, I'm on ndctl v77, and verified this commit is present in my build of v77.

Quoted 22 lines

[..]

Quoted 3 lines

OK! Now, if I repeat the above steps, but with recently tagged 6.3 (perhaps thinking it would yield a passing suite):

[..]

Quoted 4 lines

at which point I've lost the system and I have to reset it.

I suspect the faults in udevd have something to do with "plugging" in memory, but I don't have any ability to inspect after this point.

Yes, good insight. I have this setting locally, but the instructions need updating that as of commit:

e9ee9fe3a9d4 ("dax: Assign RAM regions to memory-hotplug by default")

...the test requires booting the kernel with:

memhp_default_state=offline

...or building the kernel with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=n

Quoted 7 lines
Quoted 1 line

It appears to go boom when attempting the first test in the suite, cxl-topology.sh.

This is because v6.3 adds a preconfigured ram-region. The test validates that the region is auto-assembled and ready to be onlined. Given there is no actual physical memory behind the fake address ranges used by cxl_test that final "online" step that would happen on real hardware needs to be skipped.

Makes sense. I've confirmed the commit is in my v6.3. However, I still observe the same/similar fail with memhp_default_state=offline (and I've changed the .config to CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=n as well):

[root@localhost ~]# cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/vmlinuz-6.3.0 root=/dev/mapper/ol-root ro crashkernel=1G-64G:448M,64G-:512M rd.lvm.lv=ol/root console=ttyS0 memhp_default_state=offline [root@localhost ~]# cd linux
[root@localhost linux]# git branch --contains e9ee9fe3a9d4
wip
wip2
* wip_v6.3

It still fails in systemd-udevd which suggests that the hotplug online events are still being issued?

I've tried linux.git tag v6.3 (the wip_v6.3 branch above) and cxl.git#next (shows as v6.3.0-rc6) and both behave the same for me.

I must have some other config item at play.

Quoted 14 lines
Quoted 4 lines

So some basic questions:

- Should the above sequence work with upstream kernel?

Yes, and with memhp_default_state=offline and ndctl v77 I get:

1/6 ndctl:cxl / cxl-topology.sh             OK              11.90s
2/6 ndctl:cxl / cxl-region-sysfs.sh         OK               7.32s
3/6 ndctl:cxl / cxl-labels.sh               OK              10.58s
4/6 ndctl:cxl / cxl-create-region.sh        OK              18.40s
5/6 ndctl:cxl / cxl-xor-region.sh           OK               4.76s
6/6 ndctl:cxl / cxl-security.sh             OK               4.23s
Quoted 8 lines
Ok:                 6
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

OK, great! I looking forward to reaching this milestone!

Quoted 7 lines
Quoted 2 lines

- Having noticed that the nvdimm.git kernel went dark, I thus tried the upstream kernel. However, from the mailing list I learned about https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git.

Yeah nvdimm.git is only for dax and nvdimm maintenance. The branch you want to track for updates going into the next merge window is cxl.git#next.

ok

Quoted 7 lines
Quoted 4 lines

I have tried the same sequence with this kernel and a various few branches/tags. No luck. Is there a branch/tag here for which this sequence should work?
- As these tests utilize a mock driver to emulate various cxl component(s?), I have found that there is no need to run this on a system with CXL components (ie real hardware of qemu), correct?

Correct.

ok

Quoted 25 lines
Quoted 1 line

- Is there other documentation for learning how to run CXL tests other than this pmem.io ndctl write-up?

There is some automation for setting up a VM to run the tests in the run_qemu project. That builds a kernel and root-file-system and boots with a canned config that is expected to work:

https://github.com/pmem/run_qemu

I tend to run a custom VM and give feedback to the run_qemu project as needed.

Quoted 2 lines

- Is there a better/preferred way of running tests beyond this? I've seen reference to kdevops, but am equally confused as to what it can do (in part because it appears to use the above mock modules).

I think you're on the right track, it was just that memory-hotplug setting that tripped you up. kdevops incorporates tests from multiple subsystems I would defer to Luis about more details there.

Quoted 6 lines

I have seen the email thread "Usage of tools/testing/cxl" started by Raghu H, but that didn't seem to answer his question (similar to mine), and instead pointed to run_qemu.sh. I've started to look into this, of course having some difficulty. Perhaps a quick overview of pros/cons of:
tools/testing/cxl, kdevops, run_qemu.sh (and anything else that CXL developers use)?

I greatly appreciate insight/help in this regard!

Quoted 8 lines

The CXL emulation in QEMU is the primary vehicle for integration testing. While cxl_test (tools/testing/cxl) is for regression testing the kernel-user ABI, and mocking up topologies that are out-of-scope for QEMU (like CXL 1.1 "RCH" topologies). The run_qemu project aims to automate setting up a VM environment that deploys the latest QEMU-CXL emulation as well as cxl_test. kdevops has aims to be an all encompassing test environment for multiple subsystems where cxl_test comes along for the ride.

ok, thanks for the above insight! I'll continue trying on these fronts. eric

#3 lore raw
Quoted 74 lines · Eric DeVolder
Quoted 5 lines · Dan Williams
Quoted 2 lines · Eric DeVolder

Hi,
I'm new to CXL

Welcome!

Dan, thank you! I'm keen to make forward progress with CXL!

Quoted 12 lines
Quoted 5 lines

and have spent time browsing linux-cxl traffic to get an idea of where to start. I thought that running the tools/testing/cxl was a good place, seeing as I don't yet have any hardware on hand.

Quoted 7 lines

Through various nuggets within the linux-cxl messages, I landed on the following:

   https://docs.pmem.io/ndctl-user-guide/installing-ndctl/installing-ndctl-from-source-on-linux

Following the instructions within, I was able to observe the running of the CXL related tests.

Quoted 8 lines

[..]

Quoted 1 line

6/6 ndctl:cxl / cxl-security.sh             SKIP             0.03s   exit statu7

This skip is intermittent and should be fixed as of:

https://github.com/pmem/ndctl/commit/82a0cda5

...were you running with that?

Yes, I'm on ndctl v77, and verified this commit is present in my build of v77.

Quoted 22 lines

[..]

Quoted 3 lines

OK! Now, if I repeat the above steps, but with recently tagged 6.3 (perhaps thinking it would yield a passing suite):

[..]

Quoted 4 lines

at which point I've lost the system and I have to reset it.

I suspect the faults in udevd have something to do with "plugging" in memory, but I don't have any ability to inspect after this point.

Yes, good insight. I have this setting locally, but the instructions need updating that as of commit:

e9ee9fe3a9d4 ("dax: Assign RAM regions to memory-hotplug by default")

...the test requires booting the kernel with:

memhp_default_state=offline

...or building the kernel with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=n

Quoted 7 lines
Quoted 1 line

It appears to go boom when attempting the first test in the suite, cxl-topology.sh.

This is because v6.3 adds a preconfigured ram-region. The test validates that the region is auto-assembled and ready to be onlined. Given there is no actual physical memory behind the fake address ranges used by cxl_test that final "online" step that would happen on real hardware needs to be skipped.

Makes sense. I've confirmed the commit is in my v6.3. However, I still observe the same/similar fail with memhp_default_state=offline (and I've changed the .config to CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=n as well):

[root@localhost ~]# cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/vmlinuz-6.3.0 root=/dev/mapper/ol-root ro crashkernel=1G-64G:448M,64G-:512M rd.lvm.lv=ol/root console=ttyS0 memhp_default_state=offline [root@localhost ~]# cd linux
[root@localhost linux]# git branch --contains e9ee9fe3a9d4
  wip
  wip2
* wip_v6.3

Quoted 5 lines

It still fails in systemd-udevd which suggests that the hotplug online events are still being issued?

I've tried linux.git tag v6.3 (the wip_v6.3 branch above) and cxl.git#next (shows as v6.3.0-rc6) and both behave the same for me.

I must have some other config item at play.

Fwiw, I found a workaround that involves short-circuiting the udev rule that onlines hotplug memory (/usr/lib/udev/rules.d/40-redhat.rules in my case). By having this rule NOT online the memory, the tests complete. Which validates my assertion that the events were still occuring despite memhp_default_state=offline. I didn't root cause this, but wanted to share there is another way.

Thanks,
eric

Quoted 79 lines
Quoted 14 lines
Quoted 4 lines

So some basic questions:

- Should the above sequence work with upstream kernel?

Yes, and with memhp_default_state=offline and ndctl v77 I get:

1/6 ndctl:cxl / cxl-topology.sh             OK              11.90s 2/6 ndctl:cxl / cxl-region-sysfs.sh         OK               7.32s 3/6 ndctl:cxl / cxl-labels.sh               OK              10.58s 4/6 ndctl:cxl / cxl-create-region.sh        OK              18.40s 5/6 ndctl:cxl / cxl-xor-region.sh           OK               4.76s 6/6 ndctl:cxl / cxl-security.sh             OK               4.23s

Quoted 8 lines

Ok:                 6
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

OK, great! I looking forward to reaching this milestone!

Quoted 7 lines
Quoted 2 lines

- Having noticed that the nvdimm.git kernel went dark, I thus tried the upstream kernel. However, from the mailing list I learned about https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git.

Yeah nvdimm.git is only for dax and nvdimm maintenance. The branch you want to track for updates going into the next merge window is cxl.git#next.

ok

Quoted 7 lines
Quoted 4 lines

I have tried the same sequence with this kernel and a various few branches/tags. No luck. Is there a branch/tag here for which this sequence should work?
- As these tests utilize a mock driver to emulate various cxl component(s?), I have found that there is no need to run this on a system with CXL components (ie real hardware of qemu), correct?

Correct.

ok

Quoted 26 lines
Quoted 2 lines

- Is there other documentation for learning how to run CXL tests other than this pmem.io ndctl write-up?

There is some automation for setting up a VM to run the tests in the run_qemu project. That builds a kernel and root-file-system and boots with a canned config that is expected to work:

https://github.com/pmem/run_qemu

I tend to run a custom VM and give feedback to the run_qemu project as needed.

Quoted 2 lines

- Is there a better/preferred way of running tests beyond this? I've seen reference to kdevops, but am equally confused as to what it can do (in part because it appears to use the above mock modules).

I think you're on the right track, it was just that memory-hotplug setting that tripped you up. kdevops incorporates tests from multiple subsystems I would defer to Luis about more details there.

Quoted 6 lines

I have seen the email thread "Usage of tools/testing/cxl" started by Raghu H, but that didn't seem to answer his question (similar to mine), and instead pointed to run_qemu.sh. I've started to look into this, of course having some difficulty. Perhaps a quick overview of pros/cons of:
tools/testing/cxl, kdevops, run_qemu.sh (and anything else that CXL developers use)?

I greatly appreciate insight/help in this regard!

Quoted 8 lines

The CXL emulation in QEMU is the primary vehicle for integration testing. While cxl_test (tools/testing/cxl) is for regression testing the kernel-user ABI, and mocking up topologies that are out-of-scope for QEMU (like CXL 1.1 "RCH" topologies). The run_qemu project aims to automate setting up a VM environment that deploys the latest QEMU-CXL emulation as well as cxl_test. kdevops has aims to be an all encompassing test environment for multiple subsystems where cxl_test comes along for the ride.

ok, thanks for the above insight! I'll continue trying on these fronts. eric