Skip to content

Commit c1fbec4

Browse files
Marc Zyngierwilldeacon
authored andcommitted
arm64: arch_timer: Allow an workaround descriptor to disable compat vdso
As we are about to disable the vdso for compat tasks in some circumstances, let's allow a workaround descriptor to express exactly that. Signed-off-by: Marc Zyngier <[email protected]> Acked-by: Mark Rutland <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 97884ca commit c1fbec4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/arm64/include/asm/arch_timer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct arch_timer_erratum_workaround {
5858
u64 (*read_cntvct_el0)(void);
5959
int (*set_next_event_phys)(unsigned long, struct clock_event_device *);
6060
int (*set_next_event_virt)(unsigned long, struct clock_event_device *);
61+
bool disable_compat_vdso;
6162
};
6263

6364
DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *,

drivers/clocksource/arm_arch_timer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa
566566
if (wa->read_cntvct_el0) {
567567
clocksource_counter.vdso_clock_mode = VDSO_CLOCKMODE_NONE;
568568
vdso_default = VDSO_CLOCKMODE_NONE;
569+
} else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) {
570+
vdso_default = VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT;
571+
clocksource_counter.vdso_clock_mode = vdso_default;
569572
}
570573
}
571574

0 commit comments

Comments
 (0)