Re: [PATCH] sparc/iommu: Use raw_cpu_read() for iommu_hash_common in iommu_tbl_range_alloc()
From: John Paul Adrian Glaubitz
Date: Sat Nov 07 2026 - 16:14:16 EST
Hi Karl,
On Sat, 2026-11-07 at 20:51 +0100, Karl Mehltretter wrote:
> Fixes: ff7d37a50202 ("Break up monolithic iommu table/lock into finer graularity pools and lock")
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
> ---
> Assisted by an LLM.
>
> Tested on v7.4-rc1 (d48723711bae) under QEMU sparc64 (sun4u, -smp 2)
> with PREEMPT and DEBUG_PREEMPT. Without this patch, two consecutive
> boots emit three "BUG: using __this_cpu_read() in preemptible
> [00000000] code: swapper/0/1" diagnostics in iommu_tbl_range_alloc().
> With this patch, two consecutive boots complete without the
> __this_cpu_read() preemption diagnostic.
According to your Fixes tag, this bug was introduced in 2015. However,
I have to admit I have never seen this message, neither on sun4u nor
on sun4v machines.
Is there a reliable way to reproduce this bug?
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913