Skip to content

Commit

Permalink
vdso/ARM: Make union vdso_data_store available for all architectures
Browse files Browse the repository at this point in the history
The vDSO data page "union vdso_data_store" is defined in an ARM specific
header file and also defined in several other places.

Move the definition from the ARM header file into the generic vdso datapage
header to make it also usable for others and to prevent code duplication.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20240219153939.75719-5-anna-maria@linutronix.de
  • Loading branch information
Anna-Maria Behnsen authored and Thomas Gleixner committed Feb 20, 2024
1 parent 4eb0833 commit a0d2fcd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 32 deletions.
1 change: 0 additions & 1 deletion arch/arm/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <asm/auxvec.h>
#include <asm/hwcap.h>
#include <asm/vdso_datapage.h>

/*
* ELF register definitions..
Expand Down
26 changes: 0 additions & 26 deletions arch/arm/include/asm/vdso_datapage.h

This file was deleted.

4 changes: 3 additions & 1 deletion arch/arm/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
#include <asm/mpu.h>
#include <asm/procinfo.h>
#include <asm/suspend.h>
#include <asm/vdso_datapage.h>
#include <asm/hardware/cache-l2x0.h>
#include <linux/kbuild.h>
#include <linux/arm-smccc.h>

#include <vdso/datapage.h>

#include "signal.h"

/*
Expand Down
4 changes: 0 additions & 4 deletions arch/arm/kernel/vdso.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <asm/cacheflush.h>
#include <asm/page.h>
#include <asm/vdso.h>
#include <asm/vdso_datapage.h>
#include <clocksource/arm_arch_timer.h>
#include <vdso/helpers.h>
#include <vdso/vsyscall.h>
Expand All @@ -35,9 +34,6 @@ extern char vdso_start[], vdso_end[];
/* Total number of pages needed for the data and text portions of the VDSO. */
unsigned int vdso_total_pages __ro_after_init;

/*
* The VDSO data page.
*/
static union vdso_data_store vdso_data_store __page_aligned_data;
struct vdso_data *vdso_data = vdso_data_store.data;

Expand Down
10 changes: 10 additions & 0 deletions include/vdso/datapage.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <vdso/time32.h>
#include <vdso/time64.h>

#include <asm/page.h>

#ifdef CONFIG_ARCH_HAS_VDSO_DATA
#include <asm/vdso/data.h>
#else
Expand Down Expand Up @@ -121,6 +123,14 @@ struct vdso_data {
extern struct vdso_data _vdso_data[CS_BASES] __attribute__((visibility("hidden")));
extern struct vdso_data _timens_data[CS_BASES] __attribute__((visibility("hidden")));

/**
* union vdso_data_store - Generic vDSO data page
*/
union vdso_data_store {
struct vdso_data data[CS_BASES];
u8 page[PAGE_SIZE];
};

/*
* The generic vDSO implementation requires that gettimeofday.h
* provides:
Expand Down

0 comments on commit a0d2fcd

Please sign in to comment.