]> git.ipfire.org Git - thirdparty/linux.git/commit
vduse: avoid adding implicit padding
authorArnd Bergmann <arnd@arndb.de>
Mon, 2 Feb 2026 22:48:07 +0000 (23:48 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 9 Feb 2026 17:21:32 +0000 (12:21 -0500)
commitebcff9dacaf2c1418f8bc927388186d7d3674603
tree8d02abcf6245f824c5f53d6f6f94d31a22de1a02
parent5145b277309f3818e2db507f525d19ac3b910922
vduse: avoid adding implicit padding

The vduse_iova_range_v2 and vduse_iotlb_entry_v2 structures are both
defined in a way that adds implicit padding and is incompatible between
i386 and x86_64 userspace because of the different structure alignment
requirements. Building the header with -Wpadded shows these new warnings:

vduse.h:305:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]
vduse.h:374:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]

Change the amount of padding in these two structures to align them to
64 bit words and avoid those problems. Since the v1 vduse_iotlb_entry
already has an inconsistent size, do not attempt to reuse the structure
but rather list the members indiviudally, with a fixed amount of
padding.

Fixes: 079212f6877e ("vduse: add vq group asid support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260202224835.559538-1-arnd@kernel.org>
drivers/vdpa/vdpa_user/vduse_dev.c
include/uapi/linux/vduse.h