From: Andrew Jones <andrew.jones@linux.dev>
To: kvm-riscv@lists.infradead.org
Cc: Anup Patel <apatel@ventanamicro.com>,
Atish Patra <atishp@rivosinc.com>,
cleger@rivosinc.com
Subject: [kvm-unit-tests PATCH] riscv: sbi: Add no target ipi test
Date: Mon, 17 Mar 2025 13:08:15 +0100 [thread overview]
Message-ID: <20250317120814.35241-2-andrew.jones@linux.dev> (raw)
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@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
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
next reply other threads:[~2025-03-17 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 12:08 Andrew Jones [this message]
2025-03-20 14:26 ` [kvm-unit-tests PATCH] riscv: sbi: Add no target ipi test Andrew Jones
2025-03-22 10:49 ` Andrew Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250317120814.35241-2-andrew.jones@linux.dev \
--to=andrew.jones@linux.dev \
--cc=apatel@ventanamicro.com \
--cc=atishp@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=kvm-riscv@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).