]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/virtio: add missing compat definitions for vhost_net_test
authorYichong Chen <chenyichong@uniontech.com>
Mon, 29 Jun 2026 02:21:23 +0000 (10:21 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 2 Jul 2026 02:02:56 +0000 (19:02 -0700)
commit74a21a2db6aecff5b01cf6b3a52144dd805d51ff
treef590dc0de9f547b1aa086d8ca2218219dde4165d
parente187bc02f8fa4226d62814592cf064ee4557c470
tools/virtio: add missing compat definitions for vhost_net_test

Patch series "tools: Fix tools/virtio test build", v2.

This series fixes build failures hit by:

  make -C tools/virtio test

Patch 1 adds tools/virtio compatibility definitions needed by current
virtio headers when building the tools/virtio tests.  Patch 2 makes
tools/include/linux/overflow.h include stdint.h for SIZE_MAX, which is
used by its size helper functions.

With the series applied, make -C tools/virtio test builds virtio_test,
vringh_test and vhost_net_test successfully.

Tested on x86_64 and arm64 with:

  make -C tools/virtio clean
  make -C tools/virtio test

This patch (of 2):

vhost_net_test builds virtio_ring.c in userspace.

Recent virtio headers pull in helper headers that are not provided by the
tools/virtio compatibility layer, including asm/percpu_types.h,
linux/completion.h, linux/mod_devicetable.h and linux/virtio_features.h.

Add the missing compat definitions and the DMA attribute used by the
current virtio ring code.

Link: https://lore.kernel.org/20260629022124.131894-1-chenyichong@uniontech.com
Link: https://lore.kernel.org/20260629022124.131894-2-chenyichong@uniontech.com
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Cc: chenyichong <chenyichong@uniontech.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/virtio/asm/percpu_types.h [new file with mode: 0644]
tools/virtio/linux/completion.h [new file with mode: 0644]
tools/virtio/linux/device.h
tools/virtio/linux/dma-mapping.h
tools/virtio/linux/mod_devicetable.h [new file with mode: 0644]
tools/virtio/linux/virtio_features.h [new file with mode: 0644]