From: Jan Kiszka <[email protected]>

In case of mode 2, the targets field won't be evaluated. So we can safe
one statement and rather invest in explaining when we need to adjust
targets.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm-common/irqchip.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hypervisor/arch/arm-common/irqchip.c 
b/hypervisor/arch/arm-common/irqchip.c
index 4103fed4..89097ef2 100644
--- a/hypervisor/arch/arm-common/irqchip.c
+++ b/hypervisor/arch/arm-common/irqchip.c
@@ -136,7 +136,6 @@ void gic_handle_sgir_write(struct sgi *sgi, bool virt_input)
        if (sgi->routing_mode == 2) {
                /* Route to the caller itself */
                irqchip_set_pending(cpu_data, sgi->id);
-               sgi->targets = (1 << cpu_data->cpu_id);
        } else {
                sgi->targets = 0;
 
@@ -162,6 +161,12 @@ void gic_handle_sgir_write(struct sgi *sgi, bool 
virt_input)
                        }
 
                        irqchip_set_pending(per_cpu(cpu), sgi->id);
+
+                       /*
+                        * routing_mode will be propagated to irqchip_send_sgi.
+                        * as well. So this adjustment is only targeting the
+                        * mode 0 case.
+                        */
                        sgi->targets |= (1 << cpu);
                }
        }
-- 
2.12.3

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to