[7/8] vdso: Add compatible property to vdso_maps

Submitted by Dmitry Safonov on July 25, 2019, 10:01 p.m.

Details

Message ID 20190725220114.16977-8-dima@arista.com
State Accepted
Series "vdso: Use gettimeofday() from vdso for timings"
Commit c16258a247596e0c1839ef1fcb946e21efd70ef6
Headers show

Commit Message

Dmitry Safonov July 25, 2019, 10:01 p.m.
We need to differ compatible (ia32) vdso maps from x86_64.
That dictates ABI on vdso code.
According to that, the decision to (not) use gettimeofday() from vdso in
64-bit restorer.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 criu/include/util-vdso.h | 1 +
 criu/vdso.c              | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/include/util-vdso.h b/criu/include/util-vdso.h
index c74360c876f8..33b7411deeb1 100644
--- a/criu/include/util-vdso.h
+++ b/criu/include/util-vdso.h
@@ -38,6 +38,7 @@  struct vdso_maps {
 	unsigned long		vdso_start;
 	unsigned long		vvar_start;
 	struct vdso_symtable	sym;
+	bool			compatible;
 };
 
 #define VDSO_SYMBOL_INIT	{ .offset = VDSO_BAD_ADDR, }
diff --git a/criu/vdso.c b/criu/vdso.c
index 257cbcd929cf..50b8b8dba52c 100644
--- a/criu/vdso.c
+++ b/criu/vdso.c
@@ -597,7 +597,8 @@  int vdso_init_restore(void)
 
 	vdso_maps.sym = kdat.vdso_sym;
 #ifdef CONFIG_COMPAT
-	vdso_maps_compat.sym = kdat.vdso_sym_compat;
+	vdso_maps_compat.sym		= kdat.vdso_sym_compat;
+	vdso_maps_compat.compatible	= true;
 #endif
 
 	return 0;
@@ -621,7 +622,8 @@  int kerndat_vdso_fill_symtable(void)
 		pr_err("Failed to fill compat vdso symtable\n");
 		return -1;
 	}
-	kdat.vdso_sym_compat = vdso_maps_compat.sym;
+	vdso_maps_compat.compatible	= true;
+	kdat.vdso_sym_compat		= vdso_maps_compat.sym;
 #endif
 
 	return 0;