From: dmkhn@proton.me
To: "Orzel, Michal" <michal.orzel@amd.com>
Cc: xen-devel@lists.xenproject.org, andrew.cooper3@citrix.com,
anthony.perard@vates.tech, jbeulich@suse.com, julien@xen.org,
oleksii.kurochko@gmail.com, roger.pau@citrix.com,
sstabellini@kernel.org, dmukhin@ford.com
Subject: Re: [PATCH v1 03/16] arm/vpl011: use vuart_ prefix in vpl011 public calls
Date: Tue, 24 Jun 2025 22:17:53 +0000 [thread overview]
Message-ID: <aFskC3a74y+U8tnx@kraken> (raw)
In-Reply-To: <8c35481f-6a2b-4579-9b34-c912cf3bbd14@amd.com>
On Tue, Jun 24, 2025 at 12:11:10PM +0200, Orzel, Michal wrote:
>
>
> On 24/06/2025 05:55, dmkhn@proton.me wrote:
> > From: Denis Mukhin <dmukhin@ford.com>
> >
> > Use generic names prefixed with 'vuart_' in public PL011 emulator data
> > structures and functions.
> >
> > No functional change intended.
> >
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> > xen/arch/arm/dom0less-build.c | 4 ++--
> > xen/arch/arm/domain.c | 3 ++-
> > xen/arch/arm/domctl.c | 14 +++++++------
> > xen/arch/arm/include/asm/vpl011.h | 20 ------------------
> > xen/arch/arm/vpl011.c | 24 +++++++++++-----------
> > xen/drivers/char/console.c | 6 ++----
> > xen/include/xen/vuart.h | 34 ++++++++++++++++++++++++++++++-
> > 7 files changed, 59 insertions(+), 46 deletions(-)
> >
> > diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
> > index 7c1b59750fb5..11b8498d3b22 100644
> > --- a/xen/arch/arm/dom0less-build.c
> > +++ b/xen/arch/arm/dom0less-build.c
> > @@ -216,7 +216,7 @@ int __init init_vuart(struct domain *d, struct kernel_info *kinfo,
> As can be seen here ...
>
> > */
> > if ( kinfo->arch.vpl011 )
> > {
> > - rc = domain_vpl011_init(d, NULL);
> > + rc = vuart_init(d, NULL);
> we end up with init_vuart() and vuart_init(). That's quite confusing. Maybe
> domain_vuart_init() or alike?
That's right!
But domain_vuart_init() is used by MMIO-based variant :)
I will write an extra patch and put it to the end of the series to update the
name here.
>
> > if ( rc < 0 )
> > return rc;
> > }
> > @@ -247,7 +247,7 @@ void __init arch_create_domUs(struct dt_device_node *node,
> > * d->arch.vpl011.irq. So the logic to find the vIRQ has to
> > * be hardcoded.
> > * The logic here shall be consistent with the one in
> > - * domain_vpl011_init().
> > + * vuart_init().
> > */
> > if ( flags & CDF_directmap )
> > {
> > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > index be58a23dd725..68297e619bad 100644
> > --- a/xen/arch/arm/domain.c
> > +++ b/xen/arch/arm/domain.c
> > @@ -11,6 +11,7 @@
> > #include <xen/sched.h>
> > #include <xen/softirq.h>
> > #include <xen/wait.h>
> > +#include <xen/vuart.h>
> >
> > #include <asm/arm64/sve.h>
> > #include <asm/cpuerrata.h>
> > @@ -1072,7 +1073,7 @@ int domain_relinquish_resources(struct domain *d)
> > * Release the resources allocated for vpl011 which were
> > * allocated via a DOMCTL call XEN_DOMCTL_vuart_op.
> > */
> > - domain_vpl011_deinit(d);
> > + vuart_exit(d);
> IMO, deinit is more meaningful here.
Yeah, it's just MMIO UART uses init/free, here it is init/deinit.
So I just picked init/exit similar to module_{init,exit} in Linux driver model
and applied to all existing vUARTs.
Can update all vUARTs to deinit()
>
> >
> > #ifdef CONFIG_IOREQ_SERVER
> > ioreq_server_destroy_all(d);
> > diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
> > index ad914c915f81..dde25ceff6d0 100644
> > --- a/xen/arch/arm/domctl.c
> > +++ b/xen/arch/arm/domctl.c
> > @@ -14,6 +14,7 @@
> > #include <xen/mm.h>
> > #include <xen/sched.h>
> > #include <xen/types.h>
> > +#include <xen/vuart.h>
> > #include <xsm/xsm.h>
> > #include <public/domctl.h>
> >
> > @@ -30,10 +31,11 @@ static int handle_vuart_init(struct domain *d,
> > struct xen_domctl_vuart_op *vuart_op)
> > {
> > int rc;
> > - struct vpl011_init_info info;
> > -
> > - info.console_domid = vuart_op->console_domid;
> > - info.gfn = _gfn(vuart_op->gfn);
> > + struct vuart_params params = {
> > + .console_domid = vuart_op->console_domid,
> > + .gfn = _gfn(vuart_op->gfn),
> > + .evtchn = 0,
> > + };
> >
> > if ( d->creation_finished )
> > return -EPERM;
> > @@ -41,10 +43,10 @@ static int handle_vuart_init(struct domain *d,
> > if ( vuart_op->type != XEN_DOMCTL_VUART_TYPE_VPL011 )
> > return -EOPNOTSUPP;
> >
> > - rc = domain_vpl011_init(d, &info);
> > + rc = vuart_init(d, ¶ms);
> >
> > if ( !rc )
> > - vuart_op->evtchn = info.evtchn;
> > + vuart_op->evtchn = params.evtchn;
> >
> > return rc;
> > }
> > diff --git a/xen/arch/arm/include/asm/vpl011.h b/xen/arch/arm/include/asm/vpl011.h
> > index be64883b8628..5c308cc8c148 100644
> > --- a/xen/arch/arm/include/asm/vpl011.h
> > +++ b/xen/arch/arm/include/asm/vpl011.h
> > @@ -59,26 +59,6 @@ struct vpl011 {
> > evtchn_port_t evtchn;
> > };
> >
> > -struct vpl011_init_info {
> > - domid_t console_domid;
> > - gfn_t gfn;
> > - evtchn_port_t evtchn;
> > -};
> > -
> > -#ifdef CONFIG_HAS_VUART_PL011
> > -int domain_vpl011_init(struct domain *d,
> > - struct vpl011_init_info *info);
> > -void domain_vpl011_deinit(struct domain *d);
> > -int vpl011_rx_char_xen(struct domain *d, char c);
> > -#else
> > -static inline int domain_vpl011_init(struct domain *d,
> > - struct vpl011_init_info *info)
> > -{
> > - return -ENOSYS;
> > -}
> > -
> > -static inline void domain_vpl011_deinit(struct domain *d) { }
> > -#endif
> > #endif /* _VPL011_H_ */
> >
> > /*
> > diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
> > index cafc532cf028..2cf88a70ecdb 100644
> > --- a/xen/arch/arm/vpl011.c
> > +++ b/xen/arch/arm/vpl011.c
> > @@ -134,7 +134,7 @@ static void vpl011_write_data_xen(struct domain *d, uint8_t data)
> >
> > /*
> > * vpl011_read_data_xen reads data when the backend is xen. Characters
> > - * are added to the vpl011 receive buffer by vpl011_rx_char_xen.
> > + * are added to the vpl011 receive buffer by vuart_putchar.
> > */
> > static uint8_t vpl011_read_data_xen(struct domain *d)
> > {
> > @@ -571,9 +571,9 @@ static void vpl011_data_avail(struct domain *d,
> > }
> >
> > /*
> > - * vpl011_rx_char_xen adds a char to a domain's vpl011 receive buffer.
> > + * vuart_putchar adds a char to a domain's vpl011 receive buffer.
> > */
> > -int vpl011_rx_char_xen(struct domain *d, char c)
> > +int vuart_putchar(struct domain *d, char c)
> How can putchar refer to RX? By definition putchar() is used to print data to
> STDOUT. Here we receive a character and put it in the RX FIFO.
That's confusing, I agree; I think this is a leftover from the earlier vUART
series.
Will update, thanks!
>
> ~Michal
>
>
next prev parent reply other threads:[~2025-06-24 22:18 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 3:54 [PATCH v1 00/16] xen: framework for UART emulators dmkhn
2025-06-24 3:55 ` [PATCH v1 01/16] arm/vpl011: rename virtual PL011 Kconfig option dmkhn
2025-06-24 6:13 ` Orzel, Michal
2025-06-24 7:24 ` dmkhn
2025-07-17 15:43 ` Alejandro Vallejo
2025-07-17 19:58 ` dmkhn
2025-07-18 11:10 ` Alejandro Vallejo
2025-06-24 3:55 ` [PATCH v1 02/16] arm/vpl011: move DT node parsing to PL011 emulator code dmkhn
2025-06-24 7:49 ` Orzel, Michal
2025-06-24 21:56 ` dmkhn
2025-06-25 6:57 ` Orzel, Michal
2025-07-31 21:02 ` dmkhn
2025-06-24 3:55 ` [PATCH v1 03/16] arm/vpl011: use vuart_ prefix in vpl011 public calls dmkhn
2025-06-24 10:11 ` Orzel, Michal
2025-06-24 22:17 ` dmkhn [this message]
2025-07-31 21:11 ` dmkhn
2025-06-24 3:55 ` [PATCH v1 04/16] arm/vpl011: use raw spin_lock_{irqrestore,irqsave} dmkhn
2025-06-24 5:46 ` Jan Beulich
2025-06-24 7:50 ` Orzel, Michal
2025-06-24 21:46 ` dmkhn
2025-06-25 6:52 ` Orzel, Michal
2025-07-31 21:03 ` dmkhn
2025-06-24 3:55 ` [PATCH v1 05/16] arm/vpl011: use void pointer in domain struct dmkhn
2025-06-25 7:21 ` Orzel, Michal
2025-06-24 3:55 ` [PATCH v1 06/16] arm/vpl011: remove vpl011 header file dmkhn
2025-06-24 3:55 ` [PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option dmkhn
2025-06-24 6:37 ` Orzel, Michal
2025-06-24 7:14 ` dmkhn
2025-06-25 7:07 ` Orzel, Michal
2025-07-31 21:02 ` dmkhn
2025-06-24 3:56 ` [PATCH v1 08/16] arm/vuart: move simple MMIO-based vUART declarations to common header dmkhn
2025-06-24 3:56 ` [PATCH v1 09/16] arm/vuart: use void pointer in domain struct dmkhn
2025-06-24 3:56 ` [PATCH v1 10/16] arm/vuart: merge vuart_print_char() with vuart_mmio_write() dmkhn
2025-06-24 3:56 ` [PATCH v1 11/16] xen/domain: introduce common emulation flags dmkhn
2025-06-24 3:56 ` [PATCH v1 12/16] xen/domain: introduce domain-emu.h dmkhn
2025-07-09 14:57 ` Jan Beulich
2025-07-31 20:55 ` dmkhn
2025-08-01 6:02 ` Jan Beulich
2025-08-01 19:30 ` dmkhn
2025-08-04 7:13 ` Jan Beulich
2025-08-05 0:24 ` dmkhn
2025-06-24 3:56 ` [PATCH v1 13/16] drivers/vuart: move PL011 emulator code dmkhn
2025-06-24 5:50 ` Jan Beulich
2025-06-24 7:31 ` dmkhn
2025-06-24 7:33 ` Jan Beulich
2025-07-10 1:59 ` dmkhn
2025-07-10 8:15 ` Jan Beulich
2025-07-10 17:00 ` Stefano Stabellini
2025-07-31 20:47 ` dmkhn
2025-07-10 18:32 ` dmkhn
2025-06-24 3:57 ` [PATCH v1 14/16] drivers/vuart: move simple MMIO-based UART emulator dmkhn
2025-06-24 5:53 ` Jan Beulich
2025-06-24 7:36 ` dmkhn
2025-06-24 7:40 ` Jan Beulich
2025-06-24 22:54 ` dmkhn
2025-06-25 5:25 ` Jan Beulich
2025-07-10 1:52 ` dmkhn
2025-06-24 3:57 ` [PATCH v1 15/16] drivers/vuart: introduce framework for UART emulators dmkhn
2025-06-24 3:57 ` [PATCH v1 16/16] drivers/vuart: hook simple MMIO-based UART to vUART framework dmkhn
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=aFskC3a74y+U8tnx@kraken \
--to=dmkhn@proton.me \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=roger.pau@citrix.com \
--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.