summaryrefslogtreecommitdiff
path: root/big-little/common/vgiclib.c
diff options
context:
space:
mode:
Diffstat (limited to 'big-little/common/vgiclib.c')
-rw-r--r--big-little/common/vgiclib.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/big-little/common/vgiclib.c b/big-little/common/vgiclib.c
index 5f5735b..ffe1be9 100644
--- a/big-little/common/vgiclib.c
+++ b/big-little/common/vgiclib.c
@@ -25,11 +25,13 @@
#include "virt_helpers.h"
#include "int_master.h"
#include "ipi.h"
+#include "events.h"
+
+extern unsigned get_cpuinfo(unsigned);
/*
* Manage overflowints somehow.. static pool with recycling allocators.
*/
-
#define MAXOVERFLOWINTS 200
static struct overflowint *freeoverflows[NUM_CPUS];
@@ -170,6 +172,7 @@ unsigned start_virq_migration(unsigned orig, unsigned curr, unsigned icdiptr_off
*/
if (virq_mig_mask) {
send_hyp_ipi(virq_mig_mask, IPI_MIGRATE_VIRQS);
+ wait_for_events(VIRQ_MIG_DONE, get_cpu_mask(virq_mig_mask));
return 1;
}
@@ -183,16 +186,19 @@ void complete_virq_migration(unsigned src_cpuid)
{
unsigned ctr, cpu_id = read_cpuid();
unsigned cluster_id = read_clusterid();
- unsigned dest_cpuif = get_cpuif(cluster_id, cpu_id);
+ unsigned dest_cpuid = 0;
for (ctr = 0; ctr < MAX_MIG_IRQS; ctr++) {
- if (migrated_irqs[src_cpuid][ctr].desc &&
- migrated_irqs[src_cpuid][ctr].dest_cpuif == dest_cpuif) {
+ /*
+ * Compare the cpu id instead of the cpu interface id in case
+ * a switch took place before the virq migration ipi was recieved.
+ */
+ dest_cpuid = get_cpuinfo(migrated_irqs[src_cpuid][ctr].dest_cpuif) & 0xf;
+ if (migrated_irqs[src_cpuid][ctr].desc && dest_cpuid == cpu_id)
enqueue_interrupt(migrated_irqs[src_cpuid][ctr].desc, cpu_id);
- }
}
-// set_event(VIRQ_MIG_DONE, src_cpuid);
+ set_event(VIRQ_MIG_DONE, src_cpuid);
return;
}