Received: from eggs.gnu.org ([2001:4830:134:3::10]:47475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoaZ8-0008P1-G6 for qemu-devel@nongnu.org; Wed, 12 Nov 2014 11:14:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoaZ1-0001gO-1f for qemu-devel@nongnu.org; Wed, 12 Nov 2014 11:14:42 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:57142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoaZ0-0001g9-OP for qemu-devel@nongnu.org; Wed, 12 Nov 2014 11:14:34 -0500 From: Arnd Bergmann Date: Wed, 12 Nov 2014 17:13:48 +0100 Message-ID: <4532823.qiucXlCzCt@wuerfel> In-Reply-To: <5463850E.7020703@redhat.com> References: <20141030180216.GD31629@leverpostej> <1690954.Y528jzYjum@wuerfel> <5463850E.7020703@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [Qemu-devel] [Linaro-acpi] [RFC PATCH 0/7] hw/arm/virt: Dynamic ACPI v5.1 table generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , "Ian.Campbell@citrix.com" , linaro-acpi@lists.linaro.org, Claudio Fontana , QEMU Developers , "stefano.stabellini@citrix.com" , "tech@virtualopensystems.com" , Parth Dixit , Christoffer Dall On Wednesday 12 November 2014 17:04:30 Paolo Bonzini wrote: > On 12/11/2014 16:57, Arnd Bergmann wrote: > > > > It seems to me like complicated stuff like that definitely belongs > > > > in the UEFI/bootloader blob, though. I'd rather QEMU just modelled > > > > the hardware and let the guest (or the firmware, which is guest > > > > code from QEMU's point of view) set it up however it wants. > > > > > > It definitely doesn't belong in QEMU! > > > > The easiest option would probably be not make all PCI devices have > > fixed BARs and not even allow them to be changed. I believe this is > > what kvmtool does, but I can see how supporting both modes is much > > harder than either one. > > kvmtool does not have firmware; it starts the kernel directly, so it > does all the setup that usually is done by the firmware. It implements > a couple real-mode interfaces that Linux uses when booting, but nothing > of this deals with PCI. > > x86 QEMU always runs firmware. Even if you specify -kernel, the > firmware does all the usual initialization and then boots from a small > ROM. The ROM contains the bootloader, so it loads and starts the kernel. Ok, I see. > > How does it work on x86 with qemu? > > Same as real hardware. Firmware (SeaBIOS or OVMF) builds the memory > map, decides where in the free space the BARs go, and programs the PCI > devices accordingly. > > kvmtool is the special one here. Xen, VMware, Hyper-V all do the same > as QEMU. Right. I guess embedded ARM images in qemu are a third way then, because these don't have a guest firmware but also don't set up the hardware the way that kvmtool does. Claudio's request to do this differently on arm64 seems absolutely reasonable to me, but I guess that implies having UEFI or something like it that does the PCI scan. Not sure what the best default for "qemu -kernel image" should be though if you don't explicitly pass a firmware image. Arnd