aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/vdso.h
diff options
context:
space:
mode:
authorGravatar Dmitry Safonov <dima@arista.com> 2019-11-12 01:27:11 +0000
committerGravatar Thomas Gleixner <tglx@linutronix.de> 2020-01-14 12:20:58 +0100
commit550a77a74c87ecfdadc2214fef4b25ff125f65ab (patch)
tree3ad1235100d73310a7025a73124fe92e022fa9a9 /arch/x86/include/asm/vdso.h
parentx86/vdso: Provide vdso_data offset on vvar_page (diff)
downloadlinux-550a77a74c87ecfdadc2214fef4b25ff125f65ab.tar.gz
linux-550a77a74c87ecfdadc2214fef4b25ff125f65ab.tar.bz2
linux-550a77a74c87ecfdadc2214fef4b25ff125f65ab.zip
x86/vdso: Add time napespace page
To support time namespaces in the VDSO with a minimal impact on regular non time namespace affected tasks, the namespace handling needs to be hidden in a slow path. The most obvious place is vdso_seq_begin(). If a task belongs to a time namespace then the VVAR page which contains the system wide VDSO data is replaced with a namespace specific page which has the same layout as the VVAR page. That page has vdso_data->seq set to 1 to enforce the slow path and vdso_data->clock_mode set to VCLOCK_TIMENS to enforce the time namespace handling path. The extra check in the case that vdso_data->seq is odd, e.g. a concurrent update of the VDSO data is in progress, is not really affecting regular tasks which are not part of a time namespace as the task is spin waiting for the update to finish and vdso_data->seq to become even again. If a time namespace task hits that code path, it invokes the corresponding time getter function which retrieves the real VVAR page, reads host time and then adds the offset for the requested clock which is stored in the special VVAR page. Allocate the time namespace page among VVAR pages and place vdso_data on it. Provide __arch_get_timens_vdso_data() helper for VDSO code to get the code-relative position of VVARs on that special page. Co-developed-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20191112012724.250792-23-dima@arista.com
Diffstat (limited to 'arch/x86/include/asm/vdso.h')
-rw-r--r--arch/x86/include/asm/vdso.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h
index 230474e2ddb5..bbcdc7b8f963 100644
--- a/arch/x86/include/asm/vdso.h
+++ b/arch/x86/include/asm/vdso.h
@@ -21,6 +21,7 @@ struct vdso_image {
long sym_vvar_page;
long sym_pvclock_page;
long sym_hvclock_page;
+ long sym_timens_page;
long sym_VDSO32_NOTE_MASK;
long sym___kernel_sigreturn;
long sym___kernel_rt_sigreturn;