Support returning the config of a virtual interrupt; as with all the
config-setting functions, virtual interrupts can be dealt with
similarly to physical LPIs, just searching in a different IST.

Signed-off-by: Peter Maydell <[email protected]>
---
 hw/intc/arm_gicv5.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/hw/intc/arm_gicv5.c b/hw/intc/arm_gicv5.c
index 39c96fe0526..8f4d44b2b37 100644
--- a/hw/intc/arm_gicv5.c
+++ b/hw/intc/arm_gicv5.c
@@ -994,9 +994,19 @@ uint64_t gicv5_request_config(GICv5Common *cs, uint32_t 
id, GICv5Domain domain,
     uint64_t icsr;
 
     if (virtual) {
-        qemu_log_mask(LOG_GUEST_ERROR, "gicv5_request_config: tried to "
-                      "read config of a virtual interrupt\n");
-        return R_ICSR_F_MASK;
+        const GICv5ISTConfig *cfg = ist_for_vint(s, cs, domain, type, cpuidx);
+
+        if (!cfg) {
+            qemu_log_mask(LOG_GUEST_ERROR, "gicv5_request_config: tried to "
+                          "read config of unreachable virtual %s %d\n",
+                          inttype_name(type), id);
+            return R_ICSR_F_MASK;
+        }
+
+        icsr = l2_iste_to_icsr(cs, cfg, id);
+        trace_gicv5_request_config(domain_name[domain], inttype_name(type),
+                                   virtual, id, icsr);
+        return icsr;
     }
 
     switch (type) {
-- 
2.43.0


Reply via email to