From bc545539d2f2842c12c8b16d898a21113ce70417 Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Mon, 21 Jan 2019 17:54:00 -0800 Subject: [PATCH] lib: Allow sending IPI to self. S-mode software may send IPI to self. For example, tlbflush may be executed for the same hart. Let the hart send IPI to itself. It's an overhead but doesn't break anything. However, if we don't allow it, it breaks if S-mode keep sending IPIs. Signed-off-by: Atish Patra --- lib/sbi_ipi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c index 1b740706..a6120279 100644 --- a/lib/sbi_ipi.c +++ b/lib/sbi_ipi.c @@ -31,7 +31,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, /* send IPIs to everyone */ for (i = 0, m = mask; m; i++, m >>= 1) { - if ((m & 1) && (i != hartid) && !sbi_platform_hart_disabled(plat, hartid)) { + if ((m & 1) && !sbi_platform_hart_disabled(plat, hartid)) { oth = sbi_hart_id_to_scratch(scratch, i); atomic_raw_set_bit(event, &oth->ipi_type); mb();