Thread (61 messages) 61 messages, 5 authors, 2023-12-14

Re: [PATCH v3 05/25] arm64: context switch POR_EL0 register

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2023-12-07 13:51:41
Also in: kvmarm, linux-fsdevel, linux-kselftest, linux-mm

On Fri, Nov 24, 2023 at 04:34:50PM +0000, Joey Gouly wrote:
quoted hunk ↗ jump to hunk
@@ -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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help