Jonathan Cameron wrote: > These events include a copy of the device health information at the > time of the event. Actually using the emulated device health would > require a lot of controls to manipulate that state. Given the aim > of this injection code is to just test the flows when events occur, > inject the contents of the device health state as well. > > Future work may add more sophisticate device health emulation > including direct generation of these records when events occur > (such as a temperature threshold being crossed). That does not > reduce the usefulness of this more basic generation of the events.
Seems very reasonable to me. One spelling issue below. With that. Reviewed-by: Ira Weiny <ira.we...@intel.com> > > Signed-off-by: Jonathan Cameron <jonathan.came...@huawei.com> > --- > hw/mem/cxl_type3.c | 61 +++++++++++++++++++++++++++++++++++++ > hw/mem/cxl_type3_stubs.c | 12 ++++++++ > include/hw/cxl/cxl_events.h | 19 ++++++++++++ > qapi/cxl.json | 35 +++++++++++++++++++++ > 4 files changed, 127 insertions(+) > [...] > diff --git a/qapi/cxl.json b/qapi/cxl.json > index 32f340d972..8b3d30cd71 100644 > --- a/qapi/cxl.json > +++ b/qapi/cxl.json > @@ -90,6 +90,41 @@ > '*column': 'uint16', '*correction-mask': [ 'uint64' ] > }} > > +## > +# @cxl-inject-memory-module-event: > +# > +# Inject an event record for a Memory Module Event (CXL r3.0 8.2.9.2.1.3) > +# This event includes a copy of the Device Health info at the time of > +# the event. > +# > +# @path: CXL type 3 device canonical QOM path > +# @log: Event Log to add the event to > +# @flags: header flags > +# @type: Device Event Type (see spec for permitted values) > +# @health-status: Overall health summary bitmap (see spec for permitted bits) > +# @media-status: Overall media health summary (see spec for permitted values) > +# @additional-status: Complex field (see spec for meaning) > +# @life-used: Percentage (0-100) of factory expected life span > +# @temperature: Device temperature in degrees Celsius > +# @dirty-shutdown-count: Counter incremented whenever device is unable > +# to determine if data loss may have occured. ^^^^^^^^^ occurred Ira