[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 5/9] hw/block/nvme: support for admin-only command set
From: |
Dmitry Fomichev |
Subject: |
RE: [PATCH 5/9] hw/block/nvme: support for admin-only command set |
Date: |
Thu, 1 Oct 2020 00:11:28 +0000 |
> -----Original Message-----
> From: Keith Busch <kbusch@kernel.org>
> Sent: Wednesday, September 30, 2020 6:04 PM
> To: qemu-block@nongnu.org; qemu-devel@nongnu.org; Klaus Jensen
> <k.jensen@samsung.com>
> Cc: Niklas Cassel <Niklas.Cassel@wdc.com>; Dmitry Fomichev
> <Dmitry.Fomichev@wdc.com>; Kevin Wolf <kwolf@redhat.com>; Philippe
> Mathieu-Daudé <philmd@redhat.com>; Keith Busch <kbusch@kernel.org>
> Subject: [PATCH 5/9] hw/block/nvme: support for admin-only command set
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> hw/block/nvme.c | 1 +
> include/block/nvme.h | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 6c582e6874..ec7363ea40 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -2755,6 +2755,7 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice
> *pci_dev)
> NVME_CAP_SET_CQR(n->bar.cap, 1);
> NVME_CAP_SET_TO(n->bar.cap, 0xf);
> NVME_CAP_SET_CSS(n->bar.cap, NVME_CAP_CSS_NVM);
> + NVME_CAP_SET_CSS(n->bar.cap, NVME_CAP_CSS_ADMIN_ONLY);
This could be
- NVME_CAP_SET_CSS(n->bar.cap, NVME_CAP_CSS_NVM);
+ NVME_CAP_SET_CSS(n->bar.cap, (NVME_CAP_CSS_NVM |
NVME_CAP_CSS_ADMIN_ONLY));
Unfortunately, parentheses are needed above because NVME_CAP_SET_CSS macro and
other similar macros use "val" instead of (val). A possible cleanup topic...
> NVME_CAP_SET_MPSMAX(n->bar.cap, 4);
>
> n->bar.vs = NVME_SPEC_VER;
> diff --git a/include/block/nvme.h b/include/block/nvme.h
> index bc20a2ba5e..521533fd2a 100644
> --- a/include/block/nvme.h
> +++ b/include/block/nvme.h
> @@ -83,7 +83,8 @@ enum NvmeCapMask {
> << CAP_PMR_SHIFT)
>
> enum NvmeCapCss {
> - NVME_CAP_CSS_NVM = 1 << 0,
> + NVME_CAP_CSS_NVM = 1 << 0,
> + NVME_CAP_CSS_ADMIN_ONLY = 1 << 7,
> };
>
> enum NvmeCcShift {
> --
> 2.24.1
- [PATCH 0/9] nvme qemu cleanups and fixes, Keith Busch, 2020/09/30
- [PATCH 1/9] hw/block/nvme: remove pointless rw indirection, Keith Busch, 2020/09/30
- [PATCH 3/9] hw/block/nvme: support per-namespace smart log, Keith Busch, 2020/09/30
- [PATCH 4/9] hw/block/nvme: validate command set selected, Keith Busch, 2020/09/30
- [PATCH 2/9] hw/block/nvme: fix log page offset check, Keith Busch, 2020/09/30
- [PATCH 6/9] hw/block/nvme: reject io commands if only admin command set selected, Keith Busch, 2020/09/30
- [PATCH 5/9] hw/block/nvme: support for admin-only command set, Keith Busch, 2020/09/30
- RE: [PATCH 5/9] hw/block/nvme: support for admin-only command set,
Dmitry Fomichev <=
- [PATCH 7/9] hw/block/nvme: add nsid to get/setfeat trace events, Keith Busch, 2020/09/30
- [PATCH 8/9] hw/block/nvme: add trace event for requests with non-zero status code, Keith Busch, 2020/09/30
- [PATCH 9/9] hw/block/nvme: report actual LBA data shift in LBAF, Keith Busch, 2020/09/30