HV: fix hide all sriov in ecap

When VM read pre-sriov header in ECAP of ptdev, only emulate the
reading if SRIOV is hidden.
Write to pre-sriov header is ignored so no need to fix writting.

Tracked-On: #5085
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
lirui34 2020-07-23 13:05:10 +08:00 committed by wenlingz
parent 6cafb9cf01
commit 61aa89da12

View File

@ -521,7 +521,7 @@ static int32_t read_pt_dev_cfg(const struct pci_vdev *vdev, uint32_t offset,
} else if (sriovcap_access(vdev, offset)) {
read_sriov_cap_reg(vdev, offset, bytes, val);
} else {
if (offset == vdev->pdev->sriov.pre_pos) {
if ((offset == vdev->pdev->sriov.pre_pos) && (vdev->pdev->sriov.hide_sriov)) {
*val = pci_vdev_read_vcfg(vdev, offset, bytes);
} else if (!is_quirk_ptdev(vdev)) {
/* passthru to physical device */