From nobody Mon Feb 9 08:56:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1603964090; cv=none; d=zohomail.com; s=zohoarc; b=kLyYDm1fpLRdjVQP//BTHWggycXqRKB3KTzqxnW2GbytOJxe/qzW7gTCQVQULLJDhgzj/MBAPp8TZ3cagQ1UkeuVWtMLVOik4zmNYpmFj+1rw/8IPtgSCrRnbnqjVxeWqQ67Ocy/KCz/5PlBfKZhQOyDAsdBC9H59a8/0XRfb4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603964090; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=cY+deayBxNQZ5fZVujrukclTBWuP/LZ1eYsnj5g50jE=; b=Pyrqneukq1KNztzr0rg3ivBeDtFlYf35pnnn+3s9qnDyFgEPpnAisIB2XWyiSPLfCwCtNLTrvZDhjW0dEJGWUlyTRomDWaEkQLOM3BZTft+ocQVITTg7b0Hk5OspKieVxYF6Gvpw4TldI/RymHtgtrG2cvNbxVMOdPQ3RuPeBs4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603964090367471.7529842260632; Thu, 29 Oct 2020 02:34:50 -0700 (PDT) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-w0pF1fCxP9WS6k_7eiX0Tg-1; Thu, 29 Oct 2020 05:34:47 -0400 Received: by mail-ed1-f69.google.com with SMTP id o2so955972edw.1 for ; Thu, 29 Oct 2020 02:34:47 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id h4sm1160619edj.1.2020.10.29.02.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 02:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603964089; 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=cY+deayBxNQZ5fZVujrukclTBWuP/LZ1eYsnj5g50jE=; b=XYHuVfNT/CgbwUL85wStzzbjChTIPeKTWdORHCdpzzDnbvAzxI8SGc5An52Tr6Liov/iyt Egr6T1uIOwYpKPjF+RN4uTCyToUOtqpt+YcwU+9HpydmAsoOubAqoL8lQtTq/6aiQaKg1E WrpTB4mMB9EKQEN/ClndU/1s2PRWShQ= X-MC-Unique: w0pF1fCxP9WS6k_7eiX0Tg-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=cY+deayBxNQZ5fZVujrukclTBWuP/LZ1eYsnj5g50jE=; b=F+hDfeFi63oBc4C9oD6h5kx8WDuW6NbwE3AhzfYalps5Bb7Y9ia1O+jluy+Dl1V7he LCfPbhYUAk0tzYzmhvAo4r1YITCqu//5x7NE8Beyxrm140QZlzutRCBlbk2gC/4xyNIg g8HhSIhSMGTt1MKd5ca0SP9mpzuqSCYQV2EBZqgePqb5rUUIM95KDFIjMeIOapvn5Vbx u3KU9302FWRDUXY3I7yT15oc1A0G/Mi8Z5wEJayjd3KlGGV+WTwF0X9hKj3JxB/tnLSw Ew5hgjUIEAbQFRzhq3CUa7dZU2tap58q4fVq3UuCaeAB4p0QA6lH8dwIKmcOgrItWE8P 3c8g== X-Gm-Message-State: AOAM531AYA85IYFbqb3AhKDBobDl4KTj4sGBdD1KT+JVEa3qbKnU9ee6 H/+652ex1lsoll/c/d4ou9Z8Zh48i6woVoLLdz9xawJaSC4e9LDZ0rdZYucGKlnqBB1TB9eNjW7 WRk1Q+78o4FKpfg== X-Received: by 2002:a17:906:b216:: with SMTP id p22mr3200834ejz.228.1603964086028; Thu, 29 Oct 2020 02:34:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPLTTLbOHI19ZgEFF+IVkmv117xie8yC+hrbe79Wkp3q3/8uNxXAwNzCsAZpTAzqdAUa2Bow== X-Received: by 2002:a17:906:b216:: with SMTP id p22mr3200816ejz.228.1603964085862; Thu, 29 Oct 2020 02:34:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Stefan Hajnoczi , Kevin Wolf , Klaus Jensen , Eric Auger , Max Reitz , Fam Zheng , Keith Busch , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-5.2 v2 18/25] block/nvme: Correct minimum device page size Date: Thu, 29 Oct 2020 10:32:59 +0100 Message-Id: <20201029093306.1063879-19-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029093306.1063879-1-philmd@redhat.com> References: <20201029093306.1063879-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 Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index bb75448a09f..bd3860ac4ef 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -755,7 +755,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 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; bs->bl.request_alignment =3D s->page_size; --=20 2.26.2