diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -728,6 +728,18 @@ if (pmap->pm_stage != PM_STAGE1) return (false); +#ifdef KMSAN + /* + * The break-before-make in pmap_update_entry() results in a situation + * where a CPU may call into the KMSAN runtime while the entry is + * invalid. If the entry is used to map the current thread structure, + * then the runtime will attempt to access unmapped memory. Avoid this + * by simply disabling superpage promotion for the kernel map. + */ + if (pmap == kernel_pmap) + return (false); +#endif + return (superpages_enabled != 0); }