Commit 2922ef72 authored by Klaus Jensen's avatar Klaus Jensen Committed by Yong Hu
Browse files

nvme-pci: fix doorbell buffer value endianness

stable inclusion
from stable-v5.10.188
commit f5d8738fbe33e71959b5a69221ecf515032d3fc7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7PZZC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=f5d8738fbe33e71959b5a69221ecf515032d3fc7

--------------------------------

[ Upstream commit b5f96cb7 ]

When using shadow doorbells, the event index and the doorbell values are
written to host memory. Prior to this patch, the values written would
erroneously be written in host endianness. This causes trouble on
big-endian platforms. Fix this by adding missing endian conversions.

This issue was noticed by Guenter while testing various big-endian
platforms under QEMU[1]. A similar fix required for hw/nvme in QEMU is
up for review as well[2].

  [1]: https://lore.kernel.org/qemu-devel/20221209110022.GA3396194@roeck-us.net/
  [2]: https://lore.kernel.org/qemu-devel/20221212114409.34972-4-its@irrelevant.dk/



Fixes: f9f38e33 ("nvme: improve performance for virtual NVMe devices")
Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYong Hu <yong.hu@windriver.com>
parent 4554a847
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment