Commit 81ca4c78 authored by Philipp Tomsich's avatar Philipp Tomsich Committed by Yang Yingliang
Browse files

arm64:ilp32: add vdso-ilp32 and use for signal return



hulk inclusion
category: feature
bugzilla: NA
CVE: NA
---------------------------

ILP32 VDSO exports following symbols:
 __kernel_rt_sigreturn;
 __kernel_gettimeofday;
 __kernel_clock_gettime;
 __kernel_clock_getres.

What shared object to use, kernel selects depending on result of
is_ilp32_compat_task() in arch/arm64/kernel/vdso.c, so it substitutes
correct pages and spec.

Adjusted to move the data page before code pages in sync with
commit 601255ae ("arm64: vdso: move data page before code pages")

Signed-off-by: default avatarPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: default avatarChristoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
Signed-off-by: default avatarBamvor Jian Zhang <bamv2005@gmail.com>

 Conflicts:
	arch/arm64/Makefile
	arch/arm64/kernel/vdso.c
	arch/arm64/kernel/vdso/gettimeofday.S
[wangxiongfeng:
6d68752e7 arm64: makefile fix build of .i file in external module case
Above commit introduce 'ifdef KBUILD_EXTMOD' in arch/arm64/Makefile. We
add the mofication inside the 'ifdef'.
1126b81b arm64/vdso: don't leak kernel addresses
Above commit remote the 'pr_info()' in vdso.c. We also remove it to be
consistent.
7d5d601 arm64:vdso: Rewrite gettimeofday into C
Above commit convert gettimeofday.S to gettimeofday.c, which cause a
lot of conflicts. We fix the conflicts according to the following link.
https://patchwork.kernel.org/patch/9757163/

 ]
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarHanjun Guo &lt;guohanjun@huawei.com <mailto:guohanjun@huawei.com&gt;>

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent ca25e8c9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -158,6 +158,9 @@ ifeq ($(KBUILD_EXTMOD),)
prepare: vdso_prepare
vdso_prepare: prepare0
	$(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso include/generated/vdso-offsets.h
ifeq ($(CONFIG_ARM64_ILP32), y)
	$(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso-ilp32 include/generated/vdso-ilp32-offsets.h
endif
endif

define archhelp
+6 −0
Original line number Diff line number Diff line
@@ -29,6 +29,12 @@

#include <generated/vdso-offsets.h>

#ifdef CONFIG_ARM64_ILP32
#include <generated/vdso-ilp32-offsets.h>
#else
#define vdso_offset_sigtramp_ilp32	({ BUILD_BUG(); 0; })
#endif

#define VDSO_SYMBOL(base, name)						   \
({									   \
	(void *)(vdso_offset_##name - VDSO_LBASE + (unsigned long)(base)); \
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ arm64-obj-$(CONFIG_SDEI_WATCHDOG) += watchdog_sdei.o
arm64-obj-$(CONFIG_MPAM)		+= mpam.o mpam_ctrlmon.o mpam_mon.o

obj-y					+= $(arm64-obj-y) vdso/ probes/
obj-$(CONFIG_ARM64_ILP32)		+= vdso-ilp32/
obj-m					+= $(arm64-obj-m)
head-y					:= head.o
extra-y					+= $(head-y) vmlinux.lds
+7 −0
Original line number Diff line number Diff line
@@ -129,6 +129,13 @@ int main(void)
  DEFINE(TSPEC_TV_SEC,		offsetof(struct timespec, tv_sec));
  DEFINE(TSPEC_TV_NSEC,		offsetof(struct timespec, tv_nsec));
  BLANK();
#ifdef CONFIG_COMPAT
  DEFINE(COMPAT_TVAL_TV_SEC,	offsetof(struct compat_timeval, tv_sec));
  DEFINE(COMPAT_TVAL_TV_USEC,	offsetof(struct compat_timeval, tv_usec));
  DEFINE(COMPAT_TSPEC_TV_SEC,	offsetof(struct compat_timespec, tv_sec));
  DEFINE(COMPAT_TSPEC_TV_NSEC,	offsetof(struct compat_timespec, tv_nsec));
  BLANK();
#endif
  DEFINE(TZ_MINWEST,		offsetof(struct timezone, tz_minuteswest));
  DEFINE(TZ_DSTTIME,		offsetof(struct timezone, tz_dsttime));
  BLANK();
+2 −0
Original line number Diff line number Diff line
vdso-ilp32.lds
vdso-ilp32-offsets.h
Loading