All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
	jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
	roger@xenproject.org, sstabellini@kernel.org,
	xakep.amatop@gmail.com, dmukhin@xen.org
Subject: Re: [PATCH v8 00/26] x86: introduce NS16550-compatible UART emulator
Date: Thu, 12 Nov 2026 15:53:39 +0100	[thread overview]
Message-ID: <30050658-04ce-4ab3-ac6e-bb3f517d5ded@gmail.com> (raw)
In-Reply-To: <20261111194800.1070016-1-dmukhin@ford.com>

Hello Denis,

On 11/11/26 8:47 PM, dmukhin@ford.com wrote:
> x86 port of Xen lacks vUART facility similar to Arm's vpl011 to support x86
> guest OS bring up in the embedded setups.
> 
> This patch series introduces initial in-hypervisor emulator for
> NS8250/NS16x50-compatible UARTs under CONFIG_VUART_NS16X50.
> 
> In parallel domain creation scenario (hyperlaunch), NS16550 emulator helps
> early guest firmware and OS bringup debugging, because it eliminates
> dependency on the external emulator (qemu) being operational by the time
> domains are created.
> 
> The emulator also allows to forward the physical console input to the x86
> domain which is useful when a system has only one physical UART for early
> debugging and this UART is owned by Xen.
> 
> By default, CONFIG_VUART_NS16X50 enables emulation of NS16550 at I/O port
> 0x3f8, IRQ#4 in guest OS (legacy COM1). Legacy COM resources can be selected
> at run-time via temporary and undocumented switch 'vuart='.
> 
> CONFIG_VUART_NS16X50_DEBUG enables some extra debugging facilities useful
> for NS16550 emulator development/debugging (disabled by default).
> 
> The NS16550 emulator is disabled in default x86 configuration and goes under
> CONFIG_EXPERT in Kconfig.
> 
> Note, there's a follow on work for RISC-V which is based on that series:
>    https://gitlab.com/xen-project/people/olkur/xen/-/tree/riscv-vuart-support-wip?ref_type=heads
> 
> Limitations
> ===========
> - Only x86;
> - Only legacy COM resources, custom I/O ports/IRQs are not supported;
> - Only Xen console as a backend, no inter-domain communication (similar to
>    vpl011 on Arm);
> - Only 8n1 emulation (8-bit data, no parity, 1 stop bit);
> - No toolstack integration;
> - No baud rate emulation (reports 115200 baud to the guest OS);
> - No FIFO-less mode emulation;
> - No RX FIFO interrupt moderation (FCR) emulation;
> - No integration w/ VM snapshotting (HVM_REGISTER_SAVE_RESTORE() and
>    friends);
> - No MMIO-based UART emulation.
> 
> Series
> ======
> 
>    Patch 1 introduces the new vUART framework, that is the code originally
>    posted here:
>      https://lore.kernel.org/xen-devel/20250624035443.344099-16-dmukhin@ford.com/
>    Required for emulator.
> 
>    Patch 2 adds missing NS16550 definitions, required for emulator.
> 
>    Patches 3-4 introduces the basic emulator skeleton - state machine
>    initialization stubs, I/O port handler stub, logging, etc.
> 
>    Patches 5-12 incrementally populate the minimal NS16550 register emulation.
> 
>    Patch 13 hooks vUART state debugging (disabled by default).
> 
>    Patch 14-16 adds Kconfig for enabling minimal NS16550 UART (disabled by default).
> 
>    Patches 17-21 introduce necessary changes to enable NS16550 on dom0 (and PVH).
> 
>    Patches 22-23 documentation updates. Note, that vuart= setting is not
>    documented since it will likely change with hyperlanch landing on mainline.
> 
>    Patches 24-26 tests updates.
> 
> Link to CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/3055921295
> Link to XTF branch: https://gitlab.com/xen-project/people/dmukhin/xtf/-/commits/emul-16x50
> Link to Xen branch: https://gitlab.com/xen-project/people/dmukhin/xen/-/tree/vuart-ns8250-v8?ref_type=heads
> 

I built every patch of the series on x86 (defconfig + EXPERT + DEBUG,
gcc 16.2) and a few of them don't build:

- 18/26, 19/26, 20/26 with CONFIG_VUART_NS16X50=y: ns16x50_deinit() uses
   d, which is declared only in 21/26.

