Re: [PATCH] x86/EISA: Use memremap() to probe for the EISA BIOS signature
From: Kirill A. Shutemov
Date: Wed Aug 28 2024 - 03:14:20 EST
On Tue, Aug 27, 2024 at 11:14:45PM -0700, Christoph Hellwig wrote:
> On Sat, Aug 24, 2024 at 11:17:10PM +0100, Maciej W. Rozycki wrote:
> > - void __iomem *p;
> > + void *p;
> >
> > if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
> > return 0;
> >
> > - p = ioremap(0x0FFFD9, 4);
> > + p = memremap(0x0FFFD9, 4, MEMREMAP_WB);
> > if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
> > EISA_bus = 1;
>
> readl requires and __iomem pointer. If this is just a memory region you
> can and should directly dereference the address instead.
>
> Note that sparse will complain about the above as well.
See v2:
https://lore.kernel.org/all/alpine.DEB.2.21.2408261015270.30766@xxxxxxxxxxxxxxxxx
--
Kiryl Shutsemau / Kirill A. Shutemov