[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/40] hw/pci-host/q35: Inline sysbus_add_io()
From: |
Michael S. Tsirkin |
Subject: |
[PULL 29/40] hw/pci-host/q35: Inline sysbus_add_io() |
Date: |
Fri, 19 May 2023 10:52:08 -0400 |
From: Bernhard Beschow <shentey@gmail.com>
sysbus_add_io() just wraps memory_region_add_subregion() while also
obscuring where the memory is attached. So use
memory_region_add_subregion() directly and attach it to the existing
memory region s->mch.address_space_io which is set as an alias to
get_system_io() by the q35 machine.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230213162004.2797-3-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/pci-host/q35.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 26390863d6..fa05844319 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -50,10 +50,12 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
Q35PCIHost *s = Q35_HOST_DEVICE(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
- sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem);
+ memory_region_add_subregion(s->mch.address_space_io,
+ MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem);
sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, 4);
- sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
+ memory_region_add_subregion(s->mch.address_space_io,
+ MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
/* register q35 0xcf8 port as coalesced pio */
--
MST
- [PULL 16/40] pci: pci_add_option_rom(): improve style, (continued)
- [PULL 16/40] pci: pci_add_option_rom(): improve style, Michael S. Tsirkin, 2023/05/19
- [PULL 18/40] vhost-user: send SET_STATUS 0 after GET_VRING_BASE, Michael S. Tsirkin, 2023/05/19
- [PULL 19/40] hw/pci: Disable PCI_ERR_UNCOR_MASK register for machine type < 8.0, Michael S. Tsirkin, 2023/05/19
- [PULL 20/40] virtio-mem: Default to "unplugged-inaccessible=on" with 8.1 on x86-64, Michael S. Tsirkin, 2023/05/19
- [PULL 21/40] vhost-user: Remove acpi-specific memslot limit, Michael S. Tsirkin, 2023/05/19
- [PULL 22/40] virtio-net: not enable vq reset feature unconditionally, Michael S. Tsirkin, 2023/05/19
- [PULL 23/40] virtio-crypto: fix NULL pointer dereference in virtio_crypto_free_request, Michael S. Tsirkin, 2023/05/19
- [PULL 26/40] vhost-vdpa: Add check for full 64-bit in region delete, Michael S. Tsirkin, 2023/05/19
- [PULL 24/40] vhost: expose function vhost_dev_has_iommu(), Michael S. Tsirkin, 2023/05/19
- [PULL 15/40] ACPI: bios-tables-test.c step 5 (update expected table binaries), Michael S. Tsirkin, 2023/05/19
- [PULL 29/40] hw/pci-host/q35: Inline sysbus_add_io(),
Michael S. Tsirkin <=
- [PULL 25/40] vhost_vdpa: fix the input in trace_vhost_vdpa_listener_region_del(), Michael S. Tsirkin, 2023/05/19
- [PULL 28/40] hw/pci-host/i440fx: Inline sysbus_add_io(), Michael S. Tsirkin, 2023/05/19
- [PULL 27/40] vhost-vdpa: Add support for vIOMMU., Michael S. Tsirkin, 2023/05/19
- [PULL 30/40] hw/i386/pc_q35: Reuse machine parameter, Michael S. Tsirkin, 2023/05/19
- [PULL 31/40] hw/i386/pc_{q35,piix}: Reuse MachineClass::desc as SMB product name, Michael S. Tsirkin, 2023/05/19
- [PULL 32/40] hw/i386/pc_{q35,piix}: Minimize usage of get_system_memory(), Michael S. Tsirkin, 2023/05/19
- [PULL 33/40] hw/i386/pc: Initialize ram_memory variable directly, Michael S. Tsirkin, 2023/05/19
- [PULL 34/40] hw/pci-host/pam: Make init_pam() usage more readable, Michael S. Tsirkin, 2023/05/19
- [PULL 36/40] hw/pci-bridge: make building pcie-to-pci bridge configurable, Michael S. Tsirkin, 2023/05/19
- [PULL 35/40] virtio-pci: add handling of PCI ATS and Device-TLB enable/disable, Michael S. Tsirkin, 2023/05/19