Skip to content

plat/xen, drivers/pl011: Fix PL011 UART mapping on Xen/arm64 - #1885

Open
kang-yoongu wants to merge 2 commits into
unikraft:stagingfrom
kang-yoongu:pl011-xen-fixmap
Open

plat/xen, drivers/pl011: Fix PL011 UART mapping on Xen/arm64#1885
kang-yoongu wants to merge 2 commits into
unikraft:stagingfrom
kang-yoongu:pl011-xen-fixmap

Conversation

@kang-yoongu

@kang-yoongu kang-yoongu commented Aug 13, 2026

Copy link
Copy Markdown

On Xen/ARM64 dom0less boot, the unikernel crashes immediately with repeated data abort traps before any console output appears.

Root causes:

  • In dom0less environment, HYPERVISOR_start_info is not initialized (remains 0x0). The xenconsole driver attempts to write pointer derived from start_info, which is NULL, triggering a data abort trap on every uk_pr_* / printk call.

  • The PL011 UART driver uses the physical/IPA address from the FDT reg property directly as a virtual address (dev->base = reg_base). Under Xen, guest IPA is not identity-mapped to VA, so UART register accesses hit an incorrect virtual address.

Description of Changes

This series fixes PL011 UART initialization on Xen/arm64 dom0less guests.

On Xen, IPA cannot be used directly as a VA. The PL011 driver was using reg_base (IPA) directly as dev->base, causing a fault when accessing UART MMIO.

Patch 1 adds arm,sbsa-uart to the compatible string list so the PL011 driver can match the virtual PL011 node inserted by Xen in the guest DTB.

Patch 2 maps the UART MMIO through the fixmap page table when running on Xen, consistent with how other devices are mapped

Related Work

Issue : #1882

PR Checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Xen inserts "arm,sbsa-uart" as the compatible string for the vpl011
node in the guest DTB. Add it to the fdt_compatible list so the
PL011 driver can match the device on Xen dom0less guests.

Signed-off-by: Peter Kang <peter.kang@boeing.com>
Signed-off-by: Anderson Choi <anderson.choi@boeing.com>
On Xen, IPA cannot be used directly as a VA. Add FIX_PL011 fixmap
region in xen-arm/mm.h and use set_pgt_entry() in the PL011 driver
to map the UART MMIO address through the fixmap page table when
running on Xen. This avoids direct use of physical address as VA.

- Add FIX_PL011_TOP/START to fixmap layout in xen-arm/mm.h
- Add FIXMAP_ENTRIES macro (PAGE_SIZE / sizeof(lpae_t))
- Move extern fixmap_pgtable declaration into mm.h
- Use set_pgt_entry() API (includes dsb ishst + isb) instead of
  direct assignment, consistent with other fixmap users in setup64.c

Signed-off-by: Peter Kang <peter.kang@boeing.com>
Signed-off-by: Anderson Choi <anderson.choi@boeing.com>
@github-actions github-actions Bot added area/plat Unikraft Patform lang/c Issues or PRs to do with C/C++ plat/xen Unikraft for Xen labels Aug 13, 2026
@michpappas
michpappas self-requested a review August 13, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/plat Unikraft Patform lang/c Issues or PRs to do with C/C++ plat/xen Unikraft for Xen

Projects

Status: 🧊 Icebox

Development

Successfully merging this pull request may close these issues.

1 participant