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 <atish.patra@wdc.com>
This commit is contained in:
Atish Patra
2019-01-21 17:54:00 -08:00
committed by Anup Patel
parent b9c517f559
commit bc545539d2

View File

@@ -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();