qemu/qapi
Jonathan Cameron 9547754f40 hw/cxl: QMP based poison injection support
Inject poison using QMP command cxl-inject-poison to add an entry to the
poison list.

For now, the poison is not returned CXL.mem reads, but only via the
mailbox command Get Poison List. So a normal memory read to an address
that is on the poison list will not yet result in a synchronous exception
(and similar for partial cacheline writes).
That is left for a future patch.

See CXL rev 3.0, sec 8.2.9.8.4.1 Get Poison list (Opcode 4300h)

Kernel patches to use this interface here:
https://lore.kernel.org/linux-cxl/cover.1665606782.git.alison.schofield@intel.com/

To inject poison using QMP (telnet to the QMP port)
{ "execute": "qmp_capabilities" }

{ "execute": "cxl-inject-poison",
    "arguments": {
         "path": "/machine/peripheral/cxl-pmem0",
         "start": 2048,
         "length": 256
    }
}

Adjusted to select a device on your machine.

Note that the poison list supported is kept short enough to avoid the
complexity of state machine that is needed to handle the MORE flag.

Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230526170010.574-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-06-22 18:55:14 -04:00
..
acpi.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
audio.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
authz.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
block-core.json qcow2: add discard-no-unref option 2023-06-05 13:15:42 +02:00
block-export.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
block.json block: add accounting for zone append operation 2023-05-15 08:18:10 -04:00
char.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
common.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
compat.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
control.json docs/interop: Convert qmp-spec.txt to rST 2023-05-22 10:21:01 +02:00
crypto.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
cryptodev.json spelling: information 2023-06-09 23:38:16 +03:00
cxl.json hw/cxl: QMP based poison injection support 2023-06-22 18:55:14 -04:00
dump.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
error.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
introspect.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
job.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
machine-target.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
machine.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
meson.build meson: Replace CONFIG_SOFTMMU -> CONFIG_SYSTEM_ONLY 2023-06-20 10:01:30 +02:00
migration.json exec/memory: Introduce RAM_NAMED_FILE flag 2023-06-13 11:28:58 +02:00
misc-target.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
misc.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
net.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
opts-visitor.c cutils: Adjust signature of parse_uint[_full] 2023-06-02 12:27:19 -05:00
pci.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
pragma.json qapi/pragma: Tidy up comments 2022-05-16 07:31:26 +02:00
qapi-clone-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qapi-dealloc-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qapi-forward-visitor.c qapi: remove needless include 2022-03-22 14:46:18 +04:00
qapi-schema.json docs/interop: Convert qmp-spec.txt to rST 2023-05-22 10:21:01 +02:00
qapi-type-helpers.c monitor: introduce HumanReadableText and HMP support 2021-11-02 15:55:13 +00:00
qapi-util.c qapi: Fix stale reference to scripts/qapi.py in a comment 2022-02-28 11:39:35 +01:00
qapi-visit-core.c qapi: Factor out compat_policy_input_ok() 2021-10-29 21:27:20 +02:00
qdev.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
qmp-dispatch.c monitor: mark mixed functions that can suspend 2023-04-20 11:17:35 +02:00
qmp-event.c Replace qemu_gettimeofday() with g_get_real_time() 2022-04-06 10:50:37 +02:00
qmp-registry.c qapi: Generalize command policy checking 2021-10-29 18:24:46 +02:00
qobject-input-visitor.c include: add qemu/keyval.h 2022-04-21 17:03:51 +04:00
qobject-output-visitor.c qapi: Extend -compat to set policy for unstable interfaces 2021-10-29 21:28:01 +02:00
qom.json hostmem-file: add offset option 2023-05-23 16:47:03 +02:00
rdma.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
replay.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
rocker.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
run-state.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
sockets.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
stats.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
string-input-visitor.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
string-output-visitor.c qapi: remove needless include 2022-03-22 14:46:18 +04:00
tpm.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
trace-events qapi: Generalize struct member policy checking 2021-10-29 18:23:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
trace.json qapi: make the vcpu parameters deprecated for 8.1 2023-06-01 11:05:05 -04:00
transaction.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
ui.json ui: add the infrastructure to support MT events 2023-05-28 13:08:25 +04:00
virtio.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
yank.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00