[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200706165534.GA61340@C02TD0UTHF1T.local>
Date: Mon, 6 Jul 2020 17:55:44 +0100
From: Mark Rutland <mark.rutland@....com>
To: Marc Zyngier <maz@...nel.org>
Cc: Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-team@...roid.com, stable@...r.kernel.org
Subject: Re: [PATCH v2 2/4] arm64: arch_timer: Allow an workaround descriptor
to disable compat vdso
On Mon, Jul 06, 2020 at 05:38:00PM +0100, Marc Zyngier wrote:
> As we are about to disable the vdso for compat tasks in some circumstances,
> let's allow a workaround descriptor to express exactly that.
>
> Cc: stable@...r.kernel.org
> Signed-off-by: Marc Zyngier <maz@...nel.org>
Acked-by: Mark Rutland <mark.rutland@....com>
Mark.
> ---
> arch/arm64/include/asm/arch_timer.h | 1 +
> drivers/clocksource/arm_arch_timer.c | 3 +++
> 2 files changed, 4 insertions(+)
>
> diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
> index 7ae54d7d333a..9f0ec21d6327 100644
> --- a/arch/arm64/include/asm/arch_timer.h
> +++ b/arch/arm64/include/asm/arch_timer.h
> @@ -58,6 +58,7 @@ struct arch_timer_erratum_workaround {
> u64 (*read_cntvct_el0)(void);
> int (*set_next_event_phys)(unsigned long, struct clock_event_device *);
> int (*set_next_event_virt)(unsigned long, struct clock_event_device *);
> + bool disable_compat_vdso;
> };
>
> DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *,
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index ecf7b7db2d05..a8e4fb429f52 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -566,6 +566,9 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa
> if (wa->read_cntvct_el0) {
> clocksource_counter.vdso_clock_mode = VDSO_CLOCKMODE_NONE;
> vdso_default = VDSO_CLOCKMODE_NONE;
> + } else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) {
> + vdso_default = VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT;
> + clocksource_counter.vdso_clock_mode = vdso_default;
> }
> }
>
> --
> 2.27.0
>
Powered by blists - more mailing lists