[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.2 v2 24/25] block/nvme: Fix nvme_submit_command() on big-en
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.2 v2 24/25] block/nvme: Fix nvme_submit_command() on big-endian host |
Date: |
Thu, 29 Oct 2020 10:33:05 +0100 |
The Completion Queue Command Identifier is a 16-bit value,
so nvme_submit_command() is unlikely to work on big-endian
hosts, as the relevant bits are truncated.
Fix by using the correct byte-swap function.
Fixes: bdd6a90a9e5 ("block: Add VFIO based NVMe driver")
Reported-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
block/nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/nvme.c b/block/nvme.c
index c8ef69cbb28..a06a188d530 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -469,7 +469,7 @@ static void nvme_submit_command(NVMeQueuePair *q,
NVMeRequest *req,
assert(!req->cb);
req->cb = cb;
req->opaque = opaque;
- cmd->cid = cpu_to_le32(req->cid);
+ cmd->cid = cpu_to_le16(req->cid);
trace_nvme_submit_command(q->s, q->index, req->cid);
nvme_trace_command(cmd);
--
2.26.2
- [PATCH-for-5.2 v2 15/25] block/nvme: Simplify ADMIN queue access, (continued)
- [PATCH-for-5.2 v2 15/25] block/nvme: Simplify ADMIN queue access, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 17/25] block/nvme: Set request_alignment at initialization, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 16/25] block/nvme: Simplify nvme_cmd_sync(), Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 18/25] block/nvme: Correct minimum device page size, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 19/25] block/nvme: Change size and alignment of IDENTIFY response buffer, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 20/25] block/nvme: Change size and alignment of queue, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 21/25] block/nvme: Change size and alignment of prp_list_pages, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 22/25] block/nvme: Align iov's va and size on host page size, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 23/25] block/nvme: Fix use of write-only doorbells page on Aarch64 arch, Philippe Mathieu-Daudé, 2020/10/29
- [PATCH-for-5.2 v2 24/25] block/nvme: Fix nvme_submit_command() on big-endian host,
Philippe Mathieu-Daudé <=
- [PATCH-for-6.0 v2 25/25] block/nvme: Simplify Completion Queue Command Identifier field use, Philippe Mathieu-Daudé, 2020/10/29