[PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option

dmkhn@proton.me posted 16 patches 4 months, 1 week ago
[PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option
Posted by dmkhn@proton.me 4 months, 1 week ago
From: Denis Mukhin <dmukhin@ford.com> 

Rename HWDOM_VUART to HAS_VUART_MMIO.

This emulator emulates only one register and the use of the emulator is
limited to early boot console in the guest OS.

No functional change.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
 xen/arch/arm/Kconfig              | 2 +-
 xen/arch/arm/Makefile             | 2 +-
 xen/arch/arm/include/asm/domain.h | 2 +-
 xen/arch/arm/vuart.h              | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 03888569f38c..b11cb583a763 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -177,7 +177,7 @@ config HAS_VUART_PL011
 	  Allows a guest to use SBSA Generic UART as a console. The
 	  SBSA Generic UART implements a subset of ARM PL011 UART.
 
-config HWDOM_VUART
+config HAS_VUART_MMIO
 	bool "Emulated UART for hardware domain"
 	default y
 	help
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 2d6787fb03bc..dd015a2a19e8 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -68,7 +68,7 @@ obj-y += vtimer.o
 obj-$(CONFIG_HAS_VUART_PL011) += vpl011.o
 obj-y += vsmc.o
 obj-y += vpsci.o
-obj-$(CONFIG_HWDOM_VUART) += vuart.o
+obj-$(CONFIG_HAS_VUART_MMIO) += vuart.o
 
 extra-y += xen.lds
 
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 2ee9976b55a8..d668c11d7e2c 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -90,7 +90,7 @@ struct arch_domain
 
     struct vgic_dist vgic;
 
-#ifdef CONFIG_HWDOM_VUART
+#ifdef CONFIG_HAS_VUART_MMIO
     struct vuart {
 #define VUART_BUF_SIZE 128
         char                        *buf;
diff --git a/xen/arch/arm/vuart.h b/xen/arch/arm/vuart.h
index e90d84c6eddb..726846355c3b 100644
--- a/xen/arch/arm/vuart.h
+++ b/xen/arch/arm/vuart.h
@@ -22,7 +22,7 @@
 
 struct domain;
 
-#ifdef CONFIG_HWDOM_VUART
+#ifdef CONFIG_HAS_VUART_MMIO
 
 int domain_vuart_init(struct domain *d);
 void domain_vuart_free(struct domain *d);
@@ -40,7 +40,7 @@ static inline int domain_vuart_init(struct domain *d)
 
 static inline void domain_vuart_free(struct domain *d) {};
 
-#endif /* CONFIG_HWDOM_VUART */
+#endif /* CONFIG_HAS_VUART_MMIO */
 
 #endif /* __ARCH_ARM_VUART_H__ */
 
-- 
2.34.1
Re: [PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option
Posted by Orzel, Michal 4 months, 1 week ago

On 24/06/2025 05:55, dmkhn@proton.me wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
> 
> Rename HWDOM_VUART to HAS_VUART_MMIO.
> 
> This emulator emulates only one register and the use of the emulator is
> limited to early boot console in the guest OS.
> 
> No functional change.
> 
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> ---
>  xen/arch/arm/Kconfig              | 2 +-
>  xen/arch/arm/Makefile             | 2 +-
>  xen/arch/arm/include/asm/domain.h | 2 +-
>  xen/arch/arm/vuart.h              | 4 ++--
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 03888569f38c..b11cb583a763 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -177,7 +177,7 @@ config HAS_VUART_PL011
>  	  Allows a guest to use SBSA Generic UART as a console. The
>  	  SBSA Generic UART implements a subset of ARM PL011 UART.
>  
> -config HWDOM_VUART
> +config HAS_VUART_MMIO
I personally don't like this change. The current config option name reads much
better and clearly denotes the purpose.

~Michal
Re: [PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option
Posted by dmkhn@proton.me 4 months, 1 week ago
On Tue, Jun 24, 2025 at 08:37:22AM +0200, Orzel, Michal wrote:
> 
> 
> On 24/06/2025 05:55, dmkhn@proton.me wrote:
> > From: Denis Mukhin <dmukhin@ford.com>
> >
> > Rename HWDOM_VUART to HAS_VUART_MMIO.
> >
> > This emulator emulates only one register and the use of the emulator is
> > limited to early boot console in the guest OS.
> >
> > No functional change.
> >
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> >  xen/arch/arm/Kconfig              | 2 +-
> >  xen/arch/arm/Makefile             | 2 +-
> >  xen/arch/arm/include/asm/domain.h | 2 +-
> >  xen/arch/arm/vuart.h              | 4 ++--
> >  4 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > index 03888569f38c..b11cb583a763 100644
> > --- a/xen/arch/arm/Kconfig
> > +++ b/xen/arch/arm/Kconfig
> > @@ -177,7 +177,7 @@ config HAS_VUART_PL011
> >  	  Allows a guest to use SBSA Generic UART as a console. The
> >  	  SBSA Generic UART implements a subset of ARM PL011 UART.
> >
> > -config HWDOM_VUART
> > +config HAS_VUART_MMIO
> I personally don't like this change. The current config option name reads much
> better and clearly denotes the purpose.

In my opinion, the MMIO-based UART is a useful debugging tool for early guest
boot, even when the guest doesn't run in hwdom or on Arm system.

> 
> ~Michal
> 
Re: [PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option
Posted by Orzel, Michal 4 months, 1 week ago

On 24/06/2025 09:14, dmkhn@proton.me wrote:
> On Tue, Jun 24, 2025 at 08:37:22AM +0200, Orzel, Michal wrote:
>>
>>
>> On 24/06/2025 05:55, dmkhn@proton.me wrote:
>>> From: Denis Mukhin <dmukhin@ford.com>
>>>
>>> Rename HWDOM_VUART to HAS_VUART_MMIO.
>>>
>>> This emulator emulates only one register and the use of the emulator is
>>> limited to early boot console in the guest OS.
>>>
>>> No functional change.
>>>
>>> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
>>> ---
>>>  xen/arch/arm/Kconfig              | 2 +-
>>>  xen/arch/arm/Makefile             | 2 +-
>>>  xen/arch/arm/include/asm/domain.h | 2 +-
>>>  xen/arch/arm/vuart.h              | 4 ++--
>>>  4 files changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index 03888569f38c..b11cb583a763 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -177,7 +177,7 @@ config HAS_VUART_PL011
>>>  	  Allows a guest to use SBSA Generic UART as a console. The
>>>  	  SBSA Generic UART implements a subset of ARM PL011 UART.
>>>
>>> -config HWDOM_VUART
>>> +config HAS_VUART_MMIO
>> I personally don't like this change. The current config option name reads much
>> better and clearly denotes the purpose.
> 
> In my opinion, the MMIO-based UART is a useful debugging tool for early guest
> boot, even when the guest doesn't run in hwdom or on Arm system.
The reason why this vUART is for hwdom is that is uses information from dtuart
(physical UART used by Xen probed from DT). This is to enable kernels used as
dom0 that had early printk/earlycon set for this serial device (as if they run
baremetal). Regular domUs have vPL011 and don't need hwdom vUART.

~Michal
Re: [PATCH v1 07/16] arm/vuart: rename 'virtual UART' Kconfig option
Posted by dmkhn@proton.me 3 months ago
Hi Michal,

On Wed, Jun 25, 2025 at 09:07:48AM +0200, Orzel, Michal wrote:
> 
> 
> On 24/06/2025 09:14, dmkhn@proton.me wrote:
> > On Tue, Jun 24, 2025 at 08:37:22AM +0200, Orzel, Michal wrote:
> >>
> >>
> >> On 24/06/2025 05:55, dmkhn@proton.me wrote:
> >>> From: Denis Mukhin <dmukhin@ford.com>
> >>>
> >>> Rename HWDOM_VUART to HAS_VUART_MMIO.
> >>>
> >>> This emulator emulates only one register and the use of the emulator is
> >>> limited to early boot console in the guest OS.
> >>>
> >>> No functional change.
> >>>
> >>> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> >>> ---
> >>>  xen/arch/arm/Kconfig              | 2 +-
> >>>  xen/arch/arm/Makefile             | 2 +-
> >>>  xen/arch/arm/include/asm/domain.h | 2 +-
> >>>  xen/arch/arm/vuart.h              | 4 ++--
> >>>  4 files changed, 5 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> >>> index 03888569f38c..b11cb583a763 100644
> >>> --- a/xen/arch/arm/Kconfig
> >>> +++ b/xen/arch/arm/Kconfig
> >>> @@ -177,7 +177,7 @@ config HAS_VUART_PL011
> >>>  	  Allows a guest to use SBSA Generic UART as a console. The
> >>>  	  SBSA Generic UART implements a subset of ARM PL011 UART.
> >>>
> >>> -config HWDOM_VUART
> >>> +config HAS_VUART_MMIO
> >> I personally don't like this change. The current config option name reads much
> >> better and clearly denotes the purpose.
> >
> > In my opinion, the MMIO-based UART is a useful debugging tool for early guest
> > boot, even when the guest doesn't run in hwdom or on Arm system.
> The reason why this vUART is for hwdom is that is uses information from dtuart
> (physical UART used by Xen probed from DT). This is to enable kernels used as
> dom0 that had early printk/earlycon set for this serial device (as if they run
> baremetal). Regular domUs have vPL011 and don't need hwdom vUART.

OK, I'll keep hwdom, hope there will be no need to change it again.

I think dtuart may be useful for bringing up some exotic OSes which do
not have pl011 driver.

But then, I want to do s/HWDOM_VUART/VUART_HWDOM/g so all vUART build-time settings
have the same naming convention:
    VUART_SBSA
    VUART_NS16550

Will that be OK with you?

--
Denis

> 
> ~Michal
>