[Devel] [PATCH RHEL10 COMMIT] ve: compile the per-Container VDSO copies only on x86

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 21 19:42:21 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.6.vz10
------>
commit 808be136dd616db003ce8cb97de125d34338d633
Author: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Date:   Fri Aug 21 18:37:06 2026 +0200

    ve: compile the per-Container VDSO copies only on x86
    
    Every Container gets its own copy of the VDSO images so that the Linux
    version code inside them can be patched to whatever the Container's
    os_release says.  All of that is built on vdso_image_64 / vdso_image_32,
    which exist on x86 only, while kernel/ve/ve.c is generic code - so the
    file does not compile on an architecture without them, User Mode Linux
    being the one we now want for KUnit:
    
      kernel/ve/ve.c: error: 'vdso_image_64' undeclared here
                      (not in a function)
    
    Guard the ve0 initializer, copy_vdso()/ve_free_vdso() and their callers
    with CONFIG_X86, and give ve_free_vdso() a no-op stub so the error path of
    ve_create() stays as it is.  Its err_vdso label stays reachable either
    way, since ve_mount_devtmpfs() jumps to it too.  A Container on an
    architecture without a patchable VDSO simply keeps the host's.
    
    Feature: mm: vdso virtualization
    https://virtuozzo.atlassian.net/browse/VSTOR-134732
    Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/ve/ve.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 73d1c3b4873e5..3a9f3841fe55b 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -85,8 +85,10 @@ struct ve_struct ve0 = {
 	.meminfo_val		= VE_MEMINFO_SYSTEM,
 	.umh_running_helpers    = ATOMIC_INIT(0),
 	.umh_helpers_waitq      = __WAIT_QUEUE_HEAD_INITIALIZER(ve0.umh_helpers_waitq),
+#ifdef CONFIG_X86
 	.vdso_64		= (struct vdso_image*)&vdso_image_64,
 	.vdso_32		= (struct vdso_image*)&vdso_image_32,
+#endif
 };
 EXPORT_SYMBOL(ve0);
 
@@ -675,6 +677,7 @@ u64 ve_get_uptime(struct ve_struct *ve)
 }
 EXPORT_SYMBOL(ve_get_uptime);
 
+#ifdef CONFIG_X86
 static int copy_vdso(struct vdso_image **vdso_dst, const struct vdso_image *vdso_src)
 {
 	struct vdso_image *vdso;
@@ -712,6 +715,9 @@ static void ve_free_vdso(struct ve_struct *ve)
 		kfree(ve->vdso_32);
 	}
 }
+#else
+static inline void ve_free_vdso(struct ve_struct *ve) { }
+#endif
 
 static struct cgroup_subsys_state *ve_create(struct cgroup_subsys_state *parent_css)
 {
@@ -758,6 +764,7 @@ static struct cgroup_subsys_state *ve_create(struct cgroup_subsys_state *parent_
 	if (err)
 		goto err_log;
 
+#ifdef CONFIG_X86
 	err = copy_vdso(&ve->vdso_64, &vdso_image_64);
 	if (err)
 		goto err_vdso;
@@ -765,6 +772,7 @@ static struct cgroup_subsys_state *ve_create(struct cgroup_subsys_state *parent_
 	err = copy_vdso(&ve->vdso_32, &vdso_image_32);
 	if (err)
 		goto err_vdso;
+#endif
 
 	err = ve_mount_devtmpfs(ve);
 	if (err)
@@ -1158,8 +1166,10 @@ static ssize_t ve_os_release_write(struct kernfs_open_file *of, char *buf,
 
 	if (sscanf(buf, "%d.%d.%d", &n1, &n2, &n3) == 3) {
 		new_version = ((n1 << 16) + (n2 << 8)) + n3;
+#ifdef CONFIG_X86
 		*((int *)(ve->vdso_64->data + ve->vdso_64->sym_linux_version_code)) = new_version;
 		*((int *)(ve->vdso_32->data + ve->vdso_32->sym_linux_version_code)) = new_version;
+#endif
 	}
 
 	down_write(&uts_sem);


More information about the Devel mailing list