[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 03/16] arm/vpl011: use vuart_ prefix in vpl011 public calls


  • To: dmkhn@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 24 Jun 2025 12:11:10 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I5K5MpxaxEOgN30+0HCW00YKn24ISJ2DThadpFnV008=; b=PMG+deCxJYAlQx5znr3KsHnhx0x4iyVhPfzJ1NskWcfx1UsTrDJN49LZpt2CcuOsw7cVTBUAaMcE72IK1DliDWxAdYbKN0nuocB63FjCH7H69xgdovtAHL89iXSvhL2DZbpS/60I+rJG5WbuT459JLg3IaeGMjAcG4efiXVZ1bulvi2l8FbIv+ESyHuKUZ1LkOM3vh1lhc4BqKppxYeTKKHhtEW7SfKqDH/0553taDPy9xOXPSyAIVvqS6RqjpX9Q57EfSQRoMRgzWbgkLN7dsm1fifIxIjkLaaYHRUm7LB7wvTALu4+BUbH0YtRlm/RR2p0uUZTWd0aHA7m7RKkdg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZM/yqeYX2S974vv4kSW193hPJnCJBInTV2+KeV5YEQRf5fF0e7tmDpsxw+8+fn9KznjZktdEAdk0l1zihU3Vt9a4CLL9jMJNBNWh/pV6d9T8oxAL4WDkBX6+Mt1OUU/6HpekUUej1cnpOD3mL0gaJJiQM2Q6r9pLK1UrUkl2+osQ7rQdIZEKSD+rCJs3pVVR2YUKgciRFI74O1jmBtzNnofbkOuUKOSGSO7cTtVp0435LxSvc5PFbccjHQFi3U0VfF035CLE2Nq1Xtbk//35oDnvuHvdatC3HYgv3hr+0PC05jK0G3CDF7XbUJKpksW9t/kxCuQE/doF1MuTtrsIpQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, oleksii.kurochko@xxxxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Tue, 24 Jun 2025 10:11:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 24/06/2025 05:55, dmkhn@xxxxxxxxx wrote:
> From: Denis Mukhin <dmukhin@xxxxxxxx> 
> 
> Use generic names prefixed with 'vuart_' in public PL011 emulator data
> structures and functions.
> 
> No functional change intended.
> 
> Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
> ---
>  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?

>          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.

>  
>  #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, &params);
>  
>      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.

~Michal




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.