From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796244595; b=2iv9Mn7cVEt+jFRW7Nth1B9FAUSq0s5NMpyZv7w7Rbon3Tx8JVusKyGJfQ2o65QkWIyo foGPoo9QCBHwozuGAcV1xNVcoKZo5w6c1Kyzf0aqTTKveMdZDm/66doPiomYEERT4eY4U Btrb24Oh+5+7oNKFGqMTAOqXFfciudHm59rKa17+1fJtyCRMK44Jfq9sNhu/90ifGNdUP wgtJ1RCpXWqyD4hy+SEFU9yYsbNzzFFpyp93jyESTwcqxC6zPpoD6hjM7j9cSWOCw/X+b cm1LOoaSJ+dAVyfpoiy5ItJCqozE+mWtAAuriOvtp9OyqNTRYxmij1bXxLKzje1fqIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796244595; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:X-Google-Original-From:Date:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=ByKWyc48pWurr2Vq354gDdwGKmw3UEllfi9xJgn3ghU=; b=pczJkhkbikKzC+7+RYHJxwSnLebjtDCwOtGKWgAwBNZhfpJfWS6kj8bjbPayJJqaT+ia OmOsKz1gsnp2CZqmZ1JKr+HMaBAkioruVogmfxyDNGBHU8/JlCnwKdKsDjOmTFpUWudVX vzlSm/ogdf5qZx3RKh7coE2HIbk31pNkpdNDP1j4sfDlIFTHXTZ50ihg6X+2zmHSk6BoE gI3zCKI+uX8jvapSziG45pRnJBPMmDMBraL5ocQUfUAirs5U3IUHSZTi1aw2xkhe1eLab s6PLy9C4H7fWhvfDoYIOVpLNSOYMh4klhVvaghN4IOW7G+DiLlllERct3srvtAf3GSA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=S3VtCirF; arc=none smtp.remote-ip=209.85.215.174 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FB17606A322 for ; Wed, 2 Dec 2026 20:49:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4FB17606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=S3VtCirF Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-cd61cef87f1so6818876a12.0 for ; Wed, 02 Dec 2026 12:49:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796244594; x=1796849394; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ByKWyc48pWurr2Vq354gDdwGKmw3UEllfi9xJgn3ghU=; b=S3VtCirF4YLpTw2JACeausCheFbamI1/nTJm2eTDBa0kBE7Eu0zEYmZa8bvF4MX2er BifJAvgQ5DBGEiw1SYRzD6NqK7vmMV+rP+xxO5XsKxYaqjrL0jrcjkXp7RKy8kDBDrtE wYsCDSdkE8h0tj9IoHxF+PMJqAqpv523KXQvFqBYWhq5sQijHJ3a8iNQN/xX5+PlZFHd ILcrduutBwlQbS2hjwFDrmdS5PsdHVk5uUm2JPRb9mNehvqWn/sowha+9pkXWpTBk+YS 1tEyZBVVErETaw9+ngEIhQJJaPiZLoyKKCD0xS1SvUDh1WSkGqlpK92OVVPUB1i53Jym F3Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796244594; x=1796849394; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ByKWyc48pWurr2Vq354gDdwGKmw3UEllfi9xJgn3ghU=; b=qt5lQpXboBDVLkeREePsEaKkYfdp2o1Sh/G2Qge3D7a6SIAdu6U1WrbECLC+S0zaa1 RByj/E58L8wNWvF7W3PH+VF8radiQ3efA9F7SV3r1uedHD0iLQte0DfN7BWHQMtwrcms dUckeuk5ZudOeeq+FkCFlpjmg2Mr2Q6ul0XwU9w0TTXDUh1Gg/CpyIp/UitlFiSjNy2v Wy7XODbb//lsK2hWjqze/DAqZPB67peLPlTZ5klxPz8jnkLnGIWCWs1cpbutFMAx1U7d g0b09ziBulPiCVmU4pprYMHyabLwmpze0A2+KQJ1adiADKUVfotRD1z45jwZK06cmxLa S1TA== X-Forwarded-Encrypted: i=1; AL+hErFgHqsK8LlFNoUHkFQUc3YmHjVjHFd6JPACy/3UennOrtqPUiIDzC+O9ZifMvLOI4vW5AIDQ0Y3fFw=@vger.kernel.org X-Gm-Message-State: APuU4Z99qEqkDb9xXbariXx8xDjZ68n9EBr0cp159hHWDmZJ3AK9BA8I Ulk60YiIdYwiWNdM25kn/Y7CupZM1Ghl3O3V2kemJ2Ar8okslURH/88V X-Gm-Gg: AZFdTZfQ45Ta9q/UMkXlg+ZSkW6uGdiVfmlD7AzSyN17S8HLDeO3zpZyz/Jt0On9WOu B+kNCA1jPnKnIDTfCoE/wNUKyQ5KvHAOCTICP2PE63Zl35xmT3ISm/9+DLV1KG9MV/ylr7ns9JM 7xBpoyLvDL4GHC86LaVjRt7vT9GNka+Tq6SC3euekvNzSKEhQFw2JO5RSBqbcGM5kq4xTMUBt5e 3/SXeKmetL81voSvvAgA0CTn/BZmIQzOfe/dsUNMeaxxp0kdWpqdpNFFE1w4kYgVexJRYn/xZxS dMk3PMlb1sFQHk7g3ChBQTacHCg6Nr7mhAyz3d4eUTfluWF6CjD+YcYXwU3tLerGHR1zx1QqzDm ffuHqcKCjdDfewEPXToY506+zMFUqBQXTajrqHzsF9BnT1Ct0442/zFC1oV4OoqG14yBOsJCsII xJ2Zdb0PrlIs0P41mHWKHBm67gZNolPj1bX76/KlMyasYCWkdnyFxNTSIhCCEO8tdD8aXHl45oT BGrD2l+Lv+C3dra6oacR2nP4okg0owhEbavDRuDqvZW5D5DZ9WkcpNJ6gX3b4Q2k+zrtKYNyAlM gZGPWEDrv5YOjfr8nJ04ES3oRw== X-Received: by 2002:a05:6372:a70f:b0:3f7:b6c5:bc64 with SMTP id adf61e73a8af0-4014e15fa3emr37473266637.79.1796244594455; Wed, 02 Dec 2026 12:49:54 -0800 (PST) Received: from cxlqual ([220.120.90.131]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cea7c29sm22373763a12.1.2026.12.02.12.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 12:49:54 -0800 (PST) From: Anisa Su X-Google-Original-From: Anisa Su Date: Thu, 3 Dec 2026 05:51:49 +0900 To: Davidlohr Bueso 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 Message-ID: References: <20261130154517.3480390-1-dave@stgolabs.net> <20261130154517.3480390-2-dave@stgolabs.net> X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 > --- > 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 >