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
F172852968: D56556.id180985.diff
Mon, Sep 21, 2:39 PM
F172824681: D56556.id180378.diff
Mon, Sep 21, 8:13 AM
F172784059: D56556.id181365.diff
Sun, Sep 20, 11:29 PM
Unknown Object (File)
Sat, Sep 19, 9:47 PM
Unknown Object (File)
Sat, Sep 19, 3:01 PM
Unknown Object (File)
Wed, Sep 16, 7:21 PM
Unknown Object (File)
Wed, Sep 16, 8:55 AM
Unknown Object (File)
Wed, Sep 16, 2:51 AM
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 72474
Build 69357: 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

89

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