Page MenuHomeFreeBSD

arm64/vmm: Store non-VNCR registers in an array
Needs ReviewPublic

Authored by kajetan.puchalski_arm.com on Apr 21 2026, 11:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 26, 9:50 PM
Unknown Object (File)
Fri, Jun 26, 10:07 AM
Unknown Object (File)
Fri, Jun 26, 6:17 AM
Unknown Object (File)
Thu, Jun 25, 3:50 PM
Unknown Object (File)
Thu, Jun 25, 11:11 AM
Unknown Object (File)
Thu, Jun 25, 10:20 AM
Unknown Object (File)
Wed, Jun 24, 7:09 AM
Unknown Object (File)
Tue, Jun 23, 6:37 PM
Subscribers

Details

Reviewers
andrew
manu
Group Reviewers
arm64
Summary

Move non-VNCR EL0 and EL1 registers into a dedicated array inside of
hypctx. This enables uniform accesses to both VNCR and non-VNCR guest
register state through hypctx_[read|write]_sys_reg().

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72476
Build 69359: arc lint + arc unit

Event Timeline

Update with changes to other commits in the stack

Encode VNCR values into enum hypctx_sysreg as 64-bit offsets

Handle non-VHE, store the vncr page as a pointer

Address remaining style review comments

Use Static_assert to ensure correct struct hypctx size

It looks like a few lines passed 80 characters so will need to be split.

sys/arm64/vmm/vmm_hyp.c
123

Did this line pass 80 characters?

127

Why is an extra tab added here? (and other similar places below)

sys/arm64/vmm/vmm_hyp.c
123–124

The second line should be indented the to the same number of tabs + 4 spaces (and below)

sys/arm64/vmm/arm64.h
63–66

These should be in a separate array so the type can be change for Morello

Put potentially exotic registers in a separate array

sys/arm64/vmm/arm64.h
194–202

This is confusing two things, one is registers holding a virtual address that will be larger with Morello, the other is physical address registers that will be larger with FEAT_D128.

PAR_EL1 is the only physical address register in this list, so could be removed from here & the range renamed something like VA_REGS.