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
F163878293: D56552.id176097.diff
Sun, Jul 26, 7:58 PM
Unknown Object (File)
Sun, Jul 26, 10:55 AM
Unknown Object (File)
Fri, Jul 24, 11:43 PM
Unknown Object (File)
Thu, Jul 23, 11:15 AM
Unknown Object (File)
Mon, Jul 20, 9:29 AM
Unknown Object (File)
Mon, Jul 20, 8:45 AM
Unknown Object (File)
Sun, Jul 19, 6:30 PM
Unknown Object (File)
Sat, Jul 18, 6:22 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 Not Applicable
Unit
Tests Not Applicable

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–124

Did this line pass 80 characters?

127–128

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

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

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
187–195

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