[ Gregory: Hoping you can help w reviews here ] Review and testing of Gregory's dax kmem atomic whole-device hotplug series[1] exposed an existing libdaxctl bug when handling DAX devices with multiple physical address ranges.
libdaxctl identifies a device's memory blocks using a single contiguous address window, even when the device has separate ranges with gaps between them. This can exclude blocks belonging to the device and include blocks belonging to another device in the gaps. As a result, daxctl can report incorrect memory block counts and potentially online or offline another device's memory. Patches 1-2 address mapping reliability issues discovered while fixing the memory block ownership checks. Patch 3 corrects the memory block ownership checks. Patch 4 adds regression coverage using a two-range DAX device. [1] https://lore.kernel.org/linux-cxl/[email protected]/ Alison Schofield (4): libdaxctl: handle mapping initialization failures libdaxctl: tie mapping cache lifetime to the device libdaxctl: match memory blocks against each dax device mapping test/daxctl-create.sh: count memory blocks across dax mappings daxctl/lib/libdaxctl.c | 93 ++++++++++++++++++++++++++++++++++-------- test/daxctl-create.sh | 58 ++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 16 deletions(-) -- 2.37.3
