[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/40] hw/i386/pc_{q35,piix}: Minimize usage of get_system_memory(
|
From: |
Michael S. Tsirkin |
|
Subject: |
[PULL 32/40] hw/i386/pc_{q35,piix}: Minimize usage of get_system_memory() |
|
Date: |
Fri, 19 May 2023 10:52:25 -0400 |
From: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230213162004.2797-6-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a9c40201fb..ac7b1a9194 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -242,7 +242,7 @@ static void pc_init1(MachineState *machine,
isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0"));
} else {
pci_bus = NULL;
- isa_bus = isa_bus_new(NULL, get_system_memory(), system_io,
+ isa_bus = isa_bus_new(NULL, system_memory, system_io,
&error_abort);
i8257_dma_init(isa_bus, 0);
pcms->hpet_enabled = false;
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 89e69737d6..1490f87adb 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -126,6 +126,7 @@ static void pc_q35_init(MachineState *machine)
DeviceState *lpc_dev;
BusState *idebus[MAX_SATA_PORTS];
ISADevice *rtc_state;
+ MemoryRegion *system_memory = get_system_memory();
MemoryRegion *system_io = get_system_io();
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
@@ -192,7 +193,7 @@ static void pc_q35_init(MachineState *machine)
rom_memory = pci_memory;
} else {
pci_memory = NULL;
- rom_memory = get_system_memory();
+ rom_memory = system_memory;
}
pc_guest_info_init(pcms);
@@ -215,7 +216,7 @@ static void pc_q35_init(MachineState *machine)
}
/* allocate ram and load rom/bios */
- pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory,
+ pc_memory_init(pcms, system_memory, rom_memory, &ram_memory,
pci_hole64_size);
object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host));
@@ -224,7 +225,7 @@ static void pc_q35_init(MachineState *machine)
object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM,
OBJECT(pci_memory), NULL);
object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM,
- OBJECT(get_system_memory()), NULL);
+ OBJECT(system_memory), NULL);
object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_IO_MEM,
OBJECT(system_io), NULL);
object_property_set_int(OBJECT(q35_host), PCI_HOST_BELOW_4G_MEM_SIZE,
--
MST
- [PULL 23/40] virtio-crypto: fix NULL pointer dereference in virtio_crypto_free_request, (continued)
- [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, 2023/05/19
- [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 <=
- [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
- [PULL 37/40] hw/cxl: rename mailbox return code type from ret_code to CXLRetCode, Michael S. Tsirkin, 2023/05/19
- [PULL 38/40] hw/cxl: Introduce cxl_device_get_timestamp() utility function, Michael S. Tsirkin, 2023/05/19
- [PULL 39/40] hw/i386/pc: Create RTC controllers in south bridges, Michael S. Tsirkin, 2023/05/19
- [PULL 40/40] hw/i386/pc: No need for rtc_state to be an out-parameter, Michael S. Tsirkin, 2023/05/19
- Re: [PULL 00/40] virtio,pc,pci: fixes, features, cleanups, Richard Henderson, 2023/05/19