You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
Some platforms expose UART (and other device) MMIO regions that are not page aligned. For example, as noted in #181, all Raspberry Pi 4 UARTs except UART0 are misaligned. The PR proposes a platform-defined offset to make these regions mappable, but that approach is platform-specific and not very portable.
Allowing non-aligned device mappings is feasible at the hypervisor level, but the memory subsystem will necessarily perform the mapping with a page-aligned allocation that extends outside the requested device region.
While the hypervisor itself can tolerate this, it becomes a correctness and safety issue for device regions provided via the config: we must not silently map beyond what the config declares.
Proposed direction
Update device mapping functions to allow misaligned device regions: round to page boundaries internally, but return only the requested subrange (i.e., the misaligned memory region base address).
Add config validation that enforces page alignment for device regions declared in the config (or alternatively, reject/flag misaligned entries with a clear error). This prevents accidental over-mapping.
Tasks
Support non–page-aligned device mappings in the hypervisor
Round start down / end up to page boundaries for the actual mapping.
Ensure unmap logic respects the original requested subrange.
Validate config device regions are page aligned
On config load/parse, check that each device MMIO region’s base and size are page aligned.
If not aligned, fail with an error message (include offending region and required alignment).
Summary
Some platforms expose UART (and other device) MMIO regions that are not page aligned. For example, as noted in #181, all Raspberry Pi 4 UARTs except UART0 are misaligned. The PR proposes a platform-defined offset to make these regions mappable, but that approach is platform-specific and not very portable.
Problem
Proposed direction
config(or alternatively, reject/flag misaligned entries with a clear error). This prevents accidental over-mapping.Tasks
Support non–page-aligned device mappings in the hypervisor
Validate config device regions are page aligned