mbox series

[v8,0/4] hw/cxl: Poison get, inject, clear

Message ID 20230526170010.574-1-Jonathan.Cameron@huawei.com
Headers show
Series hw/cxl: Poison get, inject, clear | expand

Message

Jonathan Cameron May 26, 2023, 5 p.m. UTC
v8: Formatting fixes for QMP docs from Markus Armbruster (thanks!)

The bswap naming discussions seems to have died down, so I'll stick
with this version (24)

Precursors now all upstream which make this email easier to write :)

The kernel support for Poison handling is now upstream.

This code has been very useful for testing and helped identify various
corner cases.

Updated cover letter.

The series supports:
1) Injection of variable length poison regions via QMP (to fake real
   memory corruption and ensure we deal with odd overflow corner cases
   such as clearing the middle of a large region making the list overflow
   as we go from one long entry to two smaller entries.
2) Read of poison list via the CXL mailbox.
3) Injection via the poison injection mailbox command (limited to 64 byte
   entries - spec constraint)
4) Clearing of poison injected via either method.

The implementation is meant to be a valid combination of impdef choices
based on what the spec allowed. There are a number of places where it could
be made more sophisticated that we might consider in future:
* Fusing adjacent poison entries if the types match.
* Separate injection list and main poison list, to test out limits on
  injected poison list being smaller than the main list.
* Poison list overflow event (needs event log support in general)
* Connecting up to the poison list error record generation (rather complex
  and not needed for currently kernel handling testing).
* Triggering the synchronous and asynchronous errors that occur on reads
  and writes of the memory when the host receives poison.

As the kernel code is currently fairly simple, it is likely that the above
does not yet matter but who knows what will turn up in future!

Ira Weiny (1):
  bswap: Add the ability to store to an unaligned 24 bit field

Jonathan Cameron (3):
  hw/cxl: QMP based poison injection support
  hw/cxl: Add poison injection via the mailbox.
  hw/cxl: Add clear poison mailbox command support.

 docs/devel/loads-stores.rst |   2 +
 qapi/cxl.json               |  21 ++++
 include/hw/cxl/cxl.h        |   1 +
 include/hw/cxl/cxl_device.h |  21 ++++
 include/qemu/bswap.h        |  25 +++++
 hw/cxl/cxl-mailbox-utils.c  | 214 ++++++++++++++++++++++++++++++++++++
 hw/mem/cxl_type3.c          |  93 ++++++++++++++++
 hw/mem/cxl_type3_stubs.c    |   6 +
 8 files changed, 383 insertions(+)

Comments

Michael S. Tsirkin June 23, 2023, 6:59 a.m. UTC | #1
On Fri, May 26, 2023 at 06:00:06PM +0100, Jonathan Cameron wrote:
> v8: Formatting fixes for QMP docs from Markus Armbruster (thanks!)

This and other patches add a bunch of over-80 chars lines.  I'm not
going to intervene here as cxl has lots of them but maybe scan over cxl
codebase and shorten where appropriate.
Thanks!
Jonathan Cameron June 23, 2023, 12:06 p.m. UTC | #2
On Fri, 23 Jun 2023 02:59:44 -0400
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Fri, May 26, 2023 at 06:00:06PM +0100, Jonathan Cameron wrote:
> > v8: Formatting fixes for QMP docs from Markus Armbruster (thanks!)  
> 
> This and other patches add a bunch of over-80 chars lines.  I'm not
> going to intervene here as cxl has lots of them but maybe scan over cxl
> codebase and shorten where appropriate.
> Thanks!

Will add it to the todo list and will pay more attention to this for
future series.

Some annoyingly complex register names make it tricky but I'm sure we
can do better if not necessarily perfectly!

Jonathan

>
Peter Maydell June 23, 2023, 12:13 p.m. UTC | #3
On Fri, 23 Jun 2023 at 13:07, Jonathan Cameron via
<qemu-devel@nongnu.org> wrote:
>
> On Fri, 23 Jun 2023 02:59:44 -0400
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
> > On Fri, May 26, 2023 at 06:00:06PM +0100, Jonathan Cameron wrote:
> > > v8: Formatting fixes for QMP docs from Markus Armbruster (thanks!)
> >
> > This and other patches add a bunch of over-80 chars lines.  I'm not
> > going to intervene here as cxl has lots of them but maybe scan over cxl
> > codebase and shorten where appropriate.
> > Thanks!
>
> Will add it to the todo list and will pay more attention to this for
> future series.
>
> Some annoyingly complex register names make it tricky but I'm sure we
> can do better if not necessarily perfectly!

The coding style says:

# Lines should be 80 characters; try not to make them longer.
#
# Sometimes it is hard to do, especially when dealing with QEMU subsystems
# that use long function or symbol names. If wrapping the line at 80 columns
# is obviously less readable and more awkward, prefer not to wrap it; better
# to have an 85 character line than one which is awkwardly wrapped.
#
# Even in that case, try not to make lines much longer than 80 characters.

so if it would be obviously worse to wrap the line you can
make it longer than 80 chars.

-- PMM