All of lore.kernel.org
 help / color / mirror / Atom feed
* - x86_64-sync-up-probe_roms-with-i386.patch removed from -mm tree
@ 2007-02-08 21:27 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-02-08 21:27 UTC (permalink / raw)
  To: rene.herman, ak, jeremy, zach, mm-commits


The patch titled
     x86_64: sync up probe_roms() with i386
has been removed from the -mm tree.  Its filename was
     x86_64-sync-up-probe_roms-with-i386.patch

This patch was dropped because it is obsolete

------------------------------------------------------
Subject: x86_64: sync up probe_roms() with i386
From: Rene Herman <rene.herman@gmail.com>

Sync up with i386. Specifically, be careful about touching the
legacy ROMs; in virtualized environments they may not be mapped.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zachary Amsden <zach@vmware.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86_64/kernel/setup.c |   35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff -puN arch/x86_64/kernel/setup.c~x86_64-sync-up-probe_roms-with-i386 arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c~x86_64-sync-up-probe_roms-with-i386
+++ a/arch/x86_64/kernel/setup.c
@@ -183,22 +183,31 @@ static struct resource video_ram_resourc
 	.flags = IORESOURCE_RAM,
 };
 
-#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
+#define ROMSIGNATURE 0xaa55
 
-static int __init romchecksum(unsigned char *rom, unsigned long length)
+static int __init romsignature(const unsigned char *rom)
 {
-	unsigned char *p, sum = 0;
+	const unsigned short * const ptr = (const unsigned short *)rom;
+	unsigned short sig;
 
-	for (p = rom; p < rom + length; p++)
-		sum += *p;
-	return sum == 0;
+	return probe_kernel_address(ptr, sig) == 0 && sig == ROMSIGNATURE;
+}
+
+static int __init romchecksum(const unsigned char *rom, unsigned long length)
+{
+	unsigned char sum, c;
+
+	for (sum = 0; length && probe_kernel_address(rom++, c) == 0; length--)
+		sum += c;
+	return !length && !sum;
 }
 
 static void __init probe_roms(void)
 {
+	const unsigned char *rom;
 	unsigned long start, length, upper;
-	unsigned char *rom;
-	int	      i;
+	unsigned char c;
+	int i;
 
 	/* video rom */
 	upper = adapter_rom_resources[0].start;
@@ -209,8 +218,11 @@ static void __init probe_roms(void)
 
 		video_rom_resource.start = start;
 
+		if (probe_kernel_address(rom, c) != 0)
+			continue;
+
 		/* 0 < length <= 0x7f * 512, historically */
-		length = rom[2] * 512;
+		length = c * 512;
 
 		/* if checksum okay, trust length byte */
 		if (length && romchecksum(rom, length))
@@ -245,8 +257,11 @@ static void __init probe_roms(void)
 		if (!romsignature(rom))
 			continue;
 
+		if (probe_kernel_address(rom, c) != 0)
+			continue;
+
 		/* 0 < length <= 0x7f * 512, historically */
-		length = rom[2] * 512;
+		length = c * 512;
 
 		/* but accept any length that fits if checksum okay */
 		if (!length || start + length > upper || !romchecksum(rom, length))
_

Patches currently in -mm which might be from rene.herman@gmail.com are

i386-probe_roms-cleanup.patch
x86_64-sync-up-probe_roms-with-i386.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-08 21:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08 21:27 - x86_64-sync-up-probe_roms-with-i386.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.