mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
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:
@@ -31,7 +31,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch,
|
|||||||
|
|
||||||
/* send IPIs to everyone */
|
/* send IPIs to everyone */
|
||||||
for (i = 0, m = mask; m; i++, m >>= 1) {
|
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);
|
oth = sbi_hart_id_to_scratch(scratch, i);
|
||||||
atomic_raw_set_bit(event, &oth->ipi_type);
|
atomic_raw_set_bit(event, &oth->ipi_type);
|
||||||
mb();
|
mb();
|
||||||
|
Reference in New Issue
Block a user