[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [RFC 7/8] hw/arm/virt-acpi-build: Handle multiple GICR struct
From: |
Eric Auger |
Subject: |
[Qemu-arm] [RFC 7/8] hw/arm/virt-acpi-build: Handle multiple GICR structures |
Date: |
Tue, 27 Mar 2018 16:15:21 +0200 |
In case multiple redistributor regions were registered,
let's add the corresponding GICR structures in the MADT
ACPI table.
Signed-off-by: Eric Auger <address@hidden>
---
hw/arm/virt-acpi-build.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index c7c6a57..aefc1b4 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -43,6 +43,7 @@
#include "hw/pci/pcie_host.h"
#include "hw/pci/pci.h"
#include "hw/arm/virt.h"
+#include "hw/intc/arm_gicv3.h"
#include "sysemu/numa.h"
#include "kvm_arm.h"
@@ -618,14 +619,22 @@ build_madt(GArray *table_data, BIOSLinker *linker,
VirtMachineState *vms)
}
if (vms->gic_version == 3) {
+ GICv3State *s = (GICv3State *)vms->gic;
+ int r;
+
AcpiMadtGenericTranslator *gic_its;
- AcpiMadtGenericRedistributor *gicr = acpi_data_push(table_data,
- sizeof *gicr);
- gicr->type = ACPI_APIC_GENERIC_REDISTRIBUTOR;
- gicr->length = sizeof(*gicr);
- gicr->base_address = cpu_to_le64(memmap[VIRT_GIC_REDIST].base);
- gicr->range_length = cpu_to_le32(memmap[VIRT_GIC_REDIST].size);
+ for (r = 0; r < s->nb_redist_regions; r++) {
+ AcpiMadtGenericRedistributor *gicr = acpi_data_push(table_data,
+ sizeof *gicr);
+
+ gicr->type = ACPI_APIC_GENERIC_REDISTRIBUTOR;
+ gicr->length = sizeof(*gicr);
+ gicr->base_address = cpu_to_le64(s->redist_region[r].base);
+ /* count redistributors of 2 x 64kB pages */
+ gicr->range_length =
+ cpu_to_le64((uint64_t)s->redist_region[r].count << 17);
+ }
if (its_class_name() && !vmc->no_its) {
gic_its = acpi_data_push(table_data, sizeof *gic_its);
--
2.5.5
- [Qemu-arm] [RFC 0/8] KVM/ARM: Relax the max 123 vcpus limitation along with KVM GICv3, Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 3/8] kvm: Expose kvm_max_vcpus(), Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 2/8] hw/intc/arm_gicv3: Use an array of redistributor regions, Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 1/8] linux-headers: Partial update for KVM/ARM multiple redistributor region registration, Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 5/8] hw/intc/arm_gicv3_kvm: Allow multiple redistributor regions, Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 4/8] hw/intc/arm_gicv3: Implement register_redist_region API, Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 6/8] hw/arm/virt: Allow GICv3 DT node with multiple redistributor regions, Eric Auger, 2018/03/27
- [Qemu-arm] [RFC 7/8] hw/arm/virt-acpi-build: Handle multiple GICR structures,
Eric Auger <=
- [Qemu-arm] [RFC 8/8] hw/arm/virt: Allow up to 512 vcpus along with KVM VGICv3, Eric Auger, 2018/03/27