On Fri, Nov 24, 2023 at 04:34:50PM +0000, Joey Gouly wrote:
> @@ -498,6 +508,17 @@ static void erratum_1418040_new_exec(void)
>       preempt_enable();
>  }
>  
> +static void permission_overlay_switch(struct task_struct *next)
> +{
> +     if (system_supports_poe()) {
> +             current->thread.por_el0 = read_sysreg_s(SYS_POR_EL0);
> +             if (current->thread.por_el0 != next->thread.por_el0) {
> +                     write_sysreg_s(next->thread.por_el0, SYS_POR_EL0);
> +                     isb();
> +             }
> +     }

Nitpick: use "if (!system_supports_poe()) return;" to avoid too much
indentation.

W.r.t. the isb(), I think we accumulated quite a lot on this path. It
might be worth going through them and having one at the end, where
possible.

-- 
Catalin

Reply via email to