qemu-devel
[Top][All Lists]
Advanced

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

Re: simple example of pci driver with dma


From: Peter Maydell
Subject: Re: simple example of pci driver with dma
Date: Thu, 29 Oct 2020 15:46:12 +0000

On Thu, 29 Oct 2020 at 14:59, Shaked Matzner <shaked.m@neuroblade.ai> wrote:
> however the value I get is still 255(0xff) and not 18(0x12) probably I've 
> missed something but when the interrupt is called the transfer to the RAM 
> address should be completed, however it seems like the dma_write_buffer 
> function from the device does not perform any transfer. What Am I missing?

The usual mistake is forgetting in the guest code to program the
PCI device to enable bus mastering by setting the Bus Master bit
in the Command register in the PCI config space registers for
the device. Unless you do that then all DMA attempts will fail
(same as on real h/w). In the Linux kernel the function for this
is pci_set_master(), I think.

thanks
-- PMM



reply via email to

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