From nobody Mon Feb 9 08:10:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563816450; cv=none; d=zoho.com; s=zohoarc; b=DvO3W8qYlnRSJwMBiPgKDqiXFvBxE+e+XcOC60V5F6F46MBKx+/+iWEqhMqiOcCK+Q5Zmkrq9SbPmLr8OnUJgAlRuKdm3bFtFewxZNgV+U+U85/fibnVXZrkbJPfYt6jFJMPX9JQLzaVyyVowHJJo5MR6tuNorSxvnCNJVzaZEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563816450; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=WTQM9OrKKEKUGrhmxLvJaYH78UZUyvo+pjSZUByOKPA=; b=DYyCtUb+2oMK8EnHs3jok6W7tXKBxIUPJVE3IB2OOFA3B2IG1Jh2McEM727Lq4ehrSMZm6JOzdlAZKTuz2LfqTxTFcPB1CfEv8aCpAuz4CPIhNXUZ+KDigvPb+tRnVA/966Er6FQy3eTZcAbO71BIOETwhSWCxbe9NZz8CDyXow= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563816450889641.8126099456141; Mon, 22 Jul 2019 10:27:30 -0700 (PDT) Received: from localhost ([::1]:36300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpc5x-0003DP-Lf for importer@patchew.org; Mon, 22 Jul 2019 13:27:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51301) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpc5b-00025R-IL for qemu-devel@nongnu.org; Mon, 22 Jul 2019 13:27:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpc5a-0004Yh-By for qemu-devel@nongnu.org; Mon, 22 Jul 2019 13:27:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41774) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hpc5Y-0004PY-6G; Mon, 22 Jul 2019 13:27:04 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B53893082126; Mon, 22 Jul 2019 17:26:51 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A039760BFB; Mon, 22 Jul 2019 17:26:50 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 22 Jul 2019 19:26:14 +0200 Message-Id: <20190722172616.28797-4-mreitz@redhat.com> In-Reply-To: <20190722172616.28797-1-mreitz@redhat.com> References: <20190722172616.28797-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 22 Jul 2019 17:26:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/5] block/nvme: don't touch the completion entries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Maxim Levitsky Completion entries are meant to be only read by the host and written by the= device. The driver is supposed to scan the completions from the last point where it= left, and until it sees a completion with non flipped phase bit. Signed-off-by: Maxim Levitsky Reviewed-by: Max Reitz Message-id: 20190716163020.13383-4-mlevitsk@redhat.com Signed-off-by: Max Reitz --- block/nvme.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 35ce10dc79..c28755cc31 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -318,7 +318,7 @@ static bool nvme_process_completion(BDRVNVMeState *s, N= VMeQueuePair *q) while (q->inflight) { int16_t cid; c =3D (NvmeCqe *)&q->cq.queue[q->cq.head * NVME_CQ_ENTRY_BYTES]; - if (!c->cid || (le16_to_cpu(c->status) & 0x1) =3D=3D q->cq_phase) { + if ((le16_to_cpu(c->status) & 0x1) =3D=3D q->cq_phase) { break; } q->cq.head =3D (q->cq.head + 1) % NVME_QUEUE_SIZE; @@ -342,10 +342,7 @@ static bool nvme_process_completion(BDRVNVMeState *s, = NVMeQueuePair *q) qemu_mutex_unlock(&q->lock); req.cb(req.opaque, nvme_translate_error(c)); qemu_mutex_lock(&q->lock); - c->cid =3D cpu_to_le16(0); q->inflight--; - /* Flip Phase Tag bit. */ - c->status =3D cpu_to_le16(le16_to_cpu(c->status) ^ 0x1); progress =3D true; } if (progress) { --=20 2.21.0