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: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 0/5] fw_cfg DMA interface
Date: Fri, 18 Sep 2015 23:47:52 +0100

On 18 September 2015 at 19:25, Kevin O'Connor <address@hidden> wrote:
> On Fri, Sep 18, 2015 at 10:58:44AM +0200, Marc Marí wrote:
>> Implement host-side of the FW CFG DMA interface both for x86 and ARM.
>>
>> Based on Gerd Hoffman's initial implementation.
>
> Thanks for working on this Marc!
>
> Any chance you could add the patch below to the series (or merge it
> into your series)?
>
> The patch adds a signature to the DMA address IO register.  With the
> current implementation, a future firmware would have to implement the
> V1 fw_cfg interface just to probe for the dma interface.  It might be
> useful if future firmwares (that don't care about backwards
> compatibility with old versions of qemu) could probe for the dma
> fw_cfg interface by just checking for a signature (and therefore not
> require all the V1 code just to probe).
>
> -Kevin
>
>
> commit ae6d8df012ef9b21ae17bfb0383d116f71ba1d58
> Author: Kevin O'Connor <address@hidden>
> Date:   Fri Sep 18 14:14:55 2015 -0400
>
>     fw_cfg: Define a static signature to be returned on DMA port reads
>
>     Return a static signature ("QEMU CFG") if the guest does a read to the
>     DMA address io register.
>
>     Signed-off-by: Kevin O'Connor <address@hidden>
>
> diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
> index d5f9ddd..5bf3f65 100644
> --- a/docs/specs/fw_cfg.txt
> +++ b/docs/specs/fw_cfg.txt
> @@ -93,6 +93,10 @@ by selecting the "signature" item using key 0x0000 
> (FW_CFG_SIGNATU
> RE),
>  and reading four bytes from the data register. If the fw_cfg device is
>  present, the four bytes read will contain the characters "QEMU".
>
> +Additionaly, if the DMA interface is available then a read to the DMA
> +Address will return 0x51454d5520434647 ("QEMU CFG" in big-endian
> +format).
> +

I don't think I understand this. If you know the DMA Address
port or register exists, then you know (by definition) that
the DMA interface is available. If you don't know that the
DMA interface is available then you can't read from the DMA
Address port or register because it might not exist and could
therefore cause you to blow up.

If you want to be able to tell without doing the "use the
old-style interface to query the version" thing, then you
need to look in the ACPI or device tree tables (and those
tables need to be such that you can tell the difference,
which is the case for at least device tree; haven't checked
ACPI.)

thanks
-- PMM



reply via email to

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