[snip] > I applied this to v82 (needs a sync up in libcxl.sym) and ran cxl-poison unit > test using your new cxl-cli cmds instead of writing to debugfs directly.[1] > Works for me. Just thought I'd share that as proof of life until I review it > completely.
Thanks for testing! > > Adding more test cases to cxl-poison.sh makes sense for the device poison. > Wondering about the protocol errors. How do we test those? So protocol errors are provided by the platform through EINJ (section 18.6 of ACPI v6.5 spec). The best way to test would be with real hardware (what I've been doing), but that obviously doesn't work for everyone. I'm not aware of a way to mock/emulate an actual injection (QEMU doesn't support EINJ), so I'm not sure software-only testing is viable. I do have any idea for testing the interface though. It would probably look like writing to mock error_types/einj_inject attributes (that replace the ones in debugfs) and having a phony error come up in the dmesg. Something like: # echo 0x8000 > <debugfs>/<cxl dport>/einj_inject # dmesg ... [CXL Error print] Of course I'm not sure how useful that is since it's basically a roundabout way of testing the debugfs files exist :/. > > [1] diff --git a/test/cxl-poison.sh b/test/cxl-poison.sh > index 6ed890bc666c..41ab670b1094 100644 > --- a/test/cxl-poison.sh > +++ b/test/cxl-poison.sh > @@ -68,7 +68,8 @@ inject_poison_sysfs() > memdev="$1" > addr="$2" > > - echo "$addr" > /sys/kernel/debug/cxl/"$memdev"/inject_poison > +# echo "$addr" > /sys/kernel/debug/cxl/"$memdev"/inject_poison > + $CXL inject-error "$memdev" -t poison -a "$addr" > } > > clear_poison_sysfs() > @@ -76,7 +77,8 @@ clear_poison_sysfs() > memdev="$1" > addr="$2" > > - echo "$addr" > /sys/kernel/debug/cxl/"$memdev"/clear_poison > +# echo "$addr" > /sys/kernel/debug/cxl/"$memdev"/clear_poison > + $CXL clear-error "$memdev" -a "$addr" > } > > > While applying this: Documentation: Add docs for inject/clear-error commands > Got these whitespace complaints: > 234: new blank line at EOF > 158: space before tab in indent. > "offset":"0x1000", > 159: space before tab in indent. > "length":64, > 160: space before tab in indent. > "source":"Injected" > I'll fix these for v3. Thanks, Ben