qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] E1000 emulation in qemu and pci configuration space


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] E1000 emulation in qemu and pci configuration space
Date: Wed, 7 May 2014 15:29:49 +0200

On Wed, May 7, 2014 at 3:08 PM, Ayaz Akram <address@hidden> wrote:
> So, if I have rightly understood, this means whatever address range guest
> wants to use, guest should write base address registers for particular
> device accordingly.

Yes.

> Actually, I have made a hack
[...]
> wrote bar0 in emulated e1000's config space, but I am not able to understand
> from e1000's code in qemu, that how does qemu get to know that this is going
> to be the base adress for this device.

Linux PCI drivers usually do not write a BAR address themselves.

A key feature of PCI is autoconfiguration.  That means the firmware or
operating system can scan all PCI adapters and query how much BAR
space they need.  Then the firmware or operation system sets the BAR
addresses to make the devices available.  The actual device driver
doesn't decide the specific BAR address, it usually just asks the
kernel PCI layer to "map" a BAR that it wants to use.

If you need more info, please see https://lwn.net/Kernel/LDD3/ and the
PCI specification.

Stefan



reply via email to

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