Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a556f4f authored by Chris Metcalf's avatar Chris Metcalf
Browse files

tile: implement gettimeofday() via vDSO



This change creates the framework for vDSO calls, makes the existing
rt_sigreturn() mechanism use it, and adds a fast gettimeofday().
Now that we need to expose the vDSO address to userspace, we add
AT_SYSINFO_EHDR to the set of aux entries provided to userspace.
(You can disable any extra vDSO support by booting with vdso=0,
but the rt_sigreturn vDSO page will still be provided.)

Note that glibc has supported the tile vDSO since release 2.17.

Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 0c1d1917
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -64,6 +64,9 @@ config HUGETLB_SUPER_PAGES
	depends on HUGETLB_PAGE && TILEGX
	def_bool y

config GENERIC_TIME_VSYSCALL
	def_bool y

# FIXME: tilegx can implement a more efficient rwsem.
config RWSEM_GENERIC_SPINLOCK
	def_bool y
+5 −0
Original line number Diff line number Diff line
@@ -132,6 +132,11 @@ extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
struct linux_binprm;
extern int arch_setup_additional_pages(struct linux_binprm *bprm,
				       int executable_stack);
#define ARCH_DLINFO \
do { \
	NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \
} while (0)

#ifdef CONFIG_COMPAT

#define COMPAT_ELF_PLATFORM "tilegx-m32"
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ struct mm_context {
	 * semaphore but atomically, but it is conservatively set.
	 */
	unsigned long priority_cached;
	unsigned long vdso_base;
};

typedef struct mm_context mm_context_t;
+7 −1
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@
#define PAGE_MASK	(~(PAGE_SIZE - 1))
#define HPAGE_MASK	(~(HPAGE_SIZE - 1))

/*
 * We do define AT_SYSINFO_EHDR to support vDSO,
 * but don't use the gate mechanism.
 */
#define __HAVE_ARCH_GATE_AREA		1

/*
 * If the Kconfig doesn't specify, set a maximum zone order that
 * is enough so that we can create huge pages from small pages given
@@ -246,7 +252,7 @@ static inline __attribute_const__ int get_order(unsigned long size)

#endif /* __tilegx__ */

#ifndef __ASSEMBLY__
#if !defined(__ASSEMBLY__) && !defined(VDSO_BUILD)

#ifdef CONFIG_HIGHMEM

+3 −3
Original line number Diff line number Diff line
@@ -180,10 +180,10 @@ struct thread_struct {
#define TASK_SIZE		TASK_SIZE_MAX
#endif

/* We provide a minimal "vdso" a la x86; just the sigreturn code for now. */
#define VDSO_BASE		(TASK_SIZE - PAGE_SIZE)
#define VDSO_BASE	((unsigned long)current->active_mm->context.vdso_base)
#define VDSO_SYM(x)	(VDSO_BASE + (unsigned long)(x))

#define STACK_TOP		VDSO_BASE
#define STACK_TOP		TASK_SIZE

/* STACK_TOP_MAX is used temporarily in execve and should not check COMPAT. */
#define STACK_TOP_MAX		TASK_SIZE_MAX
Loading