qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Template for developing a Qemu device with PCIe?and MSI


From: Isaku Yamahata
Subject: Re: [Qemu-devel] Template for developing a Qemu device with PCIe?and MSI-X
Date: Fri, 20 Aug 2010 14:15:05 +0900
User-agent: Mutt/1.5.19 (2009-01-05)

On Thu, Aug 19, 2010 at 12:01:40PM -0500, Adnan Khaleel wrote:
> Hi Isaku, thank you very much for your very detailed response. I have a few
> questions, see below.
> 
> Thanks again,
> 
> Adnan
> 
> 
>     Qemu doesn't support pcie at the moment.
>     Only partial patches have been merged, still more patches have to
>     be merged for pcie to fully work. The following repo is available.
> 
>     git clone http://people.valinux.co.jp/~yamahata/qemu/q35/qemu
>     git clone http://people.valinux.co.jp/~yamahata/qemu/q35/seabios
>     git clone http://people.valinux.co.jp/~yamahata/qemu/q35/vgabios
> 
>     Note: patched seabios and vgabios are needed, you have to pass ACPI DSDT
>     for q35.
>     example:
>     qemu-system-x86_64 -M pc_q35 -acpitable load_header,data=roms/seabios/src/
>     q35-acpi-dsdt.aml
> 
>     This repo is for those who want to try/develop pcie support,
>     not for upstream merge. So they include patches unsuitable for upstream.
> 
> I'm looking at Qemu 0.12.3 and there are 2 files, pci_host.c and pcie_host.c.
> Can you explain what these do?

They are for configuration space.
pci_host.c abstracts the emulation of indirect access to configuration space.
On PC, ioport 0xcf8 and 0xcfc.
pcie_host abtracts the emulation of access to MMCONFIG space. There is no
user at the moment, though.

> Also, I see virtio_pci.c is the only device that uses msi-x in qemu. Can you
> explain what device this is trying to emulate?

virtio is a paravirtual IO framework for kvm. There is no corresponding
real hardware.


> Also, will the support for PCIe be merged with the mail Qemu at some point?

I've been trying it. Your help will be appreciated. 


>     The repo includes pcie port switch emulator which utilize pcie and
>     MSI(not MSI-X).
> 
> I guess I could use this as a template for my qemu device mode correct?

Half yes. You need to be aware that port switch is pci-to-pci bridge which
is slightly different from normal pci/pcie device.
There is no emulator of pcie normal device at the moment.


>     The difference between PCI device and PCIe device is configuration
>     space size.
>     By setting PCIDeviceInfo::is_express = 1, you'll get 4K configuration
>     space. Helper functions for pcie are found in qemu/hw/pcie.c
>     For msi-x, see qemu/hw/msix.c.
> 
> One last question, does the current implementation allow for 64bit BAR
> addresses?

Yes. 64bit BAR emulation was alread merged. seabios is also ready for it.
-- 
yamahata



reply via email to

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