From: Andrew Jones <andrew.jones@linux.dev>
To: kvm-riscv@lists.infradead.org
Subject: [kvm-unit-tests PATCH v2 1/3] riscv: Add sbi_send_ipi_broadcast
Date: Wed, 6 Nov 2024 12:38:16 +0100 [thread overview]
Message-ID: <20241106113814.42992-6-andrew.jones@linux.dev> (raw)
In-Reply-To: <20241106113814.42992-5-andrew.jones@linux.dev>
Coming SBI IPI tests will use this, but as it could be useful for
other tests too, add it to the library.
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
---
lib/riscv/asm/sbi.h | 1 +
lib/riscv/sbi.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/riscv/asm/sbi.h b/lib/riscv/asm/sbi.h
index 1319439b7118..102486c00de3 100644
--- a/lib/riscv/asm/sbi.h
+++ b/lib/riscv/asm/sbi.h
@@ -87,6 +87,7 @@ struct sbiret sbi_hart_get_status(unsigned long hartid);
struct sbiret sbi_send_ipi(unsigned long hart_mask, unsigned long hart_mask_base);
struct sbiret sbi_send_ipi_cpu(int cpu);
struct sbiret sbi_send_ipi_cpumask(const cpumask_t *mask);
+struct sbiret sbi_send_ipi_broadcast(void);
struct sbiret sbi_set_timer(unsigned long stime_value);
long sbi_probe(int ext);
diff --git a/lib/riscv/sbi.c b/lib/riscv/sbi.c
index f25bde169490..02dd338c1915 100644
--- a/lib/riscv/sbi.c
+++ b/lib/riscv/sbi.c
@@ -62,13 +62,18 @@ struct sbiret sbi_send_ipi_cpu(int cpu)
return sbi_send_ipi(1UL, cpus[cpu].hartid);
}
+struct sbiret sbi_send_ipi_broadcast(void)
+{
+ return sbi_send_ipi(0, -1UL);
+}
+
struct sbiret sbi_send_ipi_cpumask(const cpumask_t *mask)
{
struct sbiret ret;
cpumask_t tmp;
if (cpumask_full(mask))
- return sbi_send_ipi(0, -1UL);
+ return sbi_send_ipi_broadcast();
cpumask_copy(&tmp, mask);
--
2.47.0
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Jones <andrew.jones@linux.dev>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org
Cc: cade.richard@gmail.com, atishp@rivosinc.com, jamestiotio@gmail.com
Subject: [kvm-unit-tests PATCH v2 1/3] riscv: Add sbi_send_ipi_broadcast
Date: Wed, 6 Nov 2024 12:38:16 +0100 [thread overview]
Message-ID: <20241106113814.42992-6-andrew.jones@linux.dev> (raw)
In-Reply-To: <20241106113814.42992-5-andrew.jones@linux.dev>
Coming SBI IPI tests will use this, but as it could be useful for
other tests too, add it to the library.
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
---
lib/riscv/asm/sbi.h | 1 +
lib/riscv/sbi.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/riscv/asm/sbi.h b/lib/riscv/asm/sbi.h
index 1319439b7118..102486c00de3 100644
--- a/lib/riscv/asm/sbi.h
+++ b/lib/riscv/asm/sbi.h
@@ -87,6 +87,7 @@ struct sbiret sbi_hart_get_status(unsigned long hartid);
struct sbiret sbi_send_ipi(unsigned long hart_mask, unsigned long hart_mask_base);
struct sbiret sbi_send_ipi_cpu(int cpu);
struct sbiret sbi_send_ipi_cpumask(const cpumask_t *mask);
+struct sbiret sbi_send_ipi_broadcast(void);
struct sbiret sbi_set_timer(unsigned long stime_value);
long sbi_probe(int ext);
diff --git a/lib/riscv/sbi.c b/lib/riscv/sbi.c
index f25bde169490..02dd338c1915 100644
--- a/lib/riscv/sbi.c
+++ b/lib/riscv/sbi.c
@@ -62,13 +62,18 @@ struct sbiret sbi_send_ipi_cpu(int cpu)
return sbi_send_ipi(1UL, cpus[cpu].hartid);
}
+struct sbiret sbi_send_ipi_broadcast(void)
+{
+ return sbi_send_ipi(0, -1UL);
+}
+
struct sbiret sbi_send_ipi_cpumask(const cpumask_t *mask)
{
struct sbiret ret;
cpumask_t tmp;
if (cpumask_full(mask))
- return sbi_send_ipi(0, -1UL);
+ return sbi_send_ipi_broadcast();
cpumask_copy(&tmp, mask);
--
2.47.0
next prev parent reply other threads:[~2024-11-06 11:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 11:38 [kvm-unit-tests PATCH v2 0/3] riscv: sbi: Add IPI tests Andrew Jones
2024-11-06 11:38 ` Andrew Jones
2024-11-06 11:38 ` Andrew Jones [this message]
2024-11-06 11:38 ` [kvm-unit-tests PATCH v2 1/3] riscv: Add sbi_send_ipi_broadcast Andrew Jones
2024-11-06 11:38 ` [kvm-unit-tests PATCH v2 2/3] riscv: sbi: Add IPI extension tests Andrew Jones
2024-11-06 11:38 ` Andrew Jones
2024-11-06 11:38 ` [kvm-unit-tests PATCH v2 3/3] riscv: sbi: Add two in hart_mask IPI test Andrew Jones
2024-11-06 11:38 ` Andrew Jones
2024-11-06 12:22 ` Andrew Jones
2024-11-06 12:22 ` Andrew Jones
2024-11-11 15:07 ` [kvm-unit-tests PATCH v2 0/3] riscv: sbi: Add IPI tests Andrew Jones
2024-11-11 15:07 ` 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=20241106113814.42992-6-andrew.jones@linux.dev \
--to=andrew.jones@linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.