diff options
author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2012-03-15 14:34:01 +0000 |
---|---|---|
committer | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2012-05-22 10:43:46 +0100 |
commit | ad0f9329debb8a163fd9cc8b3716ded2c494cba4 (patch) | |
tree | 321a79d4138415a4907dbc7ab17b80298edb8390 /big-little/common/vgic_handle.c | |
parent | 976a6c2e10fecedc49a1da242ef87f05f87626ba (diff) |
Virqmig: Added virq migration support.
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Diffstat (limited to 'big-little/common/vgic_handle.c')
-rw-r--r-- | big-little/common/vgic_handle.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/big-little/common/vgic_handle.c b/big-little/common/vgic_handle.c index b6bc29c..0e20dcf 100644 --- a/big-little/common/vgic_handle.c +++ b/big-little/common/vgic_handle.c @@ -26,6 +26,7 @@ #include "misc.h" #include "events.h" #include "vgiclib.h" +#include "ipi.h" extern vm_context *trigger_entry(vm_context *, unsigned); extern unsigned get_cpuinfo(unsigned); @@ -99,7 +100,7 @@ vm_context *handle_interrupt(vm_context * context) unsigned int_pri = 0; unsigned cpu_if = get_cpuif(cluster_id, cpuid); vm_context *ret_ctx = context; - unsigned do_switch = 0, first_cpu = find_first_cpu(); + unsigned first_cpu = find_first_cpu(); /* * Get the interrupt # @@ -122,10 +123,9 @@ vm_context *handle_interrupt(vm_context * context) * Special case IPIs, since we need the source CPU ID */ if (i < 16) { - src_cpu = (status >> 10) & INTACK_CPUID_MASK; + unsigned type = get_hyp_ipi(cpu_if, i); - /* Check whether we have been requested to switchover */ - do_switch = check_switchover_ipi(cpu_if, i); + src_cpu = (status >> 10) & INTACK_CPUID_MASK; /* * SGI Ack actually returns the source cpu interface @@ -146,16 +146,26 @@ vm_context *handle_interrupt(vm_context * context) gic_eoi_int(status); if (read32(GIC_IC_PHY_BASE + GICC_CTL) & 0x200) gic_deactivate_int(status); + switch (type) { + /* Check whether we have been requested to switchover */ - if (do_switch) { + case IPI_CLUSTER_SWITCH: /* * switch_cluster() takes the first_cpu as its arg. Since * all the cores are expected to power down, its reasonable * to assume cpu0 is the first cpu and will take care of - * saving all the global context. + * saving all the global context. This never returns. */ switch_cluster(first_cpu); + break; + + case IPI_MIGRATE_VIRQS: + complete_virq_migration(src_cpu); return ret_ctx; + + default: + break; + /* Not a HYP ipi. Send it to the payload */ } } |