qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Questions about 'emulated_config_bits' in vfio pci
@ 2019-08-31  1:31 Li Qiang
  2019-08-31  2:23 ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Li Qiang @ 2019-08-31  1:31 UTC (permalink / raw)
  To: Alex Williamson, qemu-devel@nongnu.org

Hi Alex and all,

My understanding for ‘emulated_config_bits’ in ‘VFIOPCIDevice’ is that this is the mask for PCI config space. If the bits is set in ‘ emulated_config_bits’ then we can just use the qemu’s ‘vdev->pdev.config’, it the bits is not set, we need to ask the physical device. 

But there are two places I got confused in ‘vfio_realize’.

Here in ‘vfio_realize’
    /* QEMU can change multi-function devices to single function, or reverse */
    vdev->emulated_config_bits[PCI_HEADER_TYPE] =
                                              PCI_HEADER_TYPE_MULTI_FUNCTION;

In ‘vfio_add_std_cap’

        /* Begin the rebuild, use QEMU emulated list bits */
        pdev->config[PCI_CAPABILITY_LIST] = 0;
        vdev->emulated_config_bits[PCI_CAPABILITY_LIST] = 0xff;
        vdev->emulated_config_bits[PCI_STATUS] |= PCI_STATUS_CAP_LIST;


Per my understanding, I think ‘emulated_config_bits’ should be set to 0xff just as other places. But here use ‘PCI_HEADER_TYPE_MULTI_FUNCTION’ and ‘PCI_STATUS_CAP_LIST’. In fact, this doesn’t affect the results, but it’s confusion.
Just a typo? Or other reasons.


Thanks,
Li Qiang

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-31  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-31  1:31 [Qemu-devel] Questions about 'emulated_config_bits' in vfio pci Li Qiang
2019-08-31  2:23 ` Alex Williamson
2019-08-31  2:44   ` [Qemu-devel] 答复: " Li Qiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).