Skip to contentSkip to conversation

Fix BIOS-e820 end address

PATCH In review Keshavamurthy, Anil S 4 participants 5 messages Sep 7, 2007 – Sep 14, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix BIOS-e820 end address

Subject: [patch] Fix BIOS-e820 end address

--snip of boot message--
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000007fe8cc00 (usable)
----end snip---

As you see from above the address 0000000000100000 is both shown as reserved and usable which is confusing.

This patch fixes the BIOS-e820 end address.

---
 arch/i386/kernel/e820.c   |    2 +-
 arch/x86_64/kernel/e820.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/i386/kernel/e820.c +1 -1
Index: work/arch/i386/kernel/e820.c
===================================================================
@@ -753,7 +753,7 @@
 	for (i = 0; i < e820.nr_map; i++) {
 		printk(" %s: %016Lx - %016Lx ", who,
 			e820.map[i].addr,
-			e820.map[i].addr + e820.map[i].size);
+			e820.map[i].addr + e820.map[i].size - 1);
 		switch (e820.map[i].type) {
 		case E820_RAM:	printk("(usable)\n");
 				break;
arch/x86_64/kernel/e820.c +1 -1
Index: work/arch/x86_64/kernel/e820.c
===================================================================
@@ -368,7 +368,7 @@
 	for (i = 0; i < e820.nr_map; i++) {
 		printk(KERN_INFO " %s: %016Lx - %016Lx ", who,
 			(unsigned long long) e820.map[i].addr,
-			(unsigned long long) (e820.map[i].addr + e820.map[i].size));
+			(unsigned long long) (e820.map[i].addr + e820.map[i].size - 1));
 		switch (e820.map[i].type) {
 		case E820_RAM:	printk("(usable)\n");
 				break;
#1 lore raw
Quoted 11 lines · Anil S

--snip of boot message--
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000007fe8cc00 (usable) ----end snip---

As you see from above the address 0000000000100000 is both shown as reserved and usable which is confusing.

This patch fixes the BIOS-e820 end address.

If a segment should have size 0 (even possible?), your patch makes it even more confusing.

Jan

#2 lore raw
In reply to Keshavamurthy, Anil S
Quoted 9 lines · Anil S

Subject: [patch] Fix BIOS-e820 end address

--snip of boot message--
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000007fe8cc00 (usable)
----end snip---

Quoted 3 lines

As you see from above the address 0000000000100000 is both shown as reserved and usable which is confusing.

I think this is consistent with many other kernel interfaces (such as /proc/X/maps) where the end address is taken to be exclusive: [0xf0000, 0x100000).

J

#3 lore raw
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 9 lines · Anil S

Subject: [patch] Fix BIOS-e820 end address

--snip of boot message--
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000007fe8cc00 (usable)
----end snip---

Quoted 7 lines
Quoted 3 lines

As you see from above the address 0000000000100000 is both shown as reserved and usable which is confusing.

I think this is consistent with many other kernel interfaces (such as /proc/X/maps) where the end address is taken to be exclusive: [0xf0000, 0x100000).

Andrew, Please disregard this patch. As Jermy, Jan pointed out, this will cause more confusions. Thanks.

#4 lore raw
Quoted 15 lines · Suresh B
Quoted 14 lines · Jeremy Fitzhardinge
Quoted 12 lines · Anil S

Subject: [patch] Fix BIOS-e820 end address

--snip of boot message--
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000007fe8cc00 (usable)
----end snip---

As you see from above the address 0000000000100000 is both shown as reserved and usable which is confusing.

Quoted 6 lines
Quoted 3 lines

I think this is consistent with many other kernel interfaces (such as /proc/X/maps) where the end address is taken to be exclusive: [0xf0000, 0x100000).

Andrew, Please disregard this patch. As Jermy, Jan pointed out, this will cause more confusions. Thanks.

I agree, we can discard my patch.

-Anil