Expose the selected GIC generation to interrupt and DT setup code that does not receive the irqchip type directly. Set the state only after the GIC device has been configured successfully. Signed-off-by: Sascha Bischoff --- arm64/gic.c | 7 +++++++ arm64/include/kvm/gic.h | 1 + 2 files changed, 8 insertions(+) diff --git a/arm64/gic.c b/arm64/gic.c index 5c8a33b5..c1bd0771 100644 --- a/arm64/gic.c +++ b/arm64/gic.c @@ -21,6 +21,12 @@ static u64 gic_redists_size; static u64 gic_msi_base; static u64 gic_msi_size = 0; static bool vgic_is_init = false; +static bool vgic_is_v5; + +bool gic__is_v5(void) +{ + return vgic_is_v5; +} struct kvm_irqfd_line { unsigned int gsi; @@ -230,6 +236,7 @@ static int gic__create_device(struct kvm *kvm, enum irqchip_type type) if (err) goto out_err; + vgic_is_v5 = type == IRQCHIP_GICV5; return 0; out_err: diff --git a/arm64/include/kvm/gic.h b/arm64/include/kvm/gic.h index 630f0bbd..991aa912 100644 --- a/arm64/include/kvm/gic.h +++ b/arm64/include/kvm/gic.h @@ -34,6 +34,7 @@ enum irqchip_type { struct kvm; +bool gic__is_v5(void); int gic__alloc_irqnum(void); int gic__create(struct kvm *kvm, enum irqchip_type type); int gic__create_gicv2m_frame(struct kvm *kvm, u64 msi_frame_addr); -- 2.34.1