From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Fri, 21 Aug 2026 18:37:05 +0200 Subject: [Devel] [PATCH vz10 19/32] ve: include asm/vdso.h on x86 only In-Reply-To: <20260821163718.187766-1-khorenko@virtuozzo.com> References: <20260821163718.187766-1-khorenko@virtuozzo.com> Message-ID: <20260821163718.187766-20-khorenko@virtuozzo.com> List-Id: include/linux/ve.h includes asm/vdso.h for struct vdso_image, which struct ve_struct keeps two pointers to - the per-Container copies of the VDSO images. The header is x86-only, and ve.h is included from a lot of generic code, so building for an architecture without it fails everywhere at once - User Mode Linux, which we now want for KUnit, has no asm/vdso.h at all: include/linux/ve.h:21:10: fatal error: asm/vdso.h: No such file or directory A forward declaration of struct vdso_image is all the rest of the header needs there, since nothing outside x86 dereferences one. For the same reason compile the CONFIG_VE=n stubs of ve_get_vdso_32() / ve_get_vdso_64() on x86 only: they hand out vdso_image_32 / vdso_image_64, which exist nowhere else, and their callers are all in arch/x86. Also drop the duplicated linux/binfmts.h include while touching this block. Feature: mm: vdso virtualization https://virtuozzo.atlassian.net/browse/VSTOR-134732 Reported-by: Eva Kurchatova Signed-off-by: Konstantin Khorenko --- include/linux/ve.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/ve.h b/include/linux/ve.h index cba827260d07..46e67d00cf78 100644 --- a/include/linux/ve.h +++ b/include/linux/ve.h @@ -18,11 +18,19 @@ #include #include #include -#include #include -#include #include +/* + * struct vdso_image and the static images the stubs below hand out are + * x86-only; User Mode Linux has no asm/vdso.h at all. + */ +#ifdef CONFIG_X86 +#include +#else +struct vdso_image; +#endif + struct nsproxy; struct user_namespace; struct ve_namespace; @@ -366,6 +374,7 @@ static inline void ve_setup_task(struct task_struct *p, struct ve_struct *ve) { static inline void ve_set_rpc_kill_fn(void (*fn)(struct net *, bool)) { } +#ifdef CONFIG_X86 static inline struct vdso_image *ve_get_vdso_32(struct ve_struct *ve) { return (struct vdso_image *)&vdso_image_32; @@ -375,6 +384,7 @@ static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve) { return (struct vdso_image *)&vdso_image_64; } +#endif /* CONFIG_X86 */ #endif /* CONFIG_VE */ -- 2.47.1