]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/cxl: Support aborting background commands
authorDavidlohr Bueso <dave@stgolabs.net>
Wed, 5 Mar 2025 09:24:52 +0000 (09:24 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 14 May 2025 09:39:14 +0000 (05:39 -0400)
commit98cbac128f1c38fa62becf5b89bc662c9218a780
treeca2f1c8c7d086eefac1cdf3fab44c286272e65cf
parent7be29f2f1a3f5b037d27eedbd5df9f441e8c8c16
hw/cxl: Support aborting background commands

As of 3.1 spec, background commands can be canceled with a new
abort command. Implement the support, which is advertised in
the CEL. No ad-hoc context undoing is necessary as all the
command logic of the running bg command is done upon completion.
Arbitrarily, the on-going background cmd will not be aborted if
already at least 85% done;

A mutex is introduced to stabilize mbox request cancel command vs
the timer callback being fired scenarios (as well as reading the
mbox registers). While some operations under critical regions
may be unnecessary (irq notifying, cmd callbacks), this is not
a path where performance is important, so simplicity is preferred.

Tested-by: Ajay Joshi <ajay.opensrc@micron.com>
Reviewed-by: Ajay Joshi <ajay.opensrc@micron.com>
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20250305092501.191929-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/cxl/cxl-device-utils.c
hw/cxl/cxl-mailbox-utils.c
hw/mem/cxl_type3.c
include/hw/cxl/cxl_device.h
include/hw/cxl/cxl_mailbox.h