Re: [PATCH v2] x86/ioremap: Use is_ioremap_addr() in iounmap()
From: Alistair Popple
Date: Wed Aug 14 2024 - 08:14:13 EST
Thomas Gleixner <tglx@xxxxxxxxxxxxx> writes:
> On Tue, Aug 13 2024 at 21:28, Christoph Hellwig wrote:
>> Modulo the fixes discussion (and any commit log adjustments related to
>> that), is_ioremap_addr is the right interface to check for an
>> ioremap address. So for the actual code change:
>
> I'm not opposed to use is_ioremap_addr() as it restricts the check to
> the actual ioremp region.
>
> That said, I'm wondering why iounmap() silently bails out when invoked
> with an address which is outside of the ioremap region. I'd say, any
> invocation with an address outside of it, is broken, but I might be
> missing something as always.
I would tend to agree and had the same thought when we found this. At
least some kind of message (WARN_ON, WARN_ON_ONCE, printk, etc) would
have made the issue we were debugging much more obvious. FWIW I have
tested running with a WARN_ON() there and it never fired except in the
bug scenario.
- Alistair
> Thanks,
>
> tglx