From: Anisa Su <anisa.su887@gmail.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: mst@redhat.com, jic23@kernel.org, junjie.cao@linux.dev,
qemu-devel@nongnu.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/4] hw/cxl: Use runtime for bg cmd running semantics
Date: Thu, 3 Dec 2026 05:51:49 +0900 [thread overview]
Message-ID: <axCE5Q0HCKkSX4E-@cxlqual> (raw)
In-Reply-To: <20261130154517.3480390-2-dave@stgolabs.net>
On Mon, Nov 30, 2026 at 07:45:14AM -0800, Davidlohr Bueso wrote:
> The current check incorrectly misses the 0% case, which semantically
> can either be not running or one that just started. The runtime
> is a better way to check for 0%, 100% or aborted. This is currently
> benign in the kernel equivalent without cancel support.
>
> Fixes: 98cbac128f1c ("hw/cxl: Support aborting background commands")
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
LGTM. Might be worth mentioning the mailbox command Background Operation
Status also uses cci->bg.runtime to return the status, so this would be
consistent with that, if there is a v2. But not worth v2 on its own.
Reviewed-by: Anisa Su <anisa.su@samsung.com>
> ---
> hw/cxl/cxl-device-utils.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
> index e150d7445762..add0ab615976 100644
> --- a/hw/cxl/cxl-device-utils.c
> +++ b/hw/cxl/cxl-device-utils.c
> @@ -95,13 +95,10 @@ static uint64_t mailbox_reg_read(void *opaque, hwaddr offset, unsigned size)
> }
> if (offset == A_CXL_DEV_MAILBOX_STS) {
> uint64_t status_reg = cxl_dstate->mbox_reg_state64[offset / size];
> - int bgop;
>
> qemu_mutex_lock(&cci->bg.lock);
> - bgop = !(cci->bg.complete_pct == 100 || cci->bg.aborted);
> -
> status_reg = FIELD_DP64(status_reg, CXL_DEV_MAILBOX_STS, BG_OP,
> - bgop);
> + !!cci->bg.runtime);
> cxl_dstate->mbox_reg_state64[offset / size] = status_reg;
> qemu_mutex_unlock(&cci->bg.lock);
> }
> --
> 2.39.5
>
next prev parent reply other threads:[~2026-12-02 20:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 15:45 [PATCH -qemu 0/4] hw/cxl: Mailbox fixes Davidlohr Bueso
2026-11-30 15:45 ` [PATCH 1/4] hw/cxl: Use runtime for bg cmd running semantics Davidlohr Bueso
2026-12-02 20:51 ` Anisa Su [this message]
2026-11-30 15:45 ` [PATCH 2/4] hw/cxl: Fix CEL command effect bit positions Davidlohr Bueso
2026-12-01 22:44 ` Anisa Su
2026-11-30 15:45 ` [PATCH 3/4] hw/cxl: Set CEL[11:10] Valid for the FM DCD commands Davidlohr Bueso
2026-12-01 23:25 ` Anisa Su
2026-11-30 15:45 ` [PATCH 4/4] hw/cxl: Fix out of bounds read of the CEL in Get Log Davidlohr Bueso
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=axCE5Q0HCKkSX4E-@cxlqual \
--to=anisa.su887@gmail.com \
--cc=dave@stgolabs.net \
--cc=jic23@kernel.org \
--cc=junjie.cao@linux.dev \
--cc=linux-cxl@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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 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.