diff options
author | Vincent Fu <vincentfu@gmail.com> | 2024-05-03 13:50:04 -0400 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2024-07-11 17:05:37 +0200 |
commit | 3936bbdf9a2e9233875f850c7576c79d06add261 (patch) | |
tree | 1af33a4a6ca401a15a13ca4bfc97f658ce66c3cb | |
parent | bc432bc522f5f4ab57e8994d63be41ba20f95b37 (diff) | |
download | qemu-3936bbdf9a2e9233875f850c7576c79d06add261.zip qemu-3936bbdf9a2e9233875f850c7576c79d06add261.tar.gz qemu-3936bbdf9a2e9233875f850c7576c79d06add261.tar.bz2 |
hw/nvme: fix number of PIDs for FDP RUH update
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>
-rw-r--r-- | hw/nvme/ctrl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index fa7ec0e..231e112 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; |