multiboot: fix e801 memory map
PATCH 1/1 multiboot: fix e801 memory map
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
---
Alex, can you ack this patch for 1.3?
pc-bios/multiboot.bin | Bin 1024 -> 1024 bytes pc-bios/optionrom/multiboot.S | 7 +++++++ 2 files changed, 7 insertions(+)
pc-bios/multiboot.bin binary +0 -0
pc-bios/optionrom/multiboot.S +7 -0
@@ -75,6 +75,13 @@ run_multiboot: shr $4, %eax mov %ax, %fs + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + /* ES = mmap_addr */ mov %fs:48, %eax shr $4, %eax
Signature · 1 line
1.8.0
PATCH 1/1 multiboot: fix e801 memory map
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
--- pc-bios/multiboot.bin | Bin 1024 -> 1024 bytes pc-bios/optionrom/multiboot.S | 7 +++++++ 2 files changed, 7 insertions(+)
pc-bios/multiboot.bin binary +0 -0
pc-bios/optionrom/multiboot.S +7 -0
@@ -75,6 +75,13 @@ run_multiboot: shr $4, %eax mov %ax, %fs + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + /* ES = mmap_addr */ mov %fs:48, %eax shr $4, %eax
Signature · 1 line
1.8.0
Quoted 9 lines · Paolo Bonzini
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
Cc Alexander Graf <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>---
Alex, can you ack this patch for 1.3?
Do you have a test case (OS that fails for example)?
Alex
Quoted 37 lines
pc-bios/multiboot.bin | Bin 1024 -> 1024 bytes
pc-bios/optionrom/multiboot.S| 7 +++++++2 files changed, 7 insertions(+)pc-bios/multiboot.bin binary +0
-0pc-bios/optionrom/multiboot.S +7
-0@@ -75,6 +75,13 @@ run_multiboot: shr $4, %eax mov %ax, %fs + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + /* ES = mmap_addr */ mov %fs:48, %eax shr $4, %eaxSignature · 1 line
1.8.0
Quoted 4 lines · Paolo Bonzini
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
The description mentions that instead of hard coding, you fetch the value dynamically via a BIOS call. However, I don't see the code that hard codes it changed. Where is that one?
Alex
Quoted 42 lines
Cc Alexander Graf <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>---
Alex, can you ack this patch for 1.3?pc-bios/multiboot.bin | Bin 1024 -> 1024 bytes
pc-bios/optionrom/multiboot.S| 7 +++++++2 files changed, 7 insertions(+)pc-bios/multiboot.bin binary +0
-0pc-bios/optionrom/multiboot.S +7
-0@@ -75,6 +75,13 @@ run_multiboot: shr $4, %eax mov %ax, %fs + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + /* ES = mmap_addr */ mov %fs:48, %eax shr $4, %eaxSignature · 1 line
1.8.0
----- Messaggio originale -----
Quoted 9 lines
Da: "Alexander Graf" <[email protected]>
A: "Paolo Bonzini" <[email protected]>
Cc: [email protected]
Inviato: Giovedì, 29 novembre 2012 19:51:07
Oggetto: Re: [PATCH 1.3?] multiboot: fix e801 memory mapOn 29.11.2012, at 18:11, Paolo Bonzini wrote:
Quoted 8 lines
Quoted 4 lines
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
The description mentions that instead of hard coding, you fetch the value dynamically via a BIOS call. However, I don't see the code that hard codes it changed. Where is that one?
It is in hw/multiboot.c:
stl_p(bootinfo + MBI_MEM_LOWER, 640);
Regarding the testcase, Xen will touch the EBDA without this patch and with http://permalink.gmane.org/gmane.comp.emulators.xen.devel/144855.
However, SeaBIOS does not complain.
Paolo
Quoted 17 lines · Paolo Bonzini
----- Messaggio originale -----
Quoted 14 lines
Da: "Alexander Graf" <[email protected]>
A: "Paolo Bonzini" <[email protected]>
Cc: [email protected]
Inviato: Giovedì, 29 novembre 2012 19:51:07
Oggetto: Re: [PATCH 1.3?] multiboot: fix e801 memory mapQuoted 4 lines · Paolo Bonzini
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
Quoted 7 lines
Quoted 3 lines
The description mentions that instead of hard coding, you fetch the value dynamically via a BIOS call. However, I don't see the code that hard codes it changed. Where is that one?
It is in
hw/multiboot.c:stl_p(bootinfo + MBI_MEM_LOWER, 640);
You want to remove that one then.
Quoted 3 lines
Regarding the testcase, Xen will touch the EBDA without this patch and with http://permalink.gmane.org/gmane.comp.emulators.xen.devel/144855.
However, SeaBIOS does not complain.
I see :). Well, the patch is unintrusive enough for be ok for 1.3 IMHO.
Alex
Il 29/11/2012 20:24, Alexander Graf ha scritto:
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
It is in
hw/multiboot.c:stl_p(bootinfo + MBI_MEM_LOWER, 640);You want to remove that one then.
I wasn't sure of what happens if the multiboot option ROM is old. Do we support that to any extent?
Quoted 5 lines
Quoted 3 lines
Regarding the testcase, Xen will touch the EBDA without this patch and with http://permalink.gmane.org/gmane.comp.emulators.xen.devel/144855.
However, SeaBIOS does not complain.I see :). Well, the patch is unintrusive enough for be ok for 1.3 IMHO.
Actually it's relatively easy to see a failure with Xen and a need to PCI passthrough something with a bulky boot ROM; iSCSI or FC cards will do. You'll need both the Xen patch above, and this patch to boot successfully. Otherwise, it will fail to boot.
Paolo
Quoted 8 lines · Paolo Bonzini
Il 29/11/2012 20:24, Alexander Graf ha scritto:
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
It is in
hw/multiboot.c:stl_p(bootinfo + MBI_MEM_LOWER, 640);You want to remove that one then.
I wasn't sure of what happens if the multiboot option ROM is old. Do we support that to any extent?
Option ROMs are migrated but reset after reboot. I guess you could migrate before the option ROM is executed but that seems extraordinarily unlikely.
Regards,
Anthony Liguori
Quoted 13 lines
Quoted 6 lines
Quoted 4 lines
Regarding the testcase, Xen will touch the EBDA without this patch and with http://permalink.gmane.org/gmane.comp.emulators.xen.devel/144855.
However, SeaBIOS does not complain.I see :). Well, the patch is unintrusive enough for be ok for 1.3 IMHO.
Actually it's relatively easy to see a failure with Xen and a need to PCI passthrough something with a bulky boot ROM; iSCSI or FC cards will do. You'll need both the Xen patch above, and this patch to boot successfully. Otherwise, it will fail to boot.
Paolo
Anthony Liguori
AppliedQuoted 9 lines · Paolo Bonzini
The e801 memory sizes in the multiboot structures hard-code the available low memory to 640. However, the value should not include the size of the EBDA. Fill the value in the option ROM, getting the size of low memory from the BIOS.
Cc Alexander Graf <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>---
Alex, can you ack this patch for 1.3?
Applied. Thanks.
Didn't see a clear ack from Alex but since this does fix a bug, I figured we should carry it for 1.3.
Regards,
Anthony Liguori
Quoted 36 lines
pc-bios/multiboot.bin | Bin 1024 -> 1024 bytes pc-bios/optionrom/multiboot.S | 7 +++++++ 2 files changed, 7 insertions(+)pc-bios/multiboot.bin binary +0
-0pc-bios/optionrom/multiboot.S +7
-0@@ -75,6 +75,13 @@ run_multiboot: shr $4, %eax mov %ax, %fs + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + /* ES = mmap_addr */ mov %fs:48, %eax shr $4, %eaxSignature · 1 line
1.8.0