From: Markus Armbruster <armbru@redhat.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: qemu-devel@nongnu.org, "Michael Tsirkin" <mst@redhat.com>,
"Fan Ni" <fan.ni@samsung.com>,
linux-cxl@vger.kernel.org, linuxarm@huawei.com,
"Ira Weiny" <ira.weiny@intel.com>,
"Alison Schofield" <alison.schofield@intel.com>,
"Michael Roth" <michael.roth@amd.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Dave Jiang" <dave.jiang@intel.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Mike Maslenkin" <mike.maslenkin@gmail.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v5 4/6] hw/cxl: QMP based poison injection support
Date: Mon, 22 May 2023 08:38:29 +0200 [thread overview]
Message-ID: <87a5xwrhui.fsf@pond.sub.org> (raw)
In-Reply-To: <20230423162013.4535-5-Jonathan.Cameron@huawei.com> (Jonathan Cameron's message of "Sun, 23 Apr 2023 17:20:11 +0100")
Jonathan Cameron <Jonathan.Cameron@huawei.com> writes:
> Inject poison using qmp command cxl-inject-poison to add an entry to the
> poison list.
>
> For now, the poison is not returned CXL.mem reads, but only via the
> mailbox command Get Poison List. So a normal memory read to an address
> that is on the poison list will not yet result in a synchronous exception
> (and similar for partial cacheline writes).
> That is left for a future patch.
>
> See CXL rev 3.0, sec 8.2.9.8.4.1 Get Poison list (Opcode 4300h)
>
> Kernel patches to use this interface here:
> https://lore.kernel.org/linux-cxl/cover.1665606782.git.alison.schofield@intel.com/
>
> To inject poison using qmp (telnet to the qmp port)
> { "execute": "qmp_capabilities" }
>
> { "execute": "cxl-inject-poison",
> "arguments": {
> "path": "/machine/peripheral/cxl-pmem0",
> "start": 2048,
> "length": 256
> }
> }
>
> Adjusted to select a device on your machine.
>
> Note that the poison list supported is kept short enough to avoid the
> complexity of state machine that is needed to handle the MORE flag.
>
> Reviewed-by: Fan Ni <fan.ni@samsung.com>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> ---
> v5:
> - Picked up Fan Ni's tag
> - Use ROUND_DOWN() as suggestion by Philippe
> - Update qapi docs to 8.1
> - Added comment to clarify the lack of synchronous poison exceptions
> that has been left for a future patch set.
> ---
> hw/cxl/cxl-mailbox-utils.c | 90 +++++++++++++++++++++++++++++++++++++
> hw/mem/cxl_type3.c | 56 +++++++++++++++++++++++
> hw/mem/cxl_type3_stubs.c | 6 +++
> include/hw/cxl/cxl.h | 1 +
> include/hw/cxl/cxl_device.h | 20 +++++++++
> qapi/cxl.json | 18 ++++++++
> 6 files changed, 191 insertions(+)
Please add
[diff]
orderFile = scripts/git.orderfile
to your .git/config, so that QAPI schema changes come first in diffs.
[...]
> diff --git a/qapi/cxl.json b/qapi/cxl.json
> index 4be7d46041..ca3af3f0b2 100644
> --- a/qapi/cxl.json
> +++ b/qapi/cxl.json
> @@ -5,6 +5,24 @@
> # = CXL devices
> ##
>
> +##
> +# @cxl-inject-poison:
> +#
> +# Poison records indicate that a CXL memory device knows that a particular
> +# memory region may be corrupted. This may be because of locally detected
> +# errors (e.g. ECC failure) or poisoned writes received from other components
> +# in the system. This injection mechanism enables testing of the OS handling
> +# of poison records which may be queried via the CXL mailbox.
> +#
> +# @path: CXL type 3 device canonical QOM path
> +# @start: Start address - must be 64 byte aligned.
> +# @length: Length of poison to inject - must be a multiple of 64 bytes.
> +#
> +# Since: 8.1
> +##
> +{ 'command': 'cxl-inject-poison',
> + 'data': { 'path': 'str', 'start': 'uint64', 'length': 'uint64' }}
> +
> ##
> # @CxlUncorErrorType:
> #
Please format like
##
# @cxl-inject-poison:
#
# Poison records indicate that a CXL memory device knows that a
# particular memory region may be corrupted. This may be because of
# locally detected errors (e.g. ECC failure) or poisoned writes
# received from other components in the system. This injection
# mechanism enables testing of the OS handling of poison records which
# may be queried via the CXL mailbox.
#
# @path: CXL type 3 device canonical QOM path
#
# @start: Start address - must be 64 byte aligned.
#
# @length: Length of poison to inject - must be a multiple of 64
# bytes.
#
# Since: 8.1
##
to blend in with recent commit a937b6aa739 (qapi: Reformat doc comments
to conform to current conventions).
The blank lines help with catching certain errors. rST loves to
surprise...
> +{ 'command': 'cxl-inject-poison',
> + 'data': { 'path': 'str', 'start': 'uint64', 'length': 'uint64' }}
> +
Make this 'length': 'size'. Just to signal intent; it generates the
same code.
> ##
> # @CxlUncorErrorType:
> #
With that
Acked-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2023-05-22 6:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-23 16:20 [PATCH v5 0/6] hw/cxl: Poison get, inject, clear Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-04-23 16:20 ` [PATCH v5 1/6] hw/cxl: rename mailbox return code type from ret_code to CXLRetCode Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-04-23 16:20 ` [PATCH v5 2/6] hw/cxl: Introduce cxl_device_get_timestamp() utility function Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-04-23 16:20 ` [PATCH v5 3/6] bswap: Add the ability to store to an unaligned 24 bit field Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-05-19 11:33 ` Jonathan Cameron
2023-05-19 11:33 ` Jonathan Cameron via
2023-05-19 13:42 ` Jonathan Cameron
2023-05-19 13:42 ` Jonathan Cameron via
2023-04-23 16:20 ` [PATCH v5 4/6] hw/cxl: QMP based poison injection support Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-05-22 6:38 ` Markus Armbruster [this message]
2023-04-23 16:20 ` [PATCH v5 5/6] hw/cxl: Add poison injection via the mailbox Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-04-23 16:20 ` [PATCH v5 6/6] hw/cxl: Add clear poison mailbox command support Jonathan Cameron
2023-04-23 16:20 ` Jonathan Cameron via
2023-05-19 7:05 ` Michael S. Tsirkin
2023-05-19 9:21 ` Jonathan Cameron
2023-05-19 9:21 ` Jonathan Cameron via
2023-05-19 8:49 ` [PATCH v5 0/6] hw/cxl: Poison get, inject, clear Michael S. Tsirkin
2023-05-19 11:07 ` Jonathan Cameron
2023-05-19 11:07 ` 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=87a5xwrhui.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=berrange@redhat.com \
--cc=dave.jiang@intel.com \
--cc=eblake@redhat.com \
--cc=fan.ni@samsung.com \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=mike.maslenkin@gmail.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.