[PATCH v2 0/8] hw/loongarch/virt: Add high MMIO support with GPEX host bridge

Bibo Mao posted 8 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251010082720.3943996-1-maobibo@loongson.cn
Maintainers: Song Gao <gaosong@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>
There is a newer version of this series
hw/loongarch/virt-acpi-build.c |  17 +---
hw/loongarch/virt-fdt-build.c  |  43 ++++++---
hw/loongarch/virt.c            | 162 ++++++++++++++++++++++++++++++---
include/hw/loongarch/virt.h    |   5 +-
target/loongarch/cpu.c         |  13 +--
target/loongarch/cpu.h         |   2 +
6 files changed, 196 insertions(+), 46 deletions(-)
[PATCH v2 0/8] hw/loongarch/virt: Add high MMIO support with GPEX host bridge
Posted by Bibo Mao 1 month ago
On LoongArch Virt Machine, MMIO region with GPEX host bridge is
0x40000000 -- 0x7FFFFFFF. The total size is 1G bytes and it is enough for
emulated virtio devices basically.

However on some conditions such as hostmem is added with virtio-gpu device
with -device virtio-gpu-gl,hostmem=4G. The PCIE MMIO region is not enough,
64-bit high MMIO region is required.

Like other architectures, here property highmem-mmio is added on virt
machine to add 64-bit high MMIO region supported. With high MMIO region
added, it is not compatible with old machine, so property highmem-mmio is
disabled by default.

---
v1 ... v2:
  1. Solve some code conflict and refresh the patch on the latest version.
  2. Base address of GPEX high MMIO starts from end of max physical
     address region rather than adjacent with DRAM, since it is fixed with
     the previous method.
---
Bibo Mao (8):
  target/loongarch: Add phys_bits in CPULoongArchState
  hw/loongarch/virt: Add field ram_end in LoongArchVirtMachineState
  hw/loongarch/virt: Add field gpex in LoongArchVirtMachineState
  hw/loongarch/virt: Get irq number from gpex config info
  hw/loongarch/virt: Get PCI info from gpex config info
  hw/loongarch/virt: Add property highmem_mmio with virt machine
  hw/loongarch/virt: Add high MMIO support with GPEX host
  hw/loongarch/virt: Add property highmem-mmio-size with virt machine

 hw/loongarch/virt-acpi-build.c |  17 +---
 hw/loongarch/virt-fdt-build.c  |  43 ++++++---
 hw/loongarch/virt.c            | 162 ++++++++++++++++++++++++++++++---
 include/hw/loongarch/virt.h    |   5 +-
 target/loongarch/cpu.c         |  13 +--
 target/loongarch/cpu.h         |   2 +
 6 files changed, 196 insertions(+), 46 deletions(-)


base-commit: 94474a7733a57365d5a27efc28c05462e90e8944
-- 
2.39.3