riscv: sbi: Add no target ipi test
Subsystems (2)
PATCH 1/1 riscv: sbi: Add no target ipi test
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".
--- riscv/sbi.c | 4 ++++ 1 file changed, 4 insertions(+)
riscv/sbi.c +4 -0
@@ -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);
Signature · 7 lines
2.48.1 -- kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv
Quoted 28 lines · Andrew Jones
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 <[email protected]>--- riscv/sbi.c | 4 ++++ 1 file changed, 4 insertions(+)riscv/sbi.c +4
-0@@ -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);Signature · 1 line
2.48.1
Applied to riscv/sbi[1] with the test below added too just to make sure that a nonzero hbase with a zero hmask doesn't break things.
Thanks,
drew
ret = sbi_send_ipi(0, 1); sbiret_report_error(&ret, SBI_SUCCESS, "no targets, hart_mask_base is 1");
[1] https://gitlab.com/jones-drew/kvm-unit-tests/-/commits/riscv/sbi
Signature · 3 lines
kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv
Quoted 10 lines · Andrew Jones
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 <[email protected]>--- riscv/sbi.c | 4 ++++ 1 file changed, 4 insertions(+)
Merged.
Thanks,
drew
Signature · 3 lines
kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv