qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 0/5] fw_cfg DMA interface


From: Kevin O'Connor
Subject: Re: [Qemu-devel] [PATCH v3 0/5] fw_cfg DMA interface
Date: Sat, 19 Sep 2015 11:15:20 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Sep 19, 2015 at 10:48:37AM +0100, Peter Maydell wrote:
> On 19 September 2015 at 00:43, Kevin O'Connor <address@hidden> 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.

Not on x86 - it used to be the norm to probe for old ISA devices via
io port reads and writes (eg, serial ports and lpt ports were detected
that way).  Here's what adding this to seabios:

  dprintf(1, "outl: %x %x\n", inl(0x514), inl(0x518));

reports on qemu v2.3 and earlier:

  outl: ffffffff ffffffff

on latest qemu with Marc's patches:

  outl: 0 0

and with my additional patch:

  outl: 554d4551 47464320

It's not a huge deal if you don't want to include the additional
signature.  It's not required as the v1 signature check still works
(see docs/specs/fw_cfg.txt), but the v1 check is a bit ugly and a new
additional simpler signature didn't seem like it would hurt.

-Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]