mbox series

[v2,0/4] A Followup for "QEMU: CXL mailbox rework and features (Part 1)"

Message ID 20231222090051.3265307-1-42.hyeyoo@gmail.com
Headers show
Series A Followup for "QEMU: CXL mailbox rework and features (Part 1)" | expand

Message

Hyeonggon Yoo Dec. 22, 2023, 9 a.m. UTC
v1: https://lore.kernel.org/qemu-devel/20231127105830.2104954-1-42.hyeyoo@gmail.com

Changes from v1:
    - Added patch 1 that fixes a build failure in Jonathan's tree.
    - Added patch 3, as (partially) suggested by Davidlohr Buseo.
      One difference is that I dropped sanitize_running(), because
      cxl_dev_media_diabled() is enough for checking if the media is
      disabled (which implies sanitation is in progress)
    - Added patch 4 that dicards all event logs during sanitation

    Thanks everyone for giving feedbacks!

This is a fixup for the recent patch series "QEMU: CXL mailbox rework and
features (Part 1)" [1].

I don't mind if patch 1 is squashed into the problematic patch, as the
patch is not mainlined yet. This is based on Jonathan
Cameron's git tree (https://gitlab.com/jic23/qemu/-/tree/cxl-2023-11-02)

Sequence of Patches:

   1. Fix build error when CXL is not enabled, because of mismatching
      definition in cxl_type3_stubs.c
 
   2. Make mdev_reg_read() actually read registers, instead of
      returning a dummy value. This fixes Media Status being incorrectly
      read as "Enabled" while sanitation is in progress.

   3. Introduce cxl_dev_media_disabled() and replace sanitize_running()
      with it. Also add an assert() to check the media is correctly disabled
      during sanitation. (Now enabling when already enabled, or vice versa
      raises an assert failure.)

   4. Drop all event records during sanitation, as per spec.

[1] https://lore.kernel.org/linux-cxl/20231023160806.13206-1-Jonathan.Cameron@huawei.com

Hyeonggon Yoo (4):
  hw/cxl: fix build error in cxl_type3_stubs.c
  hw/cxl/device: read from register values in mdev_reg_read()
  hw/cxl/mbox: replace sanitize_running() with cxl_dev_media_disabled()
  hw/cxl/events: discard all event records during sanitation

 hw/cxl/cxl-device-utils.c   | 17 +++++++++++------
 hw/cxl/cxl-events.c         | 13 +++++++++++++
 hw/cxl/cxl-mailbox-utils.c  |  7 +++++--
 hw/mem/cxl_type3.c          |  4 ++--
 hw/mem/cxl_type3_stubs.c    |  4 ++--
 include/hw/cxl/cxl_device.h | 16 ++++++++++------
 6 files changed, 43 insertions(+), 18 deletions(-)