[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.0.2 27/27] hw/nvme: fix number of PIDs for FDP RUH update
From: |
Michael Tokarev |
Subject: |
[Stable-9.0.2 27/27] hw/nvme: fix number of PIDs for FDP RUH update |
Date: |
Mon, 15 Jul 2024 12:34:34 +0300 |
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>
(cherry picked from commit 3936bbdf9a2e9233875f850c7576c79d06add261)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 127c3d2383..e89f9f7808 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.39.2
- [Stable-9.0.2 00/27] Patch Round-up for stable 9.0.2, frozen on 2024-07-14, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 23/27] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(), Michael Tokarev, 2024/07/15
- [Stable-9.0.2 25/27] char-stdio: Restore blocking mode of stdout on exit, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 27/27] hw/nvme: fix number of PIDs for FDP RUH update,
Michael Tokarev <=
- [Stable-9.0.2 26/27] sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 24/27] virtio: remove virtio_tswap16s() call in vring_packed_event_read(), Michael Tokarev, 2024/07/15