[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/7] hw/nvme: fix number of PIDs for FDP RUH update
From: |
Klaus Jensen |
Subject: |
[PULL 2/7] hw/nvme: fix number of PIDs for FDP RUH update |
Date: |
Thu, 11 Jul 2024 20:04:39 +0200 |
From: Vincent Fu <vincentfu@gmail.com>
The number of PIDs is in the upper 16 bits of cdw10. So we need to
right-shift by 16 bits instead of only a single bit.
Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation")
Cc: qemu-stable@nongnu.org
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index fa7ec0e79490..231e1127cec8 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -4352,7 +4352,7 @@ static uint16_t nvme_io_mgmt_send_ruh_update(NvmeCtrl *n,
NvmeRequest *req)
NvmeNamespace *ns = req->ns;
uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
uint16_t ret = NVME_SUCCESS;
- uint32_t npid = (cdw10 >> 1) + 1;
+ uint32_t npid = (cdw10 >> 16) + 1;
unsigned int i = 0;
g_autofree uint16_t *pids = NULL;
uint32_t maxnpid;
--
2.44.0
- [PULL 0/7] hw/nvme patches, Klaus Jensen, 2024/07/11
- [PULL 1/7] hw/nvme: Add support for setting the MQES for the NVMe emulation, Klaus Jensen, 2024/07/11
- [PULL 2/7] hw/nvme: fix number of PIDs for FDP RUH update,
Klaus Jensen <=
- [PULL 4/7] hw/nvme: add Identify Endurance Group List, Klaus Jensen, 2024/07/11
- [PULL 3/7] hw/nvme: fix BAR size mismatch of SR-IOV VF, Klaus Jensen, 2024/07/11
- [PULL 5/7] hw/nvme: separate identify data for sec. ctrl list, Klaus Jensen, 2024/07/11
- [PULL 6/7] hw/nvme: Allocate sec-ctrl-list as a dynamic array, Klaus Jensen, 2024/07/11
- [PULL 7/7] hw/nvme: Expand VI/VQ resource to uint32, Klaus Jensen, 2024/07/11
- Re: [PULL 0/7] hw/nvme patches, Richard Henderson, 2024/07/12