linux/tools/virtio/linux
Yichong Chen 74a21a2db6 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>
2026-07-01 19:02:56 -07:00
..
bug.h tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
build_bug.h tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
compiler.h tools/virtio: fix up compiler.h stub 2025-12-24 08:02:55 -05:00
completion.h tools/virtio: add missing compat definitions for vhost_net_test 2026-07-01 19:02:56 -07:00
cpumask.h tools/virtio: add struct cpumask to cpumask.h 2025-12-24 08:02:56 -05:00
device.h tools/virtio: add missing compat definitions for vhost_net_test 2026-07-01 19:02:56 -07:00
dma-mapping.h tools/virtio: add missing compat definitions for vhost_net_test 2026-07-01 19:02:56 -07:00
err.h tools/virtio: fix build for kmalloc_obj API and missing stubs 2026-06-10 02:16:59 -04:00
export.h tools/virtio: fix build after 4.2 changes 2015-09-09 22:03:30 +03:00
gfp.h tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
hrtimer.h tools/virtio: add linux/hrtimer.h stub 2012-02-28 09:13:14 +02:00
irqreturn.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
kernel.h tools/virtio: fix build for kmalloc_obj API and missing stubs 2026-06-10 02:16:59 -04:00
kmemleak.h tools/virtio: fix missing kmemleak_ignore symbol 2014-03-13 11:23:25 +10:30
kmsan.h kmsan: convert kmsan_handle_dma to use physical addresses 2025-09-12 00:18:20 +02:00
mm_types.h tools/virtio: handle fallout from folio work 2022-03-06 06:06:50 -05:00
mod_devicetable.h tools/virtio: add missing compat definitions for vhost_net_test 2026-07-01 19:02:56 -07:00
module.h tools/virtio: add struct module forward declaration 2025-12-24 08:02:56 -05:00
printk.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
ratelimit.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
scatterlist.h tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
slab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spinlock.h tools/virtio: fix build 2021-08-11 06:44:24 -04:00
thread_info.h tools/virtio: more stubs to fix tools build 2018-01-29 12:02:54 -05:00
topology.h tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
uaccess.h tools/virtio: fix build caused by virtio_ring changes 2023-04-21 03:02:35 -04:00
ucopysize.h tools/virtio: add ucopysize.h stub 2025-12-24 08:02:56 -05:00
uio.h tools/virtio: add vring_test. 2013-03-20 14:06:04 +10:30
virtio_byteorder.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
virtio_config.h tools/virtio: switch to kernel's virtio_config.h 2025-12-24 08:02:56 -05:00
virtio_features.h tools/virtio: add missing compat definitions for vhost_net_test 2026-07-01 19:02:56 -07:00
virtio_ring.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
virtio.h tools/virtio: use kernel's virtio.h 2025-12-24 08:02:55 -05:00
vringh.h tools/virtio: fix build 2022-08-11 04:26:07 -04:00