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

Re: [PATCH 1/4] arm/domain: Update SBSA_VUART_CONSOLE config option handling


  • To: Milan Djokic <milan_djokic@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 8 Dec 2025 15:43:35 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=WdUpVf7xVXw9ntmZ67/ntwdN6yyfnm2EeHfw0BXRy1o=; b=H6NQ16chIfTSqooK58dpjzGrbdtHok9dqOKNfKjxsXWrCgNWub//DLNNKcB8hVQuGlyXGnl6Q9Fd6nAPrEm9dufNOvRFLmkkyIE1H5PSvA0BswvetLFBBHTvYGLSbmE13RpIwyBjRUOVckkhM0fB9ZPIdcU5ogoyfNgwzdLZDxKBpbiyiuC0L0MX3+yLxZlm071ZExPa5A/hK7PLiMPZTvZCunWYzOsIMCmYjo0cWtl7DP6GooV2UmHCWJmWG+tQPjPimcMfvLjuqpltdxCBlVXm0HsXMoKJC80ACWr6HXfINDQ8LkjsD4uHun34atMmM+P+bi0e34oKndsB2vXRRg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PaAZQDD3QLaHhAZkvw7hunR620ZlkArPTxbdvAqEL2Z8q3T54x6O18Qx9T3xH5/XJA5u4kw6H2F48IUBJBVZC0L0BbK0Ud9cBoLxYdCMdUiXRb6NxCs0uftSGMhSX5MdN49dQR0aCj5flZ34jl6StD2ltxCegJMzHRr7Z6hleOV+2UVOPACpigcjweuhgsDMoEAc4bBS7Fn37PYB8KgXBGEsgRfpNmL6KTHjEW6wlmdPueqSsiGeNRS3MGeWrUp1S6I249ovpak6c/2rnRqwV289oiE7LiTIGrhSUBXWrWPJPYIzDP2fDU+oyOhphCqkUpIju0u+ce/2q6oUspfDCQ==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 08 Dec 2025 14:43:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 05/12/2025 21:36, Milan Djokic wrote:
> Update XEN_DOMCTL_vuart_op command handling to return -EOPNOTSUPP when
> vpl011 is disabled, informing the control domain that this feature
> is unavailable.
> Added dom0less config sanity check for vpl011 property
> 
> Signed-off-by: Milan Djokic <milan_djokic@xxxxxxxx>
> ---
>  xen/arch/arm/dom0less-build.c     | 4 ++++
>  xen/arch/arm/domctl.c             | 3 +++
>  xen/arch/arm/include/asm/vpl011.h | 2 +-
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
> index 4181c10538..57980d2abe 100644
> --- a/xen/arch/arm/dom0less-build.c
> +++ b/xen/arch/arm/dom0less-build.c
> @@ -322,6 +322,10 @@ int __init arch_parse_dom0less_node(struct 
> dt_device_node *node,
>      if ( domu_dt_sci_parse(node, d_cfg) )
>          panic("Error getting SCI configuration\n");
>  
> +    if ( dt_property_read_bool(node, "vpl011") &&
> +         !IS_ENABLED(CONFIG_SBSA_VUART_CONSOLE) )
> +        panic("'vpl011' property found, but CONFIG_SBSA_VUART_CONSOLE not 
> selected\n");
I don't think there is a need for another dt property reading. In init_vuart()
we read this property and if present we call domain_vpl011_init. This function
returns (thanks to your change) -EOPNOTSUPP, so we already cover both cases. No
need for an explicit panic.

> +
>      if ( !dt_property_read_u32(node, "nr_spis", &d_cfg->arch.nr_spis) )
>      {
>          int vpl011_virq = GUEST_VPL011_SPI;
> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
> index ad914c915f..250e20a9fb 100644
> --- a/xen/arch/arm/domctl.c
> +++ b/xen/arch/arm/domctl.c
> @@ -156,6 +156,9 @@ long arch_do_domctl(struct xen_domctl *domctl, struct 
> domain *d,
>          unsigned int i;
>          struct xen_domctl_vuart_op *vuart_op = &domctl->u.vuart_op;
>  
> +        if ( !IS_ENABLED(CONFIG_SBSA_VUART_CONSOLE) )
> +            return -EOPNOTSUPP;
Why is this needed? Later on in this path we will call domain_vpl011_init that
will return exactly the same if CONFIG_SBSA_VUART_CONSOLE is not enabled.

> +
>          /* check that structure padding must be 0. */
>          for ( i = 0; i < sizeof(vuart_op->pad); i++ )
>              if ( vuart_op->pad[i] )
> diff --git a/xen/arch/arm/include/asm/vpl011.h 
> b/xen/arch/arm/include/asm/vpl011.h
> index cc83868281..b8f4d85651 100644
> --- a/xen/arch/arm/include/asm/vpl011.h
> +++ b/xen/arch/arm/include/asm/vpl011.h
> @@ -74,7 +74,7 @@ int vpl011_rx_char_xen(struct domain *d, char c);
>  static inline int domain_vpl011_init(struct domain *d,
>                                       struct vpl011_init_info *info)
>  {
> -    return -ENOSYS;
> +    return -EOPNOTSUPP;
This change is ok.

~Michal




 


Rackspace

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