Skip to content

Commit

Permalink
FROMLIST: [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK
Browse files Browse the repository at this point in the history
(cherry picked from url https://patchwork.kernel.org/patch/10044543/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <[email protected]>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Add ARCH_CLOCK_FIXED_MASK as an efficiency since arm64 has no
purpose for cs_mask vdso_data variable.

Signed-off-by: Mark Salyzyn <[email protected]>
Cc: James Morse <[email protected]>
Cc: Russell King <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Dmitry Safonov <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Laura Abbott <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Andy Gross <[email protected]>
Cc: Kevin Brodsky <[email protected]>
Cc: Andrew Pinski <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Bug: 63737556
Bug: 20045882
Change-Id: Iadf94bed6166d2ee43bb46bdf54636618e4b8854
  • Loading branch information
Mark Salyzyn authored and erfanoabdi committed Jun 2, 2020
1 parent 413d757 commit 188903f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/arm/vdso/vgettimeofday.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ static notrace int do_realtime(const struct vdso_data *vd, struct timespec *ts)
{
u32 seq, mult, shift;
u64 nsec, cycle_last;
#ifdef ARCH_CLOCK_FIXED_MASK
static const u64 mask = ARCH_CLOCK_FIXED_MASK;
#else
u64 mask;
#endif
vdso_xtime_clock_sec_t sec;

do {
Expand All @@ -141,7 +145,9 @@ static notrace int do_realtime(const struct vdso_data *vd, struct timespec *ts)

mult = vd->cs_mono_mult;
shift = vd->cs_shift;
#ifndef ARCH_CLOCK_FIXED_MASK
mask = vd->cs_mask;
#endif

sec = vd->xtime_clock_sec;
nsec = vd->xtime_clock_snsec;
Expand All @@ -161,7 +167,11 @@ static notrace int do_monotonic(const struct vdso_data *vd, struct timespec *ts)
{
u32 seq, mult, shift;
u64 nsec, cycle_last;
#ifdef ARCH_CLOCK_FIXED_MASK
static const u64 mask = ARCH_CLOCK_FIXED_MASK;
#else
u64 mask;
#endif
vdso_wtm_clock_nsec_t wtm_nsec;
__kernel_time_t sec;

Expand All @@ -175,7 +185,9 @@ static notrace int do_monotonic(const struct vdso_data *vd, struct timespec *ts)

mult = vd->cs_mono_mult;
shift = vd->cs_shift;
#ifndef ARCH_CLOCK_FIXED_MASK
mask = vd->cs_mask;
#endif

sec = vd->xtime_clock_sec;
nsec = vd->xtime_clock_snsec;
Expand All @@ -200,7 +212,11 @@ static notrace int do_monotonic_raw(const struct vdso_data *vd,
{
u32 seq, mult, shift;
u64 nsec, cycle_last;
#ifdef ARCH_CLOCK_FIXED_MASK
static const u64 mask = ARCH_CLOCK_FIXED_MASK;
#else
u64 mask;
#endif
vdso_raw_time_sec_t sec;

do {
Expand All @@ -213,7 +229,9 @@ static notrace int do_monotonic_raw(const struct vdso_data *vd,

mult = vd->cs_raw_mult;
shift = vd->cs_shift;
#ifndef ARCH_CLOCK_FIXED_MASK
mask = vd->cs_mask;
#endif

sec = vd->raw_time_sec;
nsec = vd->raw_time_nsec;
Expand Down

0 comments on commit 188903f

Please sign in to comment.