Commit 80a4da05 authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Thomas Gleixner

x86/EISA: Use memremap() to probe for the EISA BIOS signature

The area at the 0x0FFFD9 physical location in the PC memory space is
regular memory, traditionally ROM BIOS and more recently a copy of BIOS
code and data in RAM, write-protected.

Therefore use memremap() to get access to it rather than ioremap(),
avoiding issues in virtualization scenarios and complementing changes such
as commit f7750a79 ("x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use
memremap() for RAM mappings") or commit 5997efb9 ("x86/boot: Use
memremap() to map the MPF and MPC data").
Reported-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/alpine.DEB.2.21.2408242025210.30766@angie.orcam.me.uk
Closes: https://lore.kernel.org/r/20240822095122.736522-1-kirill.shutemov@linux.intel.com
parent 741fc1d7
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
static __init int eisa_bus_probe(void) static __init int eisa_bus_probe(void)
{ {
void __iomem *p; void *p;
if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP)) if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
return 0; return 0;
p = ioremap(0x0FFFD9, 4); p = memremap(0x0FFFD9, 4, MEMREMAP_WB);
if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24)) if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
EISA_bus = 1; EISA_bus = 1;
iounmap(p); memunmap(p);
return 0; return 0;
} }
subsys_initcall(eisa_bus_probe); subsys_initcall(eisa_bus_probe);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment