[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 26/71] block/nvme: Remove QEMU_PACKED from naturally
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 26/71] block/nvme: Remove QEMU_PACKED from naturally aligned NVMeRegs struct |
Date: |
Mon, 25 Feb 2019 16:20:08 +0100 |
From: Thomas Huth <address@hidden>
The QEMU_PACKED is causing a compiler warning/error with GCC 9:
CC block/nvme.o
block/nvme.c: In function ‘nvme_create_queue_pair’:
block/nvme.c:209:22: error: taking address of packed member of
‘struct <anonymous>’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
209 | q->sq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale];
All members of the struct are naturally aligned, so there should
not be the need for QEMU_PACKED here, and the following QEMU_BUILD_BUG_ON
also ensures that there is no padding. Thus simply remove the QEMU_PACKED
here.
Buglink: https://bugs.launchpad.net/qemu/+bug/1817525
Reported-by: Satheesh Rajendran <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/nvme.c b/block/nvme.c
index b5952c9b08..6c2ce7dfa5 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -82,7 +82,7 @@ typedef volatile struct {
uint8_t reserved1[0xec0];
uint8_t cmd_set_specfic[0x100];
uint32_t doorbells[];
-} QEMU_PACKED NVMeRegs;
+} NVMeRegs;
QEMU_BUILD_BUG_ON(offsetof(NVMeRegs, doorbells) != 0x1000);
--
2.20.1
- [Qemu-block] [PULL 29/71] block: Skip implicit nodes for filename info, (continued)
- [Qemu-block] [PULL 29/71] block: Skip implicit nodes for filename info, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 36/71] block: bdrv_get_full_backing_filename_from_...'s ret. val., Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 38/71] block: Add bdrv_make_absolute_filename(), Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 33/71] iotests.py: Add node_info(), Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 35/71] block: Make path_combine() return the path, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 28/71] block: Use children list in bdrv_refresh_filename, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 37/71] block: bdrv_get_full_backing_filename's ret. val., Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 42/71] quorum: Make bdrv_dirname() return NULL, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 34/71] iotests: Add test for backing file overrides, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 41/71] blkverify: Make bdrv_dirname() return NULL, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 26/71] block/nvme: Remove QEMU_PACKED from naturally aligned NVMeRegs struct,
Kevin Wolf <=
- [Qemu-block] [PULL 40/71] block: Add bdrv_dirname(), Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 30/71] block: Add BDS.auto_backing_file, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 43/71] block/nbd: Make bdrv_dirname() return NULL, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 31/71] block: Respect backing bs in bdrv_refresh_filename, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 27/71] block: Use bdrv_refresh_filename() to pull, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 39/71] block: Fix bdrv_find_backing_image(), Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 44/71] block/nfs: Implement bdrv_dirname(), Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 45/71] block: Use bdrv_dirname() for relative filenames, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 47/71] block: Add strong_runtime_opts to BlockDriver, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 46/71] iotests: Add quorum case to test 110, Kevin Wolf, 2019/02/25