[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 3/6] hw/cxl/cxl-events: Add CXL mock events
From: |
Jonathan Cameron |
Subject: |
Re: [RFC PATCH 3/6] hw/cxl/cxl-events: Add CXL mock events |
Date: |
Mon, 19 Dec 2022 10:07:23 +0000 |
On Mon, 10 Oct 2022 15:29:41 -0700
ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> To facilitate testing of guest software add mock events and code to
> support iterating through the event logs.
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
An FYI for the next version as I hit an issue with this when
testing resets (there are lots of other issues with resets
but this one crashed QEMU :)
> ---
> +static void event_store_add_event(CXLDeviceState *cxlds,
> + enum cxl_event_log_type log_type,
> + struct cxl_event_record_raw *event)
> +{
> + struct cxl_event_log *log;
> +
> + assert(log_type < CXL_EVENT_TYPE_MAX);
> +
> + log = &cxlds->event_logs[log_type];
> + assert(log->nr_events < CXL_TEST_EVENT_CNT_MAX);
This assert triggers on a reset as the function is called without
clearing the buffer first.
I'd suggest moving the setup of any dummy events over to a code
path that isn't run on reset.
> +
> + log->events[log->nr_events] = event;
> + log->nr_events++;
> +}
- Re: [RFC PATCH 3/6] hw/cxl/cxl-events: Add CXL mock events,
Jonathan Cameron <=