From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbRj1-00010A-QA for qemu-devel@nongnu.org; Tue, 07 Oct 2014 06:10:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbRis-0001Aw-EO for qemu-devel@nongnu.org; Tue, 07 Oct 2014 06:10:35 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:65482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbRis-0001AW-2I for qemu-devel@nongnu.org; Tue, 07 Oct 2014 06:10:26 -0400 Received: by mail-wg0-f48.google.com with SMTP id k14so7574176wgh.7 for ; Tue, 07 Oct 2014 03:10:25 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5433BC0A.1050704@redhat.com> Date: Tue, 07 Oct 2014 12:10:18 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1412606997-13290-1-git-send-email-pbonzini@redhat.com> <20141007084651.GA3797@redhat.com> In-Reply-To: <20141007084651.GA3797@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] linuxboot: compute initrd loading address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: jsnow@redhat.com, qemu-devel@nongnu.org, agraf@suse.de 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 > > Acked-by: Michael S. Tsirkin > > 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