[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 15/18] spapr_pci: don't create 64-bit MMIO window if we
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 15/18] spapr_pci: don't create 64-bit MMIO window if we don't need to |
Date: |
Fri, 15 Sep 2017 13:51:27 +1000 |
From: Greg Kurz <address@hidden>
When running a pseries-2.2 or older machine type, we get the following
lines in info mtree:
address-space: memory
...
ffffffffffffffff-ffffffffffffffff (prio 0, i/o): alias
address@hidden @address@hidden
ffffffffffffffff-ffffffffffffffff
address-space: cpu-memory
...
ffffffffffffffff-ffffffffffffffff (prio 0, i/o): alias
address@hidden @address@hidden
ffffffffffffffff-ffffffffffffffff
The same thing occurs when running a pseries-2.7 with
-global spapr-pci-host-bridge.mem_win_size=2147483648
This happens because we always create a 64-bit MMIO window, even if
we didn't explicitely requested it (ie, mem64_win_size == 0) and the
32-bit window is below 2GiB. It doesn't seem to have an impact on the
guest though because spapr_populate_pci_dt() doesn't advertise the
bogus windows when mem64_win_size == 0.
Since these memory regions don't induce any state, we can safely
choose to not create them when their address is equal to -1,
without breaking migration from existing setups.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_pci.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 7d84b9766e..cf54160526 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1622,13 +1622,19 @@ static void spapr_phb_realize(DeviceState *dev, Error
**errp)
memory_region_add_subregion(get_system_memory(), sphb->mem_win_addr,
&sphb->mem32window);
- namebuf = g_strdup_printf("%s.mmio64-alias", sphb->dtbusname);
- memory_region_init_alias(&sphb->mem64window, OBJECT(sphb),
- namebuf, &sphb->memspace,
- sphb->mem64_win_pciaddr, sphb->mem64_win_size);
- g_free(namebuf);
- memory_region_add_subregion(get_system_memory(), sphb->mem64_win_addr,
- &sphb->mem64window);
+ if (sphb->mem64_win_pciaddr != (hwaddr)-1) {
+ namebuf = g_strdup_printf("%s.mmio64-alias", sphb->dtbusname);
+ memory_region_init_alias(&sphb->mem64window, OBJECT(sphb),
+ namebuf, &sphb->memspace,
+ sphb->mem64_win_pciaddr,
sphb->mem64_win_size);
+ g_free(namebuf);
+
+ if (sphb->mem64_win_addr != (hwaddr)-1) {
+ memory_region_add_subregion(get_system_memory(),
+ sphb->mem64_win_addr,
+ &sphb->mem64window);
+ }
+ }
/* Initialize IO regions */
namebuf = g_strdup_printf("%s.io", sphb->dtbusname);
--
2.13.5
- [Qemu-ppc] [PULL 08/18] spapr: fix CAS-generated reset, (continued)
- [Qemu-ppc] [PULL 08/18] spapr: fix CAS-generated reset, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 17/18] spapr_events: use QTAILQ_FOREACH_SAFE() in spapr_clear_pending_events(), David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 13/18] spapr_cpu_core: fail gracefully with non-pseries machine types, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 10/18] spapr_pci: handle FDT creation errors with _FDT(), David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 11/18] vfio, spapr: Fix levels calculation, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 02/18] hw/ppc/spapr.c: cleaning up qdev_get_machine() calls, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 05/18] spapr_pci: use g_strdup_printf(), David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 14/18] spapr_pci: convert sprintf() to g_strdup_printf(), David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 04/18] spapr_pci: drop useless check in spapr_populate_pci_child_dt(), David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 07/18] ppc/xive: fix OV5_XIVE_EXPLOIT bits, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 15/18] spapr_pci: don't create 64-bit MMIO window if we don't need to,
David Gibson <=
- [Qemu-ppc] [PULL 06/18] spapr: only update SDR1 once per-cpu during CAS, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 12/18] xics: fix several error leaks, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 16/18] spapr_cpu_core: cleaning up qdev_get_machine() calls, David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 18/18] ppc/kvm: use kvm_vm_check_extension() in kvmppc_is_pr(), David Gibson, 2017/09/14
- [Qemu-ppc] [PULL 01/18] net: Add SunGEM device emulation as found on Apple UniNorth, David Gibson, 2017/09/14
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/18] ppc-for-2.11 queue 20170915, no-reply, 2017/09/15
- Re: [Qemu-ppc] [PULL 00/18] ppc-for-2.11 queue 20170915, Peter Maydell, 2017/09/15