From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao5i9-00055W-Sw for qemu-devel@nongnu.org; Thu, 07 Apr 2016 04:54:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ao5i4-000264-TE for qemu-devel@nongnu.org; Thu, 07 Apr 2016 04:54:45 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao5i4-00025z-JH for qemu-devel@nongnu.org; Thu, 07 Apr 2016 04:54:40 -0400 Received: by mail-wm0-x243.google.com with SMTP id n3so19598920wmn.1 for ; Thu, 07 Apr 2016 01:54:39 -0700 (PDT) Date: Thu, 7 Apr 2016 10:54:33 +0200 From: Marc =?UTF-8?B?TWFyw60=?= Message-ID: <20160407105433.332548ac@home> In-Reply-To: <20160404150204.GB13632@stefanha-x1.localdomain> References: <1459514627-23867-1-git-send-email-rjones@redhat.com> <1459514627-23867-2-git-send-email-rjones@redhat.com> <20160404150204.GB13632@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4.1] Add optionrom compatible with fw_cfg DMA version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: ehabkost@redhat.com, mst@redhat.com, "Richard W.M. Jones" , qemu-devel@nongnu.org, kraxel@redhat.com, pbonzini@redhat.com, rth@twiddle.net On Mon, 4 Apr 2016 16:02:04 +0100 Stefan Hajnoczi wrote: > On Fri, Apr 01, 2016 at 01:43:47PM +0100, Richard W.M. Jones wrote: > > From: Marc Mar=C3=AD > >=20 > > This optionrom is based on linuxboot.S. > >=20 > > Signed-off-by: Marc Mar=C3=AD > > Signed-off-by: Richard W.M. Jones > > --- > > .gitignore | 4 + > > hw/i386/pc.c | 9 +- > > hw/nvram/fw_cfg.c | 2 +- > > include/hw/nvram/fw_cfg.h | 1 + > > pc-bios/optionrom/Makefile | 7 +- > > pc-bios/optionrom/linuxboot_dma.c | 297 > > ++++++++++++++++++++++++++++++++++++++ 6 files changed, 315 > > insertions(+), 5 deletions(-) create mode 100644 > > pc-bios/optionrom/linuxboot_dma.c =20 >=20 > It would be great to merge this but there's more work necessary. >=20 > I CCed Marc's current email address. He was interning at Red Hat but > is now back at university so the Red Hat address is not being read. >=20 > Marc: What was still missing from this patch? I'm sorry I have not answered before, it's been a very busy week. What's missing (as I remember it): - Debug loading an initrd from the new linuxboot - Other minor comments in the thread (mainly, compile using mingw). - Make it possible to disable DMA fw_cfg. I've been putting this patch at the back of my todo list for too long. Let me address some deadlines for this week, and then I'll finish this patch. Marc =20 > > diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile > > index ce4852a..bdd0cc1 100644 > > --- a/pc-bios/optionrom/Makefile > > +++ b/pc-bios/optionrom/Makefile > > @@ -13,15 +13,18 @@ CFLAGS :=3D -Wall -Wstrict-prototypes -Werror > > -fomit-frame-pointer -fno-builtin CFLAGS +=3D -I$(SRC_PATH) > > CFLAGS +=3D $(call cc-option, $(CFLAGS), -fno-stack-protector) > > CFLAGS +=3D $(CFLAGS_NOPIE) > > +CFLAGS +=3D -m32 > > QEMU_CFLAGS =3D $(CFLAGS) > > =20 > > -build-all: multiboot.bin linuxboot.bin kvmvapic.bin > > +ASFLAGS +=3D -32 > > + > > +build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin > > kvmvapic.bin=20 > > # suppress auto-removal of intermediate files > > .SECONDARY: > > =20 > > %.img: %.o > > - $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -Ttext 0 -e > > _start -s -o $@ $<," Building $(TARGET_DIR)$@") > > + $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m elf_i386 > > -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@") =20 >=20 > Gerd noted in <1454411187.9300.54.camel@redhat.com>: >=20 > Hmm, that breaks the windows cross build: >=20 > make: Entering directory `/home/kraxel/projects/qemu/build-win32' > Building optionrom/linuxboot_dma.img > i686-w64-mingw32-ld: unrecognised emulation mode: elf_i386 > Supported emulations: i386pe > make[1]: *** [linuxboot_dma.img] Error 1 >=20 > and then: >=20 > Testing shows two more problems: >=20 > (1) initrd loading is broken, kernel complains it finds only > gibberish: >=20 > [ 0.934582] Unpacking initramfs... > [ 1.166983] Initramfs unpacking failed: junk in compressed > archive [ 1.168458] Freeing initrd memory: 32812k freed >=20 > (2) going back to non-dma boot via -M pc-$old doesn't work, > appearently fw_cfg dma is enabled even for old machine types.