block/nvme: Fix use of write-only doorbells page on Aarch64 arch
commit4b19e9b8159b5eecf8e90c81c56c1a13547e411a
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 29 Oct 2020 09:33:04 +0000 (29 10:33 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 3 Nov 2020 19:06:22 +0000 (3 19:06 +0000)
treecd0f435cda29e905d84b1ab8ed033e36f41c8e6d
parent9e13d598843cca1cdab7b7bdcb9cc0868ebf7fed
block/nvme: Fix use of write-only doorbells page on Aarch64 arch

qemu_vfio_pci_map_bar() calls mmap(), and mmap(2) states:

  'offset' must be a multiple of the page size as returned
   by sysconf(_SC_PAGE_SIZE).

In commit f68453237b9 we started to use an offset of 4K which
broke this contract on Aarch64 arch.

Fix by mapping at offset 0, and and accessing doorbells at offset=4K.

Fixes: f68453237b9 ("block/nvme: Map doorbells pages write-only")
Reported-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-24-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
block/nvme.c