* [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE
@ 2025-06-05 9:44 Daniel Henrique Barboza
2025-06-05 9:44 ` [PATCH v2 1/1] target/riscv: use qemu_chr_fe_write_all() in DBCN_CONSOLE_WRITE_BYTE Daniel Henrique Barboza
2025-06-09 4:03 ` [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE Alistair Francis
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2025-06-05 9:44 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-riscv, alistair.francis, liwei1518, zhiwei_liu, palmer,
philmd, Daniel Henrique Barboza
Hi,
In this version I removed the reference of SBI_EXT_DBCN_CONSOLE_WRITE in
the commit message. That API is *non-blocking*, and citing it to justify
a change in a blocking API sounds weird. It's also uneeded since we have
a good case without it regardless.
No other changes made.
Changes from v1:
- removed the "SBI_EXT_DBCN_CONSOLE_WRITE" bit from the commit msg
- v1 link: https://lore.kernel.org/qemu-riscv/20250605090012.1268809-1-dbarboza@ventanamicro.com/
Daniel Henrique Barboza (1):
target/riscv: use qemu_chr_fe_write_all() in DBCN_CONSOLE_WRITE_BYTE
target/riscv/kvm/kvm-cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.49.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] target/riscv: use qemu_chr_fe_write_all() in DBCN_CONSOLE_WRITE_BYTE
2025-06-05 9:44 [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE Daniel Henrique Barboza
@ 2025-06-05 9:44 ` Daniel Henrique Barboza
2025-06-09 4:03 ` [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE Alistair Francis
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2025-06-05 9:44 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-riscv, alistair.francis, liwei1518, zhiwei_liu, palmer,
philmd, Daniel Henrique Barboza
The SBI spec states, for console write byte:
"This is a blocking SBI call and it will only return after writing the
specified byte to the debug console. It will also return, with
SBI_ERR_FAILED, if there are I/O errors."
Being a blocker call will either succeed writing the byte or error out,
it's feasible to use the blocking qemu_chr_fe_write_all() instead of
qemu_chr_fe_write().
Last but not the least, we will duck possible changes in
qemu_chr_fe_write() where ret = 0 will have a 'zero byte written'
semantic [1] - something that we're not ready to deal in this current
state.
[1] https://lore.kernel.org/qemu-devel/CAFEAcA_kEndvNtw4EHySXWwQPoGs029yAzZGGBcV=zGHaj7KUQ@mail.gmail.com/
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/riscv/kvm/kvm-cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index e1a04be20f..86724e5c44 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -1605,7 +1605,7 @@ static void kvm_riscv_handle_sbi_dbcn(CPUState *cs, struct kvm_run *run)
break;
case SBI_EXT_DBCN_CONSOLE_WRITE_BYTE:
ch = run->riscv_sbi.args[0];
- ret = qemu_chr_fe_write(serial_hd(0)->be, &ch, sizeof(ch));
+ ret = qemu_chr_fe_write_all(serial_hd(0)->be, &ch, sizeof(ch));
if (ret < 0) {
error_report("SBI_EXT_DBCN_CONSOLE_WRITE_BYTE: error when "
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE
2025-06-05 9:44 [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE Daniel Henrique Barboza
2025-06-05 9:44 ` [PATCH v2 1/1] target/riscv: use qemu_chr_fe_write_all() in DBCN_CONSOLE_WRITE_BYTE Daniel Henrique Barboza
@ 2025-06-09 4:03 ` Alistair Francis
1 sibling, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2025-06-09 4:03 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-riscv, alistair.francis, liwei1518, zhiwei_liu,
palmer, philmd
On Thu, Jun 5, 2025 at 7:45 PM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> Hi,
>
> In this version I removed the reference of SBI_EXT_DBCN_CONSOLE_WRITE in
> the commit message. That API is *non-blocking*, and citing it to justify
> a change in a blocking API sounds weird. It's also uneeded since we have
> a good case without it regardless.
>
> No other changes made.
>
> Changes from v1:
> - removed the "SBI_EXT_DBCN_CONSOLE_WRITE" bit from the commit msg
> - v1 link: https://lore.kernel.org/qemu-riscv/20250605090012.1268809-1-dbarboza@ventanamicro.com/
>
> Daniel Henrique Barboza (1):
> target/riscv: use qemu_chr_fe_write_all() in DBCN_CONSOLE_WRITE_BYTE
Thanks!
Applied to riscv-to-apply.next
Alistair
>
> target/riscv/kvm/kvm-cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --
> 2.49.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-09 4:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 9:44 [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE Daniel Henrique Barboza
2025-06-05 9:44 ` [PATCH v2 1/1] target/riscv: use qemu_chr_fe_write_all() in DBCN_CONSOLE_WRITE_BYTE Daniel Henrique Barboza
2025-06-09 4:03 ` [PATCH v2 0/1] riscv: qemu_chr_fe_write_all() in CONSOLE_WRITE_BYTE Alistair Francis
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.