From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: <qemu-devel@nongnu.org>, Michael Tsirkin <mst@redhat.com>
Cc: "Ben Widawsky" <bwidawsk@kernel.org>,
linux-cxl@vger.kernel.org, linuxarm@huawei.com,
"Ira Weiny" <ira.weiny@intel.com>,
"Gregory Price" <gourry.memverge@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Mike Maslenkin" <mike.maslenkin@gmail.com>
Subject: [PATCH v3 0/8] hw/cxl: RAS error emulation and injection
Date: Mon, 30 Jan 2023 15:52:43 +0000 [thread overview]
Message-ID: <20230130155251.3430-1-Jonathan.Cameron@huawei.com> (raw)
v3: New patch fixing related endian issues + endian fixes in the injection
code (thanks for feedback off list)
Dropped header logging for correctable errors as there is no such
logging in the specification.
v2: Thanks to Mike Maslenkin for review.
- Fix wrong parameter type to ct3d_qmp_cor_err_to_cxl()
- Rework use of CXLError local variable in ct3d_reg_write() to improve
code readability.
CXL error reporting is complex. This series only covers the protocol
related errors reported via PCIE AER - Ira Weiny has posted support for
Event log based injection and I will post an update of Poison list injection
shortly. My proposal is to upstream this one first, followed by Ira's Event
Log series, then finally the Poison List handling. That is based on likely
order of Linux kernel support (the support for this type of error reporting
went in during the recent merge window, the others are still under review).
Note we may propose other non error related features in between!
The current revisions of all the error injection can be found at:
https://gitlab.com/jic23/qemu/-/tree/cxl-2023-01-11
In order to test the kernel support for RAS error handling, I previously
provided this series via gitlab, enabling David Jiang's kernel patches
to be tested.
Now that Linux kernel support is upstream, this series is proposing the
support for upstream inclusion in QEMU. Note that support for Multiple
Header Recording has been added to QEMU the meantime and a kernel
patch to use that feature sent out.
https://lore.kernel.org/linux-cxl/20230113154058.16227-1-Jonathan.Cameron@huawei.com/T/#t
There are two generic PCI AER precursor feature additions.
1) The PCI_ERR_UCOR_MASK register has not been implemented until now
and is necessary for correct emulation.
2) The routing for AER errors, via existing AER error injection, only
covered one of two paths given in the PCIe base specification,
unfortunately not the one used by the Linux kernel CXL support.
The use of MSI for the CXL root ports, both makes sense from the point
of view of how it may well be implemented, and works around the documented
lack of PCI interrupt routing in i386/q35. I have a hack that lets
us correctly route those interrupts but don't currently plan to post it.
The actual CXL error injection uses a new QMP interface as documented
in the final patch description. The existing AER error injection
internals are reused though it's HMP interface is not.
Injection via QMP:
{ "execute": "qmp_capabilities" }
...
{ "execute": "cxl-inject-uncorrectable-errors",
"arguments": {
"path": "/machine/peripheral/cxl-pmem0",
"errors": [
{
"type": "cache-address-parity",
"header": [ 3, 4]
},
{
"type": "cache-data-parity",
"header": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
},
{
"type": "internal",
"header": [ 1, 2, 4]
}
]
}}
...
{ "execute": "cxl-inject-correctable-error",
"arguments": {
"path": "/machine/peripheral/cxl-pmem0",
"type": "physical"
} }
Based on top of:
https://lore.kernel.org/qemu-devel/20230130143705.11758-1-Jonathan.Cameron@huawei.com/T/#t
[PATCH v3 00/10] hw/cxl: CXL emulation cleanups and minor fixes for upstream
Jonathan Cameron (8):
hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register
hw/pci/aer: Add missing routing for AER errors
hw/pci-bridge/cxl_root_port: Wire up AER
hw/pci-bridge/cxl_root_port: Wire up MSI
hw/mem/cxl-type3: Add AER extended capability
hw/cxl: Fix endian issues in CXL RAS capability defaults / masks
hw/pci/aer: Make PCIE AER error injection facility available for other
emulation to use.
hw/mem/cxl_type3: Add CXL RAS Error Injection Support.
hw/cxl/cxl-component-utils.c | 20 ++-
hw/mem/cxl_type3.c | 294 +++++++++++++++++++++++++++++++++
hw/mem/cxl_type3_stubs.c | 10 ++
hw/mem/meson.build | 2 +
hw/pci-bridge/cxl_root_port.c | 64 +++++++
hw/pci/pci-internal.h | 1 -
hw/pci/pcie_aer.c | 14 +-
include/hw/cxl/cxl_component.h | 26 +++
include/hw/cxl/cxl_device.h | 11 ++
include/hw/pci/pcie_aer.h | 1 +
include/hw/pci/pcie_regs.h | 3 +
qapi/cxl.json | 110 ++++++++++++
qapi/meson.build | 1 +
qapi/qapi-schema.json | 1 +
14 files changed, 547 insertions(+), 11 deletions(-)
create mode 100644 hw/mem/cxl_type3_stubs.c
create mode 100644 qapi/cxl.json
--
2.37.2
next reply other threads:[~2023-01-30 15:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 15:52 Jonathan Cameron via [this message]
2023-01-30 15:52 ` [PATCH v3 1/8] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 2/8] hw/pci/aer: Add missing routing for AER errors Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 3/8] hw/pci-bridge/cxl_root_port: Wire up AER Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 4/8] hw/pci-bridge/cxl_root_port: Wire up MSI Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 5/8] hw/mem/cxl-type3: Add AER extended capability Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 6/8] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 7/8] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use Jonathan Cameron via
2023-01-30 15:52 ` [PATCH v3 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support Jonathan Cameron via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130155251.3430-1-Jonathan.Cameron@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=bwidawsk@kernel.org \
--cc=gourry.memverge@gmail.com \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mike.maslenkin@gmail.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).