* [PATCH] arm64: mm: warn once for ioremap attempts on RAM mappings
@ 2025-12-22 15:28 Breno Leitao
2026-01-16 12:06 ` Catalin Marinas
2026-01-22 16:59 ` Will Deacon
0 siblings, 2 replies; 3+ messages in thread
From: Breno Leitao @ 2025-12-22 15:28 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: linux-arm-kernel, linux-kernel, kernel-team, clm, Breno Leitao
Replace WARN_ON with WARN_ONCE when detecting attempts to ioremap
RAM. This prevents log spam when a misbehaving driver repeatedly tries
to map RAM via ioremap.
A single warning is more than enough to show the broken code path, and
extra reports don't add extra information.
Warning floods have been seen in production environments where broken
external drivers hit this code path thousand of times, causing
unnecessary messages to be printed and pressure on the serial console.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
PS: This is crashing a host due to a lockup on nbcon that is likely
fixed by commit d5d399efff65773("printk/nbcon: Release nbcon consoles ownership
in atomic flush after each emitted record")
---
arch/arm64/mm/ioremap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
index 10e246f11271..b12cbed9b5ad 100644
--- a/arch/arm64/mm/ioremap.c
+++ b/arch/arm64/mm/ioremap.c
@@ -24,7 +24,8 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
return NULL;
/* Don't allow RAM to be mapped. */
- if (WARN_ON(pfn_is_map_memory(__phys_to_pfn(phys_addr))))
+ if (WARN_ONCE(pfn_is_map_memory(__phys_to_pfn(phys_addr)),
+ "ioremap attempted on RAM pfn\n"))
return NULL;
/*
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-arm64_ioremap-d20703b85358
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] arm64: mm: warn once for ioremap attempts on RAM mappings
2025-12-22 15:28 [PATCH] arm64: mm: warn once for ioremap attempts on RAM mappings Breno Leitao
@ 2026-01-16 12:06 ` Catalin Marinas
2026-01-22 16:59 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2026-01-16 12:06 UTC (permalink / raw)
To: Breno Leitao
Cc: Will Deacon, linux-arm-kernel, linux-kernel, kernel-team, clm
On Mon, Dec 22, 2025 at 07:28:55AM -0800, Breno Leitao wrote:
> Replace WARN_ON with WARN_ONCE when detecting attempts to ioremap
> RAM. This prevents log spam when a misbehaving driver repeatedly tries
> to map RAM via ioremap.
>
> A single warning is more than enough to show the broken code path, and
> extra reports don't add extra information.
>
> Warning floods have been seen in production environments where broken
> external drivers hit this code path thousand of times, causing
> unnecessary messages to be printed and pressure on the serial console.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
It looks fine to me but it's not urgent for 6.19, so I'll leave it to
Will.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: mm: warn once for ioremap attempts on RAM mappings
2025-12-22 15:28 [PATCH] arm64: mm: warn once for ioremap attempts on RAM mappings Breno Leitao
2026-01-16 12:06 ` Catalin Marinas
@ 2026-01-22 16:59 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2026-01-22 16:59 UTC (permalink / raw)
To: Catalin Marinas, Breno Leitao
Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-kernel,
kernel-team, clm
On Mon, 22 Dec 2025 07:28:55 -0800, Breno Leitao wrote:
> Replace WARN_ON with WARN_ONCE when detecting attempts to ioremap
> RAM. This prevents log spam when a misbehaving driver repeatedly tries
> to map RAM via ioremap.
>
> A single warning is more than enough to show the broken code path, and
> extra reports don't add extra information.
>
> [...]
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64: mm: warn once for ioremap attempts on RAM mappings
https://git.kernel.org/arm64/c/53f45f045cbe
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-22 17:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 15:28 [PATCH] arm64: mm: warn once for ioremap attempts on RAM mappings Breno Leitao
2026-01-16 12:06 ` Catalin Marinas
2026-01-22 16:59 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox