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
F169815550: D56552.id176252.diff
Wed, Sep 2, 3:47 PM
F169719111: D56552.id175975.diff
Wed, Sep 2, 9:13 AM
F169636160: D56552.id176316.diff
Wed, Sep 2, 3:28 AM
F169630641: D56552.id180374.diff
Wed, Sep 2, 3:09 AM
F169623386: D56552.id179454.diff
Wed, Sep 2, 2:34 AM
F169623085: D56552.id181360.diff
Wed, Sep 2, 2:33 AM
F169608732: D56552.id180981.diff
Wed, Sep 2, 1:32 AM
F169608679: D56552.id176097.diff
Wed, Sep 2, 1:32 AM
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 72436
Build 69319: 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.Jun 30 2026, 2:53 PM