Commit Message

Currently, the firmware tables are parsed 2 times: once in the GIC
drivers, the other time when initializing the vGIC. It means code
duplication and make more tedious to add the support for another
firmware table (like ACPI).
Use the recently introduced helper gic_get_kvm_info() to get
information about the virtual GIC.
With this change, the virtual GIC becomes agnostic to the firmware
table and KVM will be able to initialize the vGIC on ACPI.
Signed-off-by: Julien Grall <julien.grall@arm.com>Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
---
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Changes in v6:
- Add Christoffer's reviewed-by
Changes in v4:
- Remove validation check as they are already done during
parsing.
- Move the alignement check from the parsing to the vGIC code.
- Fix typo in the commit message
Changes in v2:
- Use 0 rather than a negative value to know when the maintenance IRQ
is not present.
- Use resource for vcpu and vctrl.
---
include/kvm/arm_vgic.h | 7 +++---
virt/kvm/arm/vgic-v2.c | 61 +++++++++++++++++++++-----------------------------
virt/kvm/arm/vgic-v3.c | 47 +++++++++++++-------------------------
virt/kvm/arm/vgic.c | 50 ++++++++++++++++++++++-------------------
4 files changed, 73 insertions(+), 92 deletions(-)