Page MenuHomeFreeBSD

arm64: VM/PMAP changes for CCA guest support
ClosedPublic

Authored by sarah.walker2_arm.com on Apr 23 2026, 10:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 11, 6:34 AM
Unknown Object (File)
Fri, Sep 11, 4:52 AM
Unknown Object (File)
Thu, Sep 10, 5:28 PM
Unknown Object (File)
Tue, Sep 8, 3:06 PM
Unknown Object (File)
Tue, Sep 8, 1:31 PM
Unknown Object (File)
Mon, Sep 7, 9:53 PM
Unknown Object (File)
Mon, Sep 7, 3:01 AM
Unknown Object (File)
Sun, Sep 6, 4:30 PM
Subscribers

Details

Summary

When in a realm:

  • Mappings with mode VM_MEMATTR_DEVICE and VM_MEMATTR_DEVICE_NP are unprotected
  • Imported busdma buffers in protected memory are always bounced
  • If EARLY_PRINTK is in use, the UART physical address must be in the unprotected address space

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew added inline comments.
sys/arm64/arm64/efirt_machdep.c
233

Needs to be on pa not page table entry

sys/arm64/arm64/pmap.c
4237
5454–5455

This should be applied to pa as it may be wrong under FEAT_LPA2

5774

Is this correct when entering a large page, e.g. when psind == 2 a level 2 block will be created

This revision is now accepted and ready to land.May 5 2026, 2:02 PM
This revision was automatically updated to reflect the committed changes.

I recently updated my Microsoft Dev Kit, and because of this change I'm seeing:

bus_dmamem_alloc failed to align memory properly.

The warning stems from an allocation by the nvme driver:

KDB: stack backtrace:
db_trace_self() at db_trace_self
db_trace_self_wrapper() at db_trace_self_wrapper+0x44
bounce_bus_dmamem_alloc() at bounce_bus_dmamem_alloc+0x258
nvme_ctrlr_start() at nvme_ctrlr_start+0xbc8
nvme_ctrlr_start_config_hook() at nvme_ctrlr_start_config_hook+0x5ec
run_interrupt_driven_config_hooks() at run_interrupt_driven_config_hooks+0x94
boot_run_interrupt_driven_config_hooks() at boot_run_interrupt_driven_config_hooks+0x30
mi_startup() at mi_startup+0x1ec
virtdone() at virtdone+0x70

An added printf reports:

vaddr: 0xffffa000847d3f40, paddr: 1047d3f40, alignment: 1000

In this case, the misalignment appears to be harmless because page size alignment isn't actually needed.

In D56599#1364175, @alc wrote:

I recently updated my Microsoft Dev Kit, and because of this change I'm seeing:

bus_dmamem_alloc failed to align memory properly.

Could you test https://reviews.freebsd.org/D59476 please?