[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linuxboot: compute initrd loading address
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] linuxboot: compute initrd loading address |
Date: |
Tue, 07 Oct 2014 12:10:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 |
Il 07/10/2014 10:46, Michael S. Tsirkin ha scritto:
> On Mon, Oct 06, 2014 at 04:49:57PM +0200, Paolo Bonzini wrote:
>> Even though hw/i386/pc.c tries to compute a valid loading address for the
>> initrd, close to the top of RAM, this does not take into account other
>> data that is malloced into that memory by SeaBIOS.
>>
>> Luckily we can easily look at the memory map to find out how much memory is
>> used up there. This patch places the initrd in the first four gigabytes,
>> below the first hole (as returned by INT 15h, AX=e801h).
>>
>> Without this patch:
>> [ 0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff]
>> [ 0.000000] RAMDISK: [mem 0x0710a000-0x07fd7fff]
>>
>> With this patch:
>> [ 0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff]
>> [ 0.000000] RAMDISK: [mem 0x07112000-0x07fdffff]
>>
>> So linuxboot is able to use the 64k that were added as padding for
>> QEMU <= 2.1.
>>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>
> Acked-by: Michael S. Tsirkin <address@hidden>
>
> OK, and we need something similar for multiboot.S?
No, FW_CFG_INITRD_ADDR is in low memory for multiboot.S (0x9500,
compile-time constant). Modules (passed via -initrd for a multiboot
-kernel) are part of FW_CFG_KERNEL_DATA.
> Also - can we drop FW_CFG_INITRD_ADDR and the patching
> in load_linux now (unless running a compat machine type)?
You answered your question---it's needed for compat machine types.
Note however that there is no patching. FW_CFG_SETUP_DATA is a data
structure that is prepared from scratch by load_linux. It is linuxboot
that patches it.
All in all it's simpler to not make it conditional at all. It's part of
the ABI (and linuxboot is free to only use 95% of the agreed interface).
Paolo