All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd
@ 2014-08-20 10:27 Stefan Hajnoczi
  2014-08-20 11:27 ` Michael S. Tsirkin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2014-08-20 10:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin OConnor, John Snow, Gerd Hoffmann, Michael S. Tsirkin

The QEMU -initrd option loads the initrd at the top of RAM.  There is
a 64 KB safety region for ACPI tables in hw/i386/pc.c:load_linux():

  initrd_max = max_ram_size-ACPI_DATA_SIZE-1;

QEMU's bios-256k.bin SeaBIOS build reserves 128 KB at the top of
memory so the 64 KB ACPI data size has become too small.

The guest Linux kernel rejects the initrd:
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003ffe0000 (usable)
 BIOS-e820: 000000003ffe0000 - 0000000040000000 (reserved)
 BIOS-e820: 00000000feffc000 - 00000000ff000000 (reserved)
 BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
...
initrd extends beyond end of memory (0x3ffef79f > 0x3ffe0000)
disabling initrd

It is easy enough to "fix" the problem by bumping ACPI_DATA_SIZE up to
0x20000 in QEMU.  Perhaps this should only be done for bios-256k.bin
guests and not bios-128k.bin guests (QEMU 1.7 and older machine
types).

Perhaps QEMU -> SeaBIOS -> linuxboot.bin can be simplified so QEMU
doesn't have to guess what e820 region SeaBIOS will reserve.
linuxboot.bin would probably be the place to do it unless SeaBIOS has
Linux loading functionality that could be reused.

Any ideas?

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd
  2014-08-20 10:27 [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd Stefan Hajnoczi
@ 2014-08-20 11:27 ` Michael S. Tsirkin
  2014-08-20 12:58   ` Stefan Hajnoczi
  2014-08-20 20:58 ` Michael S. Tsirkin
  2014-08-20 22:17 ` Kevin O'Connor
  2 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-08-20 11:27 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin OConnor, John Snow, qemu-devel, Gerd Hoffmann

On Wed, Aug 20, 2014 at 11:27:41AM +0100, Stefan Hajnoczi wrote:
> The QEMU -initrd option loads the initrd at the top of RAM.  There is
> a 64 KB safety region for ACPI tables in hw/i386/pc.c:load_linux():
> 
>   initrd_max = max_ram_size-ACPI_DATA_SIZE-1;
> 
> QEMU's bios-256k.bin SeaBIOS build reserves 128 KB at the top of
> memory so the 64 KB ACPI data size has become too small.
> 
> The guest Linux kernel rejects the initrd:
> BIOS-provided physical RAM map:
>  BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
>  BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
>  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
>  BIOS-e820: 0000000000100000 - 000000003ffe0000 (usable)
>  BIOS-e820: 000000003ffe0000 - 0000000040000000 (reserved)
>  BIOS-e820: 00000000feffc000 - 00000000ff000000 (reserved)
>  BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
> ...
> initrd extends beyond end of memory (0x3ffef79f > 0x3ffe0000)
> disabling initrd
> 
> It is easy enough to "fix" the problem by bumping ACPI_DATA_SIZE up to
> 0x20000 in QEMU.  Perhaps this should only be done for bios-256k.bin
> guests and not bios-128k.bin guests (QEMU 1.7 and older machine
> types).
> 
> Perhaps QEMU -> SeaBIOS -> linuxboot.bin can be simplified so QEMU
> doesn't have to guess what e820 region SeaBIOS will reserve.
> linuxboot.bin would probably be the place to do it unless SeaBIOS has
> Linux loading functionality that could be reused.
> 
> Any ideas?
> 
> Stefan

I would say 2.1 and up, -M pc-i440fx-2.0 works fine, or am I mistaken?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd
  2014-08-20 11:27 ` Michael S. Tsirkin
@ 2014-08-20 12:58   ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2014-08-20 12:58 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Kevin OConnor, John Snow, qemu-devel, Gerd Hoffmann

On Wed, Aug 20, 2014 at 12:27 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Wed, Aug 20, 2014 at 11:27:41AM +0100, Stefan Hajnoczi wrote:
>> The QEMU -initrd option loads the initrd at the top of RAM.  There is
>> a 64 KB safety region for ACPI tables in hw/i386/pc.c:load_linux():
>>
>>   initrd_max = max_ram_size-ACPI_DATA_SIZE-1;
>>
>> QEMU's bios-256k.bin SeaBIOS build reserves 128 KB at the top of
>> memory so the 64 KB ACPI data size has become too small.
>>
>> The guest Linux kernel rejects the initrd:
>> BIOS-provided physical RAM map:
>>  BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
>>  BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
>>  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
>>  BIOS-e820: 0000000000100000 - 000000003ffe0000 (usable)
>>  BIOS-e820: 000000003ffe0000 - 0000000040000000 (reserved)
>>  BIOS-e820: 00000000feffc000 - 00000000ff000000 (reserved)
>>  BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
>> ...
>> initrd extends beyond end of memory (0x3ffef79f > 0x3ffe0000)
>> disabling initrd
>>
>> It is easy enough to "fix" the problem by bumping ACPI_DATA_SIZE up to
>> 0x20000 in QEMU.  Perhaps this should only be done for bios-256k.bin
>> guests and not bios-128k.bin guests (QEMU 1.7 and older machine
>> types).
>>
>> Perhaps QEMU -> SeaBIOS -> linuxboot.bin can be simplified so QEMU
>> doesn't have to guess what e820 region SeaBIOS will reserve.
>> linuxboot.bin would probably be the place to do it unless SeaBIOS has
>> Linux loading functionality that could be reused.
>>
>> Any ideas?
>>
>> Stefan
>
> I would say 2.1 and up, -M pc-i440fx-2.0 works fine, or am I mistaken?

