All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com,
	liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
	palmer@dabbelt.com
Subject: Re: [PATCH] target/riscv/kvm: use qemu_chr_fe_write_all() in SBI_EXT_DBCN_CONSOLE_WRITE_BYTE
Date: Thu, 5 Jun 2025 06:45:55 -0300	[thread overview]
Message-ID: <57693dc5-b624-4697-a26b-097c0fa4cce9@ventanamicro.com> (raw)
In-Reply-To: <0b6b429a-a3bc-4707-9e94-67d9fe8cc363@linaro.org>



On 6/5/25 6:26 AM, Philippe Mathieu-Daudé wrote:
> On 5/6/25 11:00, Daniel Henrique Barboza wrote:
>> 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(). This is also how SBI_EXT_DBCN_CONSOLE_WRITE is
>> implemented, so we're also being more consistent.
>>
>> 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>
>> ---
>>   target/riscv/kvm/kvm-cpu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Thank you very much Daniel!

No problem :)

FYI I just sent a v2 with a small change in the commit msg. Your ack was kept.
Thanks,


Daniel

> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 



      reply	other threads:[~2025-06-05  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05  9:00 [PATCH] target/riscv/kvm: use qemu_chr_fe_write_all() in SBI_EXT_DBCN_CONSOLE_WRITE_BYTE Daniel Henrique Barboza
2025-06-05  9:26 ` Philippe Mathieu-Daudé
2025-06-05  9:45   ` Daniel Henrique Barboza [this message]

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=57693dc5-b624-4697-a26b-097c0fa4cce9@ventanamicro.com \
    --to=dbarboza@ventanamicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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.