lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2408261015270.30766@angie.orcam.me.uk>
Date: Mon, 26 Aug 2024 10:21:47 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...am.me.uk>
To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, 
    Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, 
    x86@...nel.org
cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>, 
    "H. Peter Anvin" <hpa@...or.com>, 
    "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, 
    Rick Edgecombe <rick.p.edgecombe@...el.com>, 
    Isaku Yamahata <isaku.yamahata@...el.com>, 
    Kevin Loughlin <kevinloughlin@...gle.com>, linux-kernel@...r.kernel.org
Subject: [PATCH v2] x86/EISA: Use memremap() to probe for the EISA BIOS
 signature

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.

Use memremap() then to get access to it rather than ioremap(), avoiding 
issues in virtualization scenarios and complementing changes such as 
commit f7750a795687 ("x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use 
memremap() for RAM mappings") or commit 5997efb96756 ("x86/boot: Use 
memremap() to map the MPF and MPC data").

Reported-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Closes: https://lore.kernel.org/r/20240822095122.736522-1-kirill.shutemov@linux.intel.com
Signed-off-by: Maciej W. Rozycki <macro@...am.me.uk>
---
Changes from v1:

- Access the signature directly rather than via `readl', fixing a sparse 
  warning found by CI.
---
 arch/x86/kernel/eisa.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

linux-x86-eisa-bus-probe-memremap.diff
Index: linux-macro/arch/x86/kernel/eisa.c
===================================================================
--- linux-macro.orig/arch/x86/kernel/eisa.c
+++ linux-macro/arch/x86/kernel/eisa.c
@@ -11,15 +11,15 @@
 
 static __init int eisa_bus_probe(void)
 {
-	void __iomem *p;
+	unsigned int *p;
 
 	if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
 		return 0;
 
-	p = ioremap(0x0FFFD9, 4);
-	if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
+	p = memremap(0x0FFFD9, 4, MEMREMAP_WB);
+	if (p && *p == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
 		EISA_bus = 1;
-	iounmap(p);
+	memunmap(p);
 	return 0;
 }
 subsys_initcall(eisa_bus_probe);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