All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: jsnow@redhat.com, qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH] linuxboot: compute initrd loading address
Date: Tue, 07 Oct 2014 12:10:18 +0200	[thread overview]
Message-ID: <5433BC0A.1050704@redhat.com> (raw)
In-Reply-To: <20141007084651.GA3797@redhat.com>

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 <pbonzini@redhat.com>
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> 
> 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

      reply	other threads:[~2014-10-07 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 14:49 [Qemu-devel] [PATCH] linuxboot: compute initrd loading address Paolo Bonzini
2014-10-07  8:46 ` Michael S. Tsirkin
2014-10-07 10:10   ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5433BC0A.1050704@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=jsnow@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.