On 19 September 2015 at 00:43, Kevin O'Connor <ke...@koconnor.net> 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