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

Re: [PATCH v6 01/15] emul/vuart: introduce framework for UART emulators



On Mon, Sep 08, 2025 at 11:29:03AM +0300, Mykola Kvach wrote:
> On Sat, Sep 6, 2025 at 2:27 AM <dmukhin@xxxxxxx> wrote:
[..]
> > +++ b/xen/common/emul/vuart/Kconfig
> > @@ -0,0 +1,6 @@
> > +config VUART_FRAMEWORK
> > +       bool
> 
> If VUART_FRAMEWORK has no dependencies, it can be enabled on any
> architecture. For example, I tried enabling it on arm64 and the build
> fails:
> 
>   ./include/xen/vuart.h:26:8: error: redefinition of ‘struct vuart’
> 
> Should this config be restricted (e.g. "depends on X86") or the code
> adjusted to handle non-x86 architectures properly?

Yes, missed that; the code is for x86 only for now.
`struct vuart` on Arm corresponds to simple MMIO-based UART emulator for
hwdom's earlyprintk.

Arm part is pending:
  https://lore.kernel.org/xen-devel/20250624035443.344099-1-dmukhin@xxxxxxxx/

Most of the feedback resolved locally, but I need to wait for the other series 
to land

[..]
> > +static const struct vuart_emulator *
> > +vuart_match_by_compatible(const struct domain *d, const char *compat)
> > +{
> > +    const struct vuart_emulator *emulator;
> > +
> > +    for_each_emulator(emulator)
> > +        if ( emulator->compatible &&
> > +             !strncmp(compat, emulator->compatible,
> > +                      strlen(emulator->compatible)) )
> > +            return emulator;
> > +
> > +    return NULL;
> > +}
> > +
> > +const static struct vuart *
> > +vuart_find_by_console_permission(const struct domain *d)
> 
> During the first review of this patch I thought you planned to add a
> searching procedure into this and the next function in one of the later
> commits. However, looking at the series now, it seems these functions
> remain unchanged and don’t actually perform any searching.
> 
> Do you think the current names are accurate, or would it make sense to
> rename them to better reflect their purpose?

Arm has two vUART emulators enabled by default, so there will be at least two
vUARTs and some search in vuart.c.

I scoped x86 portion of the change into the current series, Arm is to follow,
since I have pending series to plumb vpl011 (i.e. SBSA) and hwdom vuart (i.e.
early dtuart) into that new framework. There will be some adjustments in
vuart.c



 


Rackspace

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