hw/arm/virt: Add high MMIO PCI region, 512G in size
PATCH v5 1/1 hw/arm/virt: Add high MMIO PCI region, 512G in size
This large region is necessary for some devices like ivshmem and video cards 32-bit kernels can be built without LPAE support. In this case such a kernel will not be able to use PCI controller which has windows in high addresses. In order to work around the problem, "highmem" option is introduced. It defaults to on on, but can be manually set to off in order to be able to run those old 32-bit guests.
---
Changes since v4:
- Removed machine-dependent "highmem" default, now always ON Changes since v3:
- Added "highmem" option which controls presence of this region. Default value is on for 64-bit CPUs and off for 32-bit CPUs.
- Supply correct min and max address to aml_qword_memory() Changes since v2:
- Region size increased to 512G
- Added ACPI description
Changes since v1:
- Region address changed to 512G, leaving more space for RAM---
hw/arm/virt-acpi-build.c | 17 +++++++++-- hw/arm/virt.c | 62 +++++++++++++++++++++++++++++++++++----- include/hw/arm/virt-acpi-build.h | 1 + include/hw/arm/virt.h | 1 + 4 files changed, 72 insertions(+), 9 deletions(-)
hw/arm/virt-acpi-build.c +15 -2
@@ -159,7 +159,8 @@ static void acpi_dsdt_add_virtio(Aml *scope, } } -static void acpi_dsdt_add_pci (Aml *scope,const MemMapEntry *memmap,int irq) +static void acpi_dsdt_add_pci (Aml *scope,const MemMapEntry *memmap,int irq, +bool use_highmem) {Aml *method, *crs, *ifctx, *UUID , *ifctx1, *elsectx, *buf;int i, bus_no;
@@ -234,6 +235,17 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, int irq)AML_ENTIRE_RANGE ,0x0000 ,0x0000 , size_pio -1 , base_pio, size_pio)); +if (use_highmem) { +hwaddr base_mmio_high = memmap[VIRT_PCIE_MMIO_HIGH ].base; +hwaddr size_mmio_high = memmap[VIRT_PCIE_MMIO_HIGH ].size; + +aml_append (rbuf, +aml_qword_memory (AML_POS_DECODE ,AML_MIN_FIXED ,AML_MAX_FIXED , +AML_NON_CACHEABLE ,AML_READ_WRITE ,0x0000 , + base_mmio_high, base_mmio_high,0x0000 , + size_mmio_high)); + } +aml_append (method,aml_name_decl ("RBUF" , rbuf));aml_append (method,aml_return (rbuf));aml_append (dev, method);
@@ -510,7 +522,8 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)acpi_dsdt_add_flash (scope, &memmap[VIRT_FLASH ]);acpi_dsdt_add_virtio (scope, &memmap[VIRT_MMIO ], (irqmap[VIRT_MMIO ] +ARM_SPI_BASE ),NUM_VIRTIO_TRANSPORTS ); -acpi_dsdt_add_pci (scope, memmap, (irqmap[VIRT_PCIE ] +ARM_SPI_BASE )); +acpi_dsdt_add_pci (scope, memmap, (irqmap[VIRT_PCIE ] +ARM_SPI_BASE ), + guest_info->use_highmem);aml_append (dsdt, scope);
hw/arm/virt.c +55 -7
110 lines not on this page · raw message
include/hw/arm/virt-acpi-build.h +1 -0
@@ -31,6 +31,7 @@ typedef struct VirtGuestInfo {FWCfgState *fw_cfg;const MemMapEntry *memmap;const int *irqmap; +bool use_highmem; } VirtGuestInfo;
include/hw/arm/virt.h +1 -0
@@ -56,6 +56,7 @@ enum {VIRT_PCIE_ECAM ,VIRT_GIC_V2M ,VIRT_PLATFORM_BUS , + VIRT_PCIE_MMIO_HIGH, }; typedef struct MemMapEntry {
Signature · 1 line
1.9.5.msysgit.0