[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/26] hw/gen_pcie_root_port: make IO RO 0 on IO disa
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 21/26] hw/gen_pcie_root_port: make IO RO 0 on IO disabled |
Date: |
Sun, 15 Oct 2017 06:23:57 +0300 |
From: Marcel Apfelbaum <address@hidden>
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: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/pci-bridge/gen_pcie_root_port.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/pci-bridge/gen_pcie_root_port.c
b/hw/pci-bridge/gen_pcie_root_port.c
index ed03ffc..ad4e6aa 100644
--- a/hw/pci-bridge/gen_pcie_root_port.c
+++ b/hw/pci-bridge/gen_pcie_root_port.c
@@ -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 = {
--
MST
- [Qemu-devel] [PULL 10/26] virtio/vhost: reset dev->log after syncing, (continued)
- [Qemu-devel] [PULL 10/26] virtio/vhost: reset dev->log after syncing, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 11/26] pci: allow 32-bit PCI IO accesses to pass through the PCI bridge, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 12/26] hw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 13/26] virtio/pci/migration: Convert to VMState, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 14/26] PCI: PCIe access should always be little endian, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 15/26] pci: conventional-pci-device and pci-express-device interfaces, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 16/26] pci: Add interface names to hybrid PCI devices, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 17/26] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 19/26] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 20/26] pci: Validate interfaces on base_class_init, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 21/26] hw/gen_pcie_root_port: make IO RO 0 on IO disabled,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 22/26] virtio: fix descriptor counting in virtqueue_pop, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 24/26] isapc: Remove unnecessary migration compatibility code, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 23/26] virtio-pci: Replace modern_as with direct access to modern_bar, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 25/26] pc: remove useless hot_add_cpu initialisation, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 26/26] tests/pxe: Test more NICs when running in SPEED=slow mode, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 18/26] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices, Michael S. Tsirkin, 2017/10/14
- Re: [Qemu-devel] [PULL 00/26] pc, pci, virtio: fixes, features, Peter Maydell, 2017/10/16