All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Zheng <zhangzheng@iscas.ac.cn>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Connor Davis" <connojdavis@gmail.com>,
	"Baptiste Le Duc" <baptiste.le-duc@vates.tech>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Julien Grall" <julien@xen.org>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>
Subject: Re: [PATCH v1 0/1] [RISC-V] replace SBI early console with 8250 UART
Date: Mon, 28 Sep 2026 16:40:31 +0800	[thread overview]
Message-ID: <aronfcYWtc1CHQgH@iscas-ws> (raw)
In-Reply-To: <5919f1f2-e24c-4b0e-a7dd-126ac6fbe38f@gmail.com>

On Mon, Sep 28, 2026 at 09:38:14AM +0200, Oleksii Kurochko wrote:
> 
> 
> On 9/28/26 4:38 AM, Zhang Zheng wrote:
> > The legacy SBI console extension is planned for deprecation. Replace the
> > RISC-V early printk backend with direct access to 8250 UART MMIO.
> 
> Won't it better just to start to add support of newer SBI? It provides
> pretty good support + faster as it supports passing of string instead of one
> char.
> 

Using the newer SBI DBCN extension would indeed result in a smaller change. At
the time, I mainly followed the direction suggested by the TODO and referred
directly to the arm64 implementation, from which most of the code was adapted.

> Also, I think it will lead to lesser changes.
> 

If falling back to SBI console putchar is acceptable, DBCN should work
well here.

> ~ Oleksii
> 
> > 
> > This also addresses truncated output observed on SpacemiT K3 when
> > switching from early printk to dtuart. Direct UART access lets early
> > printk flush the UART after each string before the dtuart driver takes
> > over and clear it's FIFO, which cause the truncated uart output.>
> > The truncated uart looks like:
> > 
> >    (XEN) Command line: dtuart=/soc/uart@d4017000:115200/921600 console=dtuart sync_console
> >    (XEN) Domain heap initialised
> >    (XEN) Booting using Device Tree
> >    (XEN) /home/zz/dev/git/xen_stuff/xen/xen/arch/riscv/cpufeature.c:710: SSTC detected; supported for Xen use, but not for guests
> >    (XEN) Looking for dtuart at "/soc/uart@d40 __  __            _  _    ____  _____                    _        _     _
> >     \ \/ /___ _ __   | || |  |___ \|___ /    _   _ _ __  ___| |_ __ _| |__ | | ___
> >      \  // _ \ '_ \  | || |_   __) | |_ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
> >      /  \  __/ | | | |__   _| / __/ ___) |__| |_| | | | \__ \ || (_| | |_) | |  __/
> >     /_/\_\___|_| |_|    |_|(_)_____|____/    \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
> > 
> >    (XEN) Xen version 4.23-unstable (zz@) (riscv64-linux-gnu-gcc (GCC) 15.1.0) debug=y ubsan=y Sat Sep 26 14:50:31 CST 2026
> >    (XEN) Latest ChangeSet: Fri Sep 18 10:11:27 2026 +0800 git:77544a69ea
> > 
> > Zheng Zhang (1):
> >    xen/riscv: replace SBI early console with 8250 UAR
> > 
> >   xen/arch/riscv/Kconfig.debug              | 53 ++++++++++++++++++++--
> >   xen/arch/riscv/configs/tiny64_defconfig   |  2 +
> >   xen/arch/riscv/early_printk.c             | 37 +++++++---------
> >   xen/arch/riscv/include/asm/early_printk.h | 12 +++++
> >   xen/arch/riscv/include/asm/fixmap.h       |  6 ++-
> >   xen/arch/riscv/include/asm/sbi.h          |  7 ---
> >   xen/arch/riscv/mm.c                       | 41 +++++++++++++----
> >   xen/arch/riscv/riscv64/Makefile           |  1 +
> >   xen/arch/riscv/riscv64/debug-8250.inc     | 51 +++++++++++++++++++++
> >   xen/arch/riscv/riscv64/debug.S            | 54 +++++++++++++++++++++++
> >   xen/arch/riscv/sbi.c                      |  5 ---
> >   11 files changed, 223 insertions(+), 46 deletions(-)
> >   create mode 100644 xen/arch/riscv/riscv64/debug-8250.inc
> >   create mode 100644 xen/arch/riscv/riscv64/debug.S
> > 
> > base-commit: 4c1aba82cff95ab11f7fe4af8965a06703537288



  reply	other threads:[~2026-09-28  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  2:38 [PATCH v1 0/1] [RISC-V] replace SBI early console with 8250 UART Zhang Zheng
2026-09-28  2:38 ` [PATCH v1 1/1] xen/riscv: " Zhang Zheng
2026-09-28  7:38 ` [PATCH v1 0/1] [RISC-V] " Oleksii Kurochko
2026-09-28  8:40   ` Zhang Zheng [this message]
2026-09-28  9:31     ` Oleksii Kurochko
2026-09-28 12:53       ` Zhang Zheng
2026-09-29  3:10         ` Zhang Zheng
2026-09-30 11:22           ` Oleksii Kurochko
2026-10-10  3:32             ` Zhang Zheng
2026-10-12  7:39               ` Oleksii Kurochko

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=aronfcYWtc1CHQgH@iscas-ws \
    --to=zhangzheng@iscas.ac.cn \
    --cc=alistair.francis@wdc.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=baptiste.le-duc@vates.tech \
    --cc=connojdavis@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=oleksii.kurochko@gmail.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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.