From nobody Mon Feb 9 19:04:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603709716; cv=none; d=zohomail.com; s=zohoarc; b=L0aD3aYovNZWuZEoCZHRvwmdXRDMpsXZ/vSqIAg1K9jbC8a+xxnD5Oa67IdX1lnpWw0px/DfWjmJom3dAzei2aVCq3yKmhcnSR+8e+lJw+KNPcDTNKHGGOGHlM0lPmaCXVwOS8Ff2iAMtOEFDjw1h6SV2vR/1PzpqDdEXugkwu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603709716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=RehUHE9smya/dLsky2IXktduYA/iO28rTmGbzKYGc9c=; b=EVNQ6yrGP/FzPbOwlJ/qZXnfINKBOHM9f2rMHnzy5+k9MSlqJuHr0Ur3jgJOV5doxNiDo3tVHsE0Cz3IUgvhk8HzxKgmgL4U79f1uNoozGzUZapHqh9qczItN8NSG5tOBWg8Dy++z7VR9QFd4Jfbx3FAdaoVH7BaJXxboqOLl9s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1603709716126134.51529127208278; Mon, 26 Oct 2020 03:55:16 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-NpN6jayXNpykGbK8W6I3yg-1; Mon, 26 Oct 2020 06:55:13 -0400 Received: by mail-wr1-f69.google.com with SMTP id 31so8157919wrg.12 for ; Mon, 26 Oct 2020 03:55:12 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id o184sm19666112wmo.37.2020.10.26.03.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 03:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603709715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RehUHE9smya/dLsky2IXktduYA/iO28rTmGbzKYGc9c=; b=Q04GQ6UBZhUh8ZCsOQu58IXGmYZvMpuEVu84GK+LN3E6jjoBxbUsDirWWG34/XUZDrDJCa EPf98r0kFNJYnTti04FlvEdgI2f2cNCrMEsgTWoLLsJK0dkiCrOyiEVsKe4vcOL04Uq3+C gsOy9kPbX1eXw4xpmLmx2KpFVml47hs= X-MC-Unique: NpN6jayXNpykGbK8W6I3yg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RehUHE9smya/dLsky2IXktduYA/iO28rTmGbzKYGc9c=; b=QbXKaPelUEJ/DBynbOJ2m7R5aQ8gD+PYrPfzRhcMYSaZ5U4eNPgydJatVzFqrzDEhm 5bz4FK9HlOt/0VWcyqbyCdKHpPZCC++Xc1DRWosUM+FXYgSclsnHk5/Q8VcBR0VsYiST 7+Fu0nsQCG2odRcxjNLdnEpeuRVoxJKBye7aCSe1Iv+Fl5Myg3HWvUxr06z90ySbZdJK D+xfGSg9NkpEvyJCbOeLObH1KbH+N+odSVIi5XEKlZi/liFyd5PpEWkuY1X4Z0tSv8EV 7cVfR4CMzlhAF15YPHK8tVQ6hN0kSgEgRKF6scV7VnfwTUyYWK05/dugply+aWH4sXyS 27EQ== X-Gm-Message-State: AOAM531w4P7GfrIPA55D889tzdJ8OMVcFt5uxFiDHuaMFUVwfOFouxgh OsMF6J/XNYBsEfsRt89aUopge98U+xJx+BPX6QMsvIjeEXpRf0bcpYDd5FPKKGnxVCG0i88Zi4N SAGMkwSdxwCDt3g== X-Received: by 2002:a1c:3d0b:: with SMTP id k11mr16527952wma.155.1603709711811; Mon, 26 Oct 2020 03:55:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkJnI+75GNifqeIxOa5vyOW++22eYcXgv7c+VGmme8smKEu4b4HgE7XX5HtMH91aJ5X4PWyQ== X-Received: by 2002:a1c:3d0b:: with SMTP id k11mr16527937wma.155.1603709711669; Mon, 26 Oct 2020 03:55:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Auger , Alex Williamson , qemu-block@nongnu.org, Fam Zheng , Max Reitz , Stefan Hajnoczi , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/19] block/nvme: Correct minimum device page size Date: Mon, 26 Oct 2020 11:54:46 +0100 Message-Id: <20201026105504.4023620-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201026105504.4023620-1-philmd@redhat.com> References: <20201026105504.4023620-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) While trying to simplify the code using a macro, we forgot the 12-bit shift... Correct that. Fixes: fad1eb68862 ("block/nvme: Use register definitions from 'block/nvme.= h'") Reported-by: Eric Auger Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index b48f6f25881..029694975b9 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -724,7 +724,7 @@ static int nvme_init(BlockDriverState *bs, const char *= device, int namespace, goto out; } =20 - s->page_size =3D MAX(4096, 1 << NVME_CAP_MPSMIN(cap)); + s->page_size =3D MAX(4096, 1u << (12 + NVME_CAP_MPSMIN(cap))); s->doorbell_scale =3D (4 << NVME_CAP_DSTRD(cap)) / sizeof(uint32_t); bs->bl.opt_mem_alignment =3D s->page_size; timeout_ms =3D MIN(500 * NVME_CAP_TO(cap), 30000); --=20 2.26.2