Commit 0c20856c authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon
Browse files

arm64: head.S: ensure idmap_t0sz is visible

We write idmap_t0sz with SCTLR_EL1.{C,M} clear, but we only have the
guarnatee that the kernel Image is clean, not invalid in the caches, and
therefore we might read a stale value once the MMU is enabled.

This patch ensures we invalidate the corresponding cacheline after the
write as we do for all other data written before we set SCTLR_EL1.{C.M},
guaranteeing that the value will be visible later. We rely on the DSBs
in __create_page_tables to complete the maintenance.
Signed-off-by: default avatarMark Rutland <>
CC: Catalin Marinas <>
Cc: Will Deacon <>
Signed-off-by: default avatarWill Deacon <>
parent d5efd9cc
......@@ -414,7 +414,10 @@ __create_page_tables:
cmp x5, TCR_T0SZ(VA_BITS) // default T0SZ small enough? 1f // .. then skip additional level
str_l x5, idmap_t0sz, x6
adr_l x6, idmap_t0sz
str x5, [x6]
dmb sy
dc ivac, x6 // Invalidate potentially stale cache line
create_table_entry x0, x3, EXTRA_SHIFT, EXTRA_PTRS, x5, x6
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment