From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Fam Zheng" <fam@euphon.net>,
qemu-block@nongnu.org, "Max Reitz" <mreitz@redhat.com>,
"Keith Busch" <kbusch@kernel.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Klaus Jensen" <its@irrelevant.dk>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH 2/3] block/nvme: Use generic NvmeBar structure
Date: Fri, 4 Sep 2020 14:41:29 +0200 [thread overview]
Message-ID: <20200904124130.583838-3-philmd@redhat.com> (raw)
In-Reply-To: <20200904124130.583838-1-philmd@redhat.com>
Commit f3c507adcd7 ("NVMe: Initial commit for new storage interface")
introduced the NvmeBar structure. Unfortunately in commit bdd6a90a9e5
("block: Add VFIO based NVMe driver") we duplicated it.
Apparently in commit a3d9a352d48 ("block: Move NVMe constants to
a separate header") we tried to unify headers but forgot to remove
the structure declared in the block/nvme.c source file.
Do it now, and remove the structure size check which is redundant
with the header check added in commit 74e18435c0e ("hw/block/nvme:
Align I/O BAR to 4 KiB").
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
block/nvme.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/block/nvme.c b/block/nvme.c
index c9c3fc02fed..a216cc407f6 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -83,28 +83,10 @@ typedef struct {
/* Memory mapped registers */
typedef volatile struct {
- struct {
- uint64_t cap;
- uint32_t vs;
- uint32_t intms;
- uint32_t intmc;
- uint32_t cc;
- uint32_t reserved0;
- uint32_t csts;
- uint32_t nssr;
- uint32_t aqa;
- uint64_t asq;
- uint64_t acq;
- uint32_t cmbloc;
- uint32_t cmbsz;
- uint8_t reserved1[0xec0];
- uint8_t cmd_set_specfic[0x100];
- } ctrl;
+ NvmeBar ctrl;
uint32_t doorbells[];
} NVMeRegs;
-QEMU_BUILD_BUG_ON(offsetof(NVMeRegs, doorbells) != 0x1000);
-
#define INDEX_ADMIN 0
#define INDEX_IO(n) (1 + n)
--
2.26.2
next prev parent reply other threads:[~2020-09-04 12:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 12:41 [PATCH 0/3] block/nvme: Use NvmeBar structure from "block/nvme.h" Philippe Mathieu-Daudé
2020-09-04 12:41 ` [PATCH 1/3] block/nvme: Group controller registers in NVMeRegs structure Philippe Mathieu-Daudé
2020-09-04 12:41 ` Philippe Mathieu-Daudé [this message]
2020-09-04 12:41 ` [PATCH 3/3] block/nvme: Pair doorbell registers Philippe Mathieu-Daudé
2020-09-04 14:57 ` [PATCH 0/3] block/nvme: Use NvmeBar structure from "block/nvme.h" Fam Zheng
2020-09-04 15:28 ` Klaus Jensen
2020-09-07 10:54 ` Kevin Wolf
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=20200904124130.583838-3-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=fam@euphon.net \
--cc=its@irrelevant.dk \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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.