lkml.org 
[lkml]   [2016]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/6] x86/arch_prctl/vdso: add ARCH_MAP_VDSO_*
Date
Add API to change vdso blob type with arch_prctl.
As this is useful yet only by needs of CRIU, expose
this interface under CONFIG_CHECKPOINT_RESTORE.

Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
arch/x86/include/uapi/asm/prctl.h | 6 ++++++
arch/x86/kernel/process_64.c | 10 ++++++++++
2 files changed, 16 insertions(+)

diff --git a/arch/x86/include/uapi/asm/prctl.h b/arch/x86/include/uapi/asm/prctl.h
index 3ac5032fae09..ae135de547f5 100644
--- a/arch/x86/include/uapi/asm/prctl.h
+++ b/arch/x86/include/uapi/asm/prctl.h
@@ -6,4 +6,10 @@
#define ARCH_GET_FS 0x1003
#define ARCH_GET_GS 0x1004

+#ifdef CONFIG_CHECKPOINT_RESTORE
+# define ARCH_MAP_VDSO_X32 0x2001
+# define ARCH_MAP_VDSO_32 0x2002
+# define ARCH_MAP_VDSO_64 0x2003
+#endif
+
#endif /* _ASM_X86_PRCTL_H */
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6e789ca1f841..64459c88b3d9 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -49,6 +49,7 @@
#include <asm/debugreg.h>
#include <asm/switch_to.h>
#include <asm/xen/hypervisor.h>
+#include <asm/vdso.h>

asmlinkage extern void ret_from_fork(void);

@@ -577,6 +578,15 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
break;
}

+#ifdef CONFIG_CHECKPOINT_RESTORE
+ case ARCH_MAP_VDSO_X32:
+ return do_map_vdso(VDSO_X32, addr, false);
+ case ARCH_MAP_VDSO_32:
+ return do_map_vdso(VDSO_32, addr, false);
+ case ARCH_MAP_VDSO_64:
+ return do_map_vdso(VDSO_64, addr, false);
+#endif
+
default:
ret = -EINVAL;
break;
--
2.8.2
\
 
 \ /
  Last update: 2016-06-01 15:21    [W:0.242 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site