From nobody Fri Dec 19 15:20:54 2025 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48AE013A88D for ; Mon, 26 Aug 2024 09:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.133.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724664117; cv=none; b=u0JmGXKrho2QFAFEzb06gq7U32GfxReGRsL0UIl8v/s+eOokASxEL7KJHg+qP+fLSn6c88vVjFIzvXyymFDkE/gJX5Dtu6vCsrzjBFPoN3bRkF1DYCOZYBGMejK+M+D81XjidQFLfGNFEa59I8l7+CV5iyzmzehRFhKVlLiydTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724664117; c=relaxed/simple; bh=54vAyqWzP74SvcfqrhJzsG+kPxYADVWM+AOyl2jeO7s=; h=Date:From:To:cc:Subject:Message-ID:MIME-Version:Content-Type; b=Wvw4gCsM6MO1TCOFA0tHU4ptFjxZqLTaQXpKC29FshQMuctXEDDmgFB7c2ao4G/vkyDhai4rmqmwtvyGvq2DYy1VKwcQiSN/qtRcyLZyV0G+ta0QtXK0JLxbb+/0rr4wGTiJ7VyUbWIBRtPPAvsweeAQKANGezvLmPGFTI9KKOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk; spf=none smtp.mailfrom=orcam.me.uk; arc=none smtp.client-ip=78.133.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id 92B7F92009C; Mon, 26 Aug 2024 11:21:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 8B53A92009B; Mon, 26 Aug 2024 10:21:47 +0100 (BST) Date: Mon, 26 Aug 2024 10:21:47 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org cc: Boris Ostrovsky , "H. Peter Anvin" , "Kirill A. Shutemov" , Rick Edgecombe , Isaku Yamahata , Kevin Loughlin , linux-kernel@vger.kernel.org Subject: [PATCH v2] x86/EISA: Use memremap() to probe for the EISA BIOS signature Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Area at the 0x0FFFD9 physical location in the PC memory space is regular=20 memory, traditionally ROM BIOS and more recently a copy of BIOS code and=20 data in RAM, write-protected. Use memremap() then to get access to it rather than ioremap(), avoiding=20 issues in virtualization scenarios and complementing changes such as=20 commit f7750a795687 ("x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use=20 memremap() for RAM mappings") or commit 5997efb96756 ("x86/boot: Use=20 memremap() to map the MPF and MPC data"). Reported-by: Kirill A. Shutemov Closes: https://lore.kernel.org/r/20240822095122.736522-1-kirill.shutemov@l= inux.intel.com Signed-off-by: Maciej W. Rozycki --- Changes from v1: - Access the signature directly rather than via `readl', fixing a sparse=20 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/x86/kernel/eisa.c +++ linux-macro/arch/x86/kernel/eisa.c @@ -11,15 +11,15 @@ =20 static __init int eisa_bus_probe(void) { - void __iomem *p; + unsigned int *p; =20 if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR= _GUEST_SEV_SNP)) return 0; =20 - p =3D ioremap(0x0FFFD9, 4); - if (p && readl(p) =3D=3D 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24)) + p =3D memremap(0x0FFFD9, 4, MEMREMAP_WB); + if (p && *p =3D=3D 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24)) EISA_bus =3D 1; - iounmap(p); + memunmap(p); return 0; } subsys_initcall(eisa_bus_probe);