hw/block/nvme: fix 64 bit register hi/lo split writes
commit0d3d5da2ccc8823c7c904b790b8d0fdf569790f0
authorKlaus Jensen <k.jensen@samsung.com>
Mon, 18 Jan 2021 06:31:45 +0000 (18 07:31 +0100)
committerKlaus Jensen <k.jensen@samsung.com>
Mon, 8 Feb 2021 20:15:53 +0000 (8 21:15 +0100)
tree8d332dfff345f0459bf6cb82dc7c46b5dec5a0a9
parentffacaf090893c5d6a5a6ea51b93087411af859c4
hw/block/nvme: fix 64 bit register hi/lo split writes

64 bit registers like ASQ and ACQ should be writable by both a hi/lo 32
bit write combination as well as a plain 64 bit write. The spec does not
define ordering on the hi/lo split, but the code currently assumes that
the low order bits are written first. Additionally, the code does not
consider that another address might already have been written into the
register, causing the OR'ing to result in a bad address.

Fix this by explicitly overwriting only the low or high order bits for
32 bit writes.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
hw/block/nvme.c