Re: [PATCH v11 21/39] arm64/gcs: Ensure that new threads have a GCS

From
Mark Brown <broonie@kernel.org>
Date
2024-08-22 16:24:40
Also in
kvmarm, linux-arch, linux-doc, linux-fsdevel, linux-kselftest, linux-mm, linux-riscv, lkml
Reply to
Catalin Marinas, 2024-08-22
On Thu, Aug 22, 2024 at 05:17:14PM +0100, Catalin Marinas wrote:
quoted
 	/*
-	 * Ensure that GCS changes are observable by/from other PEs in
-	 * case of migration.
+	 * Ensure that GCS memory effects of the 'prev' thread are
+	 * ordered before other memory accesses with release semantics
+	 * (or preceded by a DMB) on the current PE. In addition, any
+	 * memory accesses with acquire semantics (or succeeded by a
+	 * DMB) are ordered before GCS memory effects of the 'next'
+	 * thread. This will ensure that the GCS memory effects are
+	 * visible to other PEs in case of migration.
 	 */
-	gcsb_dsync();
+	if (task_gcs_el0_enabled(current) || task_gcs_el0_enabled(next))
+		gcsb_dsync();
Ah, the comment turned up in this patch. It looks fine.
Oh, sorry - I should probably just pull this hunk into the other patch.

Attachments

Thread (65 messages) 65 messages, 2 authors, last reply 2024-08-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help