[kvm-unit-tests PATCH] riscv: sbi: Add no target ipi test
Andrew Jones
andrew.jones at linux.dev
Mon Mar 17 05:08:15 PDT 2025
While an hmask of zero without an hbase of -1 (which would mean
broadcast) is pointless, since nothing is targeted, the spec
doesn't say it should return an error. Maybe it should? Anyway,
for now, just confirm that it "works".
Signed-off-by: Andrew Jones <andrew.jones at linux.dev>
---
riscv/sbi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/riscv/sbi.c b/riscv/sbi.c
index 219f7187acf3..16d918d00848 100644
--- a/riscv/sbi.c
+++ b/riscv/sbi.c
@@ -507,6 +507,10 @@ end_two:
max_hartid = cpus[cpu].hartid;
}
+ /* Test no targets */
+ ret = sbi_send_ipi(0, 0);
+ sbiret_report_error(&ret, SBI_SUCCESS, "no targets");
+
/* Try the next higher hartid than the max */
ret = sbi_send_ipi(2, max_hartid);
report_kfail(true, ret.error == SBI_ERR_INVALID_PARAM, "hart_mask got expected error (%ld)", ret.error);
--
2.48.1
More information about the kvm-riscv
mailing list