Page MenuHomeFreeBSD

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

Authored by kajetan.puchalski_arm.com on Apr 21 2026, 11:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 9, 12:45 PM
Unknown Object (File)
Thu, Jul 9, 4:53 AM
Unknown Object (File)
Wed, Jul 8, 12:50 AM
Unknown Object (File)
Tue, Jul 7, 1:45 AM
Unknown Object (File)
Mon, Jul 6, 8:52 PM
Unknown Object (File)
Mon, Jul 6, 2:43 PM
Unknown Object (File)
Mon, Jul 6, 1:02 PM
Unknown Object (File)
Sun, Jul 5, 10:26 PM
Subscribers

Details

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 72508
Build 69391: 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.

Only separate out registers relevant for morello

This revision is now accepted and ready to land.Tue, Jun 30, 2:53 PM