mbox series

[-qemu,0/4] hw/cxl: Support for scan media

Message ID 20230908073152.4386-1-dave@stgolabs.net
Headers show
Series hw/cxl: Support for scan media | expand

Message

Davidlohr Bueso Sept. 8, 2023, 7:31 a.m. UTC
Hello,

Patch 1 is a fix I found which should be picked up regardless of
the rest. As a side note, does it make sense to have a clear poison
equivalent for the qmp interface?

This is a (tardy) followup series to the rfc version[0]. With the
exception of the get scan media caps, the whole thing has been mostly
redone to 1) just use the qmp interface we have for poison injection and
extend it to add to a backup list when the poison limit is reached; and
2) The valid address range chunks obtained by scan media are moved from
the backup to a results list, which in turn is consumed by the get scan
media results operation.

As with the current state of things, DRAM Event Logs are not generated
for every new poisoned dpa.

Applies against https://gitlab.com/jic23/qemu/-/tree/cxl-2023-08-30

Testing - I hacked up kernel side equivalent to trigger the scan:

1. With an imaginary poison limit of 2 and 5 poisoned dpas.

<get-poison-list>
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x800 dpa_length=0x40 source=Internal flags=Overflow  overflow_time=1694153028389446574
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x200 dpa_length=0x40 source=Internal flags=Overflow overflow_time=1694153028389446574
<scan-media> + <get-poison-list>
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x100 dpa_length=0x40 source=Internal flags=Overflow overflow_time=1694153028389446574
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x80 dpa_length=0x40 source=Internal flags=Overflow overflow_time=1694153028389446574

2. With an imaginary poison limit of 2 and 3 poisoned dpas.
<get-poison-list>
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x400 dpa_length=0x40 source=Internal flags=Overflow overflow_time=1694153398720616022
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x80 dpa_length=0x40 source=Internal flags=Overflow overflow_time=1694153398720616022
<scan-media> + <get-poison-list>
cxl_poison: memdev=mem1 host=0000:0d:00.0 serial=0 trace_type=List region= region_uuid=... hpa=0xffffffffffffffff dpa=0x100 dpa_length=0x40 source=Internal flags= overflow_time=0

Thanks!

[0] https://lore.kernel.org/linux-cxl/20230426021418.10186-1-dave@stgolabs.net

Davidlohr Bueso (4):
  cxl/type3: Fix crash in set_cacheline()
  hw/cxl: Add get scan media capabilities cmd support
  hw/cxl: Add scan media cmd support
  hw/cxl: Add get scan media results cmd support

 hw/cxl/cxl-mailbox-utils.c  | 298 +++++++++++++++++++++++++++++++++++-
 hw/mem/cxl_type3.c          |  24 ++-
 include/hw/cxl/cxl_device.h |  10 ++
 3 files changed, 317 insertions(+), 15 deletions(-)

--
2.42.0