Commit 8e36c336 authored by Marcel Apfelbaum's avatar Marcel Apfelbaum Committed by Michael S. Tsirkin
Browse files

hw/gen_pcie_root_port: make IO RO 0 on IO disabled



IO_LIMIT and IO_BASE registers should not be writable if
gen_pcie_root_port's io-reserve property is set to 0.
The COMMAND register should have the IO flag read only.

Signed-off-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 2fefa16c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -85,6 +85,13 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)
        rpc->parent_class.exit(d);
        return;
    }

    if (!grp->io_reserve) {
        pci_word_test_and_clear_mask(d->wmask + PCI_COMMAND,
                                     PCI_COMMAND_IO);
        d->wmask[PCI_IO_BASE] = 0;
        d->wmask[PCI_IO_LIMIT] = 0;
    }
}

static const VMStateDescription vmstate_rp_dev = {