[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/12] microvm/pcie: add 64bit mmio window
From: |
Gerd Hoffmann |
Subject: |
[PULL 06/12] microvm/pcie: add 64bit mmio window |
Date: |
Wed, 30 Sep 2020 19:48:49 +0200 |
Place the 64bit window at the top of the physical address space, assign
25% of the avaiable address space. Force cpu.host-phys-bits=on for
microvm machine typs so this actually works reliable.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20200928104256.9241-7-kraxel@redhat.com
---
hw/i386/microvm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 273abe28c9c1..17e3f2f15265 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -198,6 +198,12 @@ static void microvm_devices_init(MicrovmMachineState *mms)
}
if (x86_machine_is_acpi_enabled(x86ms) && mms->pcie == ON_OFF_AUTO_ON) {
+ /* use topmost 25% of the address space available */
+ hwaddr phys_size = (hwaddr)1 << X86_CPU(first_cpu)->phys_bits;
+ if (phys_size > 0x1000000ll) {
+ mms->gpex.mmio64.size = phys_size / 4;
+ mms->gpex.mmio64.base = phys_size - mms->gpex.mmio64.size;
+ }
mms->gpex.mmio32.base = PCIE_MMIO_BASE;
mms->gpex.mmio32.size = PCIE_MMIO_SIZE;
mms->gpex.ecam.base = PCIE_ECAM_BASE;
@@ -383,6 +389,9 @@ static void microvm_fix_kernel_cmdline(MachineState
*machine)
static void microvm_device_pre_plug_cb(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
+ X86CPU *cpu = X86_CPU(dev);
+
+ cpu->host_phys_bits = true; /* need reliable phys-bits */
x86_cpu_pre_plug(hotplug_dev, dev, errp);
}
--
2.27.0
- [PULL 01/12] move MemMapEntry, (continued)
- [PULL 01/12] move MemMapEntry, Gerd Hoffmann, 2020/09/30
- [PULL 07/12] tests/acpi: allow updates for expected data files, Gerd Hoffmann, 2020/09/30
- [PULL 08/12] tests/acpi: add empty tests/data/acpi/microvm/DSDT.pcie file, Gerd Hoffmann, 2020/09/30
- [PULL 09/12] tests/acpi: factor out common microvm test setup, Gerd Hoffmann, 2020/09/30
- [PULL 02/12] acpi: add acpi_dsdt_add_gpex, Gerd Hoffmann, 2020/09/30
- [PULL 04/12] microvm: add irq table, Gerd Hoffmann, 2020/09/30
- [PULL 12/12] tests/acpi: update expected data files, Gerd Hoffmann, 2020/09/30
- [PULL 11/12] acpi/gpex: no reason to use a method for _CRS, Gerd Hoffmann, 2020/09/30
- [PULL 10/12] tests/acpi: add microvm pcie test, Gerd Hoffmann, 2020/09/30
- [PULL 05/12] microvm: add pcie support, Gerd Hoffmann, 2020/09/30
- [PULL 06/12] microvm/pcie: add 64bit mmio window,
Gerd Hoffmann <=