From: Klaus Jensen <its@irrelevant.dk>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Kevin Wolf" <kwolf@redhat.com>,
qemu-block@nongnu.org, "Klaus Jensen" <k.jensen@samsung.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Klaus Jensen" <its@irrelevant.dk>,
"Hanna Reitz" <hreitz@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Keith Busch" <kbusch@kernel.org>
Subject: [PULL 5/6] hw/nvme: add ozcs enum
Date: Mon, 14 Feb 2022 09:08:00 +0100 [thread overview]
Message-ID: <20220214080801.13627-6-its@irrelevant.dk> (raw)
In-Reply-To: <20220214080801.13627-1-its@irrelevant.dk>
From: Klaus Jensen <k.jensen@samsung.com>
Add enumeration for OZCS values.
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ns.c | 3 ++-
include/block/nvme.h | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c
index 8b5f98c76180..356b6c1c2f14 100644
--- a/hw/nvme/ns.c
+++ b/hw/nvme/ns.c
@@ -266,7 +266,8 @@ static void nvme_ns_init_zoned(NvmeNamespace *ns)
id_ns_z->mar = cpu_to_le32(ns->params.max_active_zones - 1);
id_ns_z->mor = cpu_to_le32(ns->params.max_open_zones - 1);
id_ns_z->zoc = 0;
- id_ns_z->ozcs = ns->params.cross_zone_read ? 0x01 : 0x00;
+ id_ns_z->ozcs = ns->params.cross_zone_read ?
+ NVME_ID_NS_ZONED_OZCS_RAZB : 0x00;
for (i = 0; i <= ns->id_ns.nlbaf; i++) {
id_ns_z->lbafe[i].zsze = cpu_to_le64(ns->zone_size);
diff --git a/include/block/nvme.h b/include/block/nvme.h
index 709d491c70d8..e10ea6f0eb88 100644
--- a/include/block/nvme.h
+++ b/include/block/nvme.h
@@ -1351,6 +1351,10 @@ typedef struct QEMU_PACKED NvmeIdNsZoned {
uint8_t vs[256];
} NvmeIdNsZoned;
+enum NvmeIdNsZonedOzcs {
+ NVME_ID_NS_ZONED_OZCS_RAZB = 1 << 0,
+};
+
/*Deallocate Logical Block Features*/
#define NVME_ID_NS_DLFEAT_GUARD_CRC(dlfeat) ((dlfeat) & 0x10)
#define NVME_ID_NS_DLFEAT_WRITE_ZEROES(dlfeat) ((dlfeat) & 0x08)
--
2.35.1
next prev parent reply other threads:[~2022-02-14 8:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 8:07 [PULL 0/6] hw/nvme updates Klaus Jensen
2022-02-14 8:07 ` [PULL 1/6] hw/nvme: fix CVE-2021-3929 Klaus Jensen
2022-02-14 8:07 ` [PULL 2/6] hw/nvme/ctrl: Have nvme_addr_write() take const buffer Klaus Jensen
2022-02-14 8:07 ` [PULL 3/6] hw/nvme/ctrl: Pass buffers as 'void *' types Klaus Jensen
2022-02-14 8:07 ` [PULL 4/6] hw/nvme: add struct for zone management send Klaus Jensen
2022-02-14 8:08 ` Klaus Jensen [this message]
2022-02-14 8:08 ` [PULL 6/6] hw/nvme: add support for zoned random write area Klaus Jensen
2022-02-15 19:30 ` [PULL 0/6] hw/nvme updates Peter Maydell
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=20220214080801.13627-6-its@irrelevant.dk \
--to=its@irrelevant.dk \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).