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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1343598582.15288.4.camel@shinybook.infradead.org>
Date:	Sun, 29 Jul 2012 22:49:42 +0100
From:	David Woodhouse <dwmw2@...radead.org>
To:	Matthew Garrett <mjg@...hat.com>
Cc:	matt.fleming@...el.com, linux-efi@...r.kernel.org,
	linux-kernel@...r.kernel.org, x86@...nel.org,
	linux-pci@...r.kernel.org, bhelgaas@...gle.com
Subject: [PATCH] Fix priority of non-BAR ROM data

If we've obtained the ROM data through other means (such as from EFI),
we don't want to ignore it just because the IORESOURCE_ROM_SHADOW bit has
got set. This fixes the Radeon ROM handling on my MacBookPro8,3 when booted
via grub1-efi.

Signed-off-by: David Woodhouse <David.Woodhouse@...el.com>
---
This fixes patch 3/4 'PCI: Add support for non-BAR ROMs' for me.

 drivers/pci/rom.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index 7ebaab6..4d437b5 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -118,6 +118,13 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
 	void __iomem *rom;
 
 	/*
+	 * Some devices may provide ROMs via a source other than the BAR
+	 */
+	if (pdev->rom && pdev->romlen) {
+		*size = pdev->romlen;
+		return phys_to_virt(pdev->rom);
+	}
+	/*
 	 * IORESOURCE_ROM_SHADOW set on x86, x86_64 and IA64 supports legacy
 	 * memory map if the VGA enable bit of the Bridge Control register is
 	 * set for embedded VGA.
@@ -126,12 +133,6 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
 		/* primary video rom always starts here */
 		start = (loff_t)0xC0000;
 		*size = 0x20000; /* cover C000:0 through E000:0 */
-	/*
-	 * Some devices may provide ROMs via a source other than the BAR
-	 */
-	} else if (pdev->rom && pdev->romlen) {
-		*size = pdev->romlen;
-		return phys_to_virt(pdev->rom);
 	} else {
 		if (res->flags &
 			(IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) {
-- 
1.7.11.2



-- 
dwmw2

Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (6171 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