From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdElR-0001Ib-Ab for qemu-devel@nongnu.org; Sat, 19 Sep 2015 05:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdElO-0002Yn-5a for qemu-devel@nongnu.org; Sat, 19 Sep 2015 05:49:01 -0400 Received: from mail-vk0-f47.google.com ([209.85.213.47]:35634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdElO-0002YV-2l for qemu-devel@nongnu.org; Sat, 19 Sep 2015 05:48:58 -0400 Received: by vkao3 with SMTP id o3so42475267vka.2 for ; Sat, 19 Sep 2015 02:48:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150918234359.GA30932@morn.lan> References: <1442566703-5091-1-git-send-email-markmb@redhat.com> <1442566729-5133-1-git-send-email-markmb@redhat.com> <20150918182509.GA13450@morn.lan> <20150918234359.GA30932@morn.lan> From: Peter Maydell Date: Sat, 19 Sep 2015 10:48:37 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 0/5] fw_cfg DMA interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: Drew , Stefan Hajnoczi , QEMU Developers , Gerd Hoffmann , =?UTF-8?Q?Marc_Mar=C3=AD?= , Laszlo On 19 September 2015 at 00:43, Kevin O'Connor wrote: > On x86 the firmware can't use acpi (nor device tree) to find fw_cfg > because fw_cfg is what is used to transfer acpi to the firmware. So, > the firmware just hard codes the address. As a "sanity check", the > firmware currently checks for a signature before using fw_cfg to > verify everything is working correctly (outw(0x0000, 0x510); > inb(0x511) == 'Q'; inb(0x511) == 'E'; ...). A check for the new dma > interface involves an additional query (outw(0x0001, 0x510); > inb(0x511) == 3; ...). > > I'm proposing that a future firmware (that didn't need to support old > versions of QEMU) could use a simpler sanity check instead (inl(0x514) > == "QEMU"; inl(0x518) == " CFG"). But what happens if you try this on an old QEMU? Won't it not have the newer ports present and so do bad things? At least on ARM trying to read from something you don't know for certain to exist is a bad idea because you're likely to get a fault. thanks -- PMM