Skip to content

Commit 3936bbd

Browse files
vincentkfubirkelund
authored andcommitted
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: 73064ed ("hw/nvme: flexible data placement emulation") Cc: [email protected] Signed-off-by: Vincent Fu <[email protected]> Reviewed-by: Klaus Jensen <[email protected]> Signed-off-by: Klaus Jensen <[email protected]>
1 parent bc432bc commit 3936bbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hw/nvme/ctrl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4352,7 +4352,7 @@ static uint16_t nvme_io_mgmt_send_ruh_update(NvmeCtrl *n, NvmeRequest *req)
43524352
NvmeNamespace *ns = req->ns;
43534353
uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
43544354
uint16_t ret = NVME_SUCCESS;
4355-
uint32_t npid = (cdw10 >> 1) + 1;
4355+
uint32_t npid = (cdw10 >> 16) + 1;
43564356
unsigned int i = 0;
43574357
g_autofree uint16_t *pids = NULL;
43584358
uint32_t maxnpid;

0 commit comments

Comments
 (0)