Skip to contentSkip to conversation

x86_64: change aper valid checking sequence

PATCH Applied Yinghai Lu 2 participants 2 messages Jan 26, 2008 – Jan 28, 2008 x86

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86_64: change aper valid checking sequence

[PATCH] x86_64: change aper valid checking sequence

old sequence:
size ==> >4G ==> point to RAM
changed to

Quoted 1 line

4G ==> point to RAM ==> size

some bios even leave aper to unclear, so check size at last. to avoid reporting that like

Node 0: Aperture @ 4a42000000 size 32 MB
Aperture too small (32 MB)

with patch will get

Node 0: Aperture @ 4a42000000 size 32 MB
Aperture beyond 4G. Ignoring.

arch/x86/kernel/aperture_64.c +4 -4
index 0b837bb..608152a 100644
@@ -85,10 +85,6 @@ static int __init aperture_valid(u64 aper_base, u32 aper_size)
 	if (!aper_base)
 		return 0;
 
-	if (aper_size < 64*1024*1024) {
-		printk(KERN_ERR "Aperture too small (%d MB)\n", aper_size>>20);
-		return 0;
-	}
 	if (aper_base + aper_size > 0x100000000UL) {
 		printk(KERN_ERR "Aperture beyond 4GB. Ignoring.\n");
 		return 0;
@@ -97,6 +93,10 @@ static int __init aperture_valid(u64 aper_base, u32 aper_size)
 		printk(KERN_ERR "Aperture pointing to e820 RAM. Ignoring.\n");
 		return 0;
 	}
+	if (aper_size < 64*1024*1024) {
+		printk(KERN_ERR "Aperture too small (%d MB)\n", aper_size>>20);
+		return 0;
+	}
 
 	return 1;
 }
Applied
#1 lore raw
Quoted 10 lines · Yinghai Lu

[PATCH] x86_64: change aper valid checking sequence

old sequence:
size ==> >4G ==> point to RAM
changed to

Quoted 1 line

4G ==> point to RAM ==> size

some bios even leave aper to unclear, so check size at last. to avoid reporting that like

Quoted 7 lines

Node 0: Aperture @ 4a42000000 size 32 MB
Aperture too small (32 MB)

with patch will get

Node 0: Aperture @ 4a42000000 size 32 MB
Aperture beyond 4G. Ignoring.

thanks, applied.

Ingo