Re: [PATCH v2] arm64: Enable data independent timing (DIT) in the kernel

Will Deacon
2022-11-08T14:58:13Z

On Tue, Nov 08, 2022 at 02:41:26PM +0000, Mark Rutland wrote:
> On Mon, Nov 07, 2022 at 06:24:00PM +0100, Ard Biesheuvel wrote:
> > diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
> > index 8b02d310838f9240..3032a82ea51a19f7 100644
> > --- a/arch/arm64/kernel/suspend.c
> > +++ b/arch/arm64/kernel/suspend.c
> > @@ -60,6 +60,8 @@ void notrace __cpu_suspend_exit(void)
> > * PSTATE was not saved over suspend/resume, re-enable any detected
> > * features that might not have been set correctly.
> > */
> > + if (cpu_has_dit())
> > + set_pstate_dit(1);
>
> As above, I'd prefer if we either renamed cpu_has_dit() to cpus_have_dit(), or
> just open-coded this as:
>
> if (cpus_have_const_cap(ARM64_HAS_DIT))
> set_pstate_dit(1);
>
> With either of those options:
>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
>
> I assume Will might fix that up when applying.

Yup, I'll take care of that.

Will