Page MenuHomeFreeBSD

arm64/vmm: Make remaining registers use hypctx_*_sys_reg
ClosedPublic

Authored by kajetan.puchalski_arm.com on Apr 21 2026, 11:09 AM.
Tags
None
Referenced Files
F167878845: D56556.id175979.diff
Tue, Aug 25, 5:11 AM
F167877582: D56556.id180378.diff
Tue, Aug 25, 4:57 AM
F167865122: D56556.id179466.diff
Tue, Aug 25, 2:30 AM
F167860642: D56556.id.diff
Tue, Aug 25, 1:45 AM
F167852202: D56556.id176278.diff
Tue, Aug 25, 12:31 AM
F167849361: D56556.id178197.diff
Tue, Aug 25, 12:02 AM
F167846859: D56556.id179463.diff
Mon, Aug 24, 11:34 PM
F167843758: D56556.id176256.diff
Mon, Aug 24, 10:59 PM
Subscribers

Details

Summary

Move vgic, timer and trapframe registers into sys_regs to handle them
in the same way as all the other registers.

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 73282
Build 70165: arc lint + arc unit

Event Timeline

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

sys/arm64/vmm/hyp.h
113–115 ↗(On Diff #177461)

We should create and use hyp_genassym.c if we need access to the enum from assembly.

sys/arm64/vmm/arm64.h
65–71

We might need to think about these to not break CHERI

87

Extra whitespace change

kajetan.puchalski_arm.com added inline comments.
sys/arm64/vmm/arm64.h
65–71

Should I just put these in a separate array as part of this patch then?

Put potentially exotic registers in a separate array

Only separate out registers relevant for morello

sys/arm64/vmm/vmm_hyp_exception.S
90–105

It should be the x0 offset + 2 8 byte registers (and the same below). It will work when HYPCTX_GPR_X0 == 0, but if we ever move it for some reason it won't.

Canged hyp_genassym to generate offsets instead of indices into the array for clarity

This revision is now accepted and ready to land.Jul 3 2026, 2:11 PM