- 16/26 up to 26/26 with CONFIG_VUART_NS16X50_DEBUG=y: in
   ns16x50_dump_state() (13/26) the initializer of as dereferences info
   before info = vdev->info, so -Werror=uninitialized rejects it. It
   shows up only from 16/26 on because nothing compiles ns16x50.c before 
   the Kconfig option is introduced.

~ Oleksii



      parent reply	other threads:[~2026-11-12 14:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 19:47 [PATCH v8 00/26] x86: introduce NS16550-compatible UART emulator dmukhin
2026-11-11 19:47 ` [PATCH v8 01/26] emul/vuart: introduce framework for UART emulators dmukhin
2026-11-12 15:35   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 02/26] xen/8250-uart: update definitions dmukhin
2026-11-12 14:49   ` Jan Beulich
2026-11-12 16:34   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 03/26] x86: fixup dependencies for asm/x86_emulate.h dmukhin
2026-11-12 20:25   ` Oleksii Kurochko
2026-11-13  7:20     ` Jan Beulich
2026-11-11 19:47 ` [PATCH v8 04/26] emul/ns16x50: implement emulator stub dmukhin
2026-11-13 11:48   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 05/26] emul/ns16x50: implement DLL/DLM registers dmukhin
2026-11-11 19:47 ` [PATCH v8 06/26] emul/ns16x50: implement SCR register dmukhin
2026-11-16 10:42   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 07/26] emul/ns16x50: implement IER/IIR registers dmukhin
2026-11-16 16:59   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 08/26] emul/ns16x50: implement LCR/LSR registers dmukhin
2026-11-17 16:33   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 09/26] emul/ns16x50: implement MCR/MSR registers dmukhin
2026-11-17 18:32   ` Oleksii Kurochko
2026-11-11 19:47 ` [PATCH v8 10/26] emul/ns16x50: implement RBR register dmukhin
2026-11-11 19:47 ` [PATCH v8 11/26] emul/ns16x50: implement THR register dmukhin
2026-11-11 19:47 ` [PATCH v8 12/26] emul/ns16x50: implement FCR register (write-only) dmukhin
2026-11-11 19:47 ` [PATCH v8 13/26] emul/ns16550: implement dump_state() hook dmukhin
2026-11-11 19:47 ` [PATCH v8 14/26] emul/vuart: add global UART emulator configuration knob dmukhin
2026-11-11 19:47 ` [PATCH v8 15/26] emul/ns16x50: enable emulator dmukhin
2026-11-11 19:47 ` [PATCH v8 16/26] emul/ns16x50: add Kconfig options dmukhin
2026-11-11 19:47 ` [PATCH v8 17/26] x86/domain: enable per-domain I/O port bitmaps dmukhin
2026-11-11 19:47 ` [PATCH v8 18/26] emul/ns16x50: resolve physical I/O port sharing dmukhin
2026-11-11 19:47 ` [PATCH v8 19/26] xen/domain: allocate d->irq_caps before arch-specific initialization dmukhin
2026-11-11 19:47 ` [PATCH v8 20/26] emul/ns16x50: resolve physical IRQ sharing dmukhin
2026-11-11 19:47 ` [PATCH v8 21/26] emul/ns16x50: implement IRQ emulation via vIOAPIC dmukhin
2026-11-11 19:47 ` [PATCH v8 22/26] MAINTAINERS: add myself as vUART framework maintainer dmukhin
2026-11-11 19:47 ` [PATCH v8 23/26] docs/fusa: add NS16x50 UART requirements for x86 dmukhin
2026-11-11 19:47 ` [PATCH v8 24/26] ci: add initial NS16550-compatible XTF test dmukhin
2026-11-11 19:47 ` [PATCH v8 25/26] ci: add smoke NS16550-compatible PVH Linux test dmukhin
2026-11-11 19:48 ` [PATCH v8 26/26] ci: do not merge: test dmukhin
2026-11-12 14:53 ` Oleksii Kurochko [this message]

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=30050658-04ce-4ab3-ac6e-bb3f517d5ded@gmail.com \
    --to=oleksii.kurochko@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dmukhin@ford.com \
    --cc=dmukhin@xen.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xakep.amatop@gmail.com \
    --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.