pc-i440fx-2.0 works fine.  pc-i440fx-2.1 does not.

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd
  2014-08-20 10:27 [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd Stefan Hajnoczi
  2014-08-20 11:27 ` Michael S. Tsirkin
@ 2014-08-20 20:58 ` Michael S. Tsirkin
  2014-08-20 22:17 ` Kevin O'Connor
  2 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-08-20 20:58 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin OConnor, John Snow, qemu-devel, Gerd Hoffmann

On Wed, Aug 20, 2014 at 11:27:41AM +0100, Stefan Hajnoczi wrote:
> The QEMU -initrd option loads the initrd at the top of RAM.  There is
> a 64 KB safety region for ACPI tables in hw/i386/pc.c:load_linux():
> 
>   initrd_max = max_ram_size-ACPI_DATA_SIZE-1;
> 
> QEMU's bios-256k.bin SeaBIOS build reserves 128 KB at the top of
> memory so the 64 KB ACPI data size has become too small.
> 
> The guest Linux kernel rejects the initrd:
> BIOS-provided physical RAM map:
>  BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
>  BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
>  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
>  BIOS-e820: 0000000000100000 - 000000003ffe0000 (usable)
>  BIOS-e820: 000000003ffe0000 - 0000000040000000 (reserved)
>  BIOS-e820: 00000000feffc000 - 00000000ff000000 (reserved)
>  BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
> ...
> initrd extends beyond end of memory (0x3ffef79f > 0x3ffe0000)
> disabling initrd
> 
> It is easy enough to "fix" the problem by bumping ACPI_DATA_SIZE up to
> 0x20000 in QEMU.  Perhaps this should only be done for bios-256k.bin
> guests and not bios-128k.bin guests (QEMU 1.7 and older machine
> types).
> 
> Perhaps QEMU -> SeaBIOS -> linuxboot.bin can be simplified so QEMU
> doesn't have to guess what e820 region SeaBIOS will reserve.
> linuxboot.bin would probably be the place to do it unless SeaBIOS has
> Linux loading functionality that could be reused.
> 
> Any ideas?
> 
> Stefan

I just sent a patch
	[PATCH] pc: reserve more memory for ACPI for new machine types
to do exactly that: double the acpi memory for 2.1 and up.

Would appreciate testing.

-- 
MST

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd
  2014-08-20 10:27 [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd Stefan Hajnoczi
  2014-08-20 11:27 ` Michael S. Tsirkin
  2014-08-20 20:58 ` Michael S. Tsirkin
@ 2014-08-20 22:17 ` Kevin O'Connor
  2 siblings, 0 replies; 5+ messages in thread
From: Kevin O'Connor @ 2014-08-20 22:17 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Gerd Hoffmann, John Snow, qemu-devel, Michael S. Tsirkin

On Wed, Aug 20, 2014 at 11:27:41AM +0100, Stefan Hajnoczi wrote:
> The QEMU -initrd option loads the initrd at the top of RAM.  There is
> a 64 KB safety region for ACPI tables in hw/i386/pc.c:load_linux():
> 
>   initrd_max = max_ram_size-ACPI_DATA_SIZE-1;
> 
> QEMU's bios-256k.bin SeaBIOS build reserves 128 KB at the top of
> memory so the 64 KB ACPI data size has become too small.

Just to clarify, SeaBIOS uses a variable amount of data at the top of
ram.  SeaBIOS isn't changing the allocation because of its build
parameters, but because QEMU is passing more ACPI tables to it.

> Perhaps QEMU -> SeaBIOS -> linuxboot.bin can be simplified so QEMU
> doesn't have to guess what e820 region SeaBIOS will reserve.
> linuxboot.bin would probably be the place to do it unless SeaBIOS has
> Linux loading functionality that could be reused.

There is no current functionality in SeaBIOS to deploy a Linux kernel
from fw_cfg.  However, it looks like it would be pretty simple to add
if someone wants to give it a try.

-Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-20 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 10:27 [Qemu-devel] Recent SeaBIOS too big for QEMU -initrd Stefan Hajnoczi
2014-08-20 11:27 ` Michael S. Tsirkin
2014-08-20 12:58   ` Stefan Hajnoczi
2014-08-20 20:58 ` Michael S. Tsirkin
2014-08-20 22:17 ` Kevin O'Connor

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.