aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-09-28 12:42:50 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-09-30 11:29:56 +0200
commit8c2d9f9a38aa3237e16722e36e5a6b53a43fc7db (patch)
treec299a296165c55f4abc71c61d9c352d4ab31b84f /hw
parent24db877ab6e6dc999016f1f29e59c7eb1539f5d3 (diff)
downloadqemu-8c2d9f9a38aa3237e16722e36e5a6b53a43fc7db.zip
qemu-8c2d9f9a38aa3237e16722e36e5a6b53a43fc7db.tar.gz
qemu-8c2d9f9a38aa3237e16722e36e5a6b53a43fc7db.tar.bz2
microvm/pcie: add 64bit mmio window
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
Diffstat (limited to 'hw')
-rw-r--r--hw/i386/microvm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 273abe2..17e3f2f 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);
}