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
Unknown Object (File)
Thu, Jul 16, 3:59 AM
Unknown Object (File)
Wed, Jul 15, 7:19 AM
Unknown Object (File)
Wed, Jul 15, 7:18 AM
Unknown Object (File)
Mon, Jul 13, 11:36 PM
Unknown Object (File)
Mon, Jul 13, 5:40 PM
Unknown Object (File)
Sun, Jul 12, 5:30 PM
Unknown Object (File)
Sun, Jul 12, 12:51 PM
Unknown Object (File)
Sat, Jul 11, 5:45 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 73280
Build 70163: 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

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

88

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
89–104

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.Fri, Jul 3, 2:11 PM