qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Questions about 'emulated_config_bits' in vfio pci


From: Li Qiang
Subject: [Qemu-devel] Questions about 'emulated_config_bits' in vfio pci
Date: Sat, 31 Aug 2019 09:31:59 +0800

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


reply via email to

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