qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] PCI device waiting for some external (shared memory) ev


From: Peter Maydell
Subject: Re: [Qemu-devel] PCI device waiting for some external (shared memory) events
Date: Tue, 10 Sep 2013 17:47:47 +0100

On 10 September 2013 17:10, Michael Moese <address@hidden> wrote:
> Hello dear Qemu developers,
> I have some weird issues with a PCI device I have developed.
> I am using shared memory to create an abstraction from the Qemu-PCI device I
> developed and forward all requests to another process running a SystemC
> device (this should not matter here).
>
> In my pci-read and write implementations I lock a mutex on the shared
> memory, then write address, data and r/w-flag to the shared memory, then I
> poll for a completion-flag.
>
> This seems to work quite fine while writing data, which happen in some kind
> of posted writes, so I finish the operation as soon as possible.
> When I execute a pci memory read from inside the guest the read-function
> still gets executed, but Qemu gets stuck then.

This sounds suspiciously like you've introduced a deadlock somewhere
(ie the other end of your system is not returning the data to QEMU
because it's waiting for QEMU to respond to it for something else).

> Now my question is, am I doing something I must not when just busy-waiting
> for the completion flag?
>
> Is there another way to "stop" the simulated CPU during this transfer and
> resume afterwards?

No. You have to return data immediately from a read or write
callback.

-- PMM



reply via email to

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