On Tue, 14 Jul 2026 at 16:19, Marc Zyngier [off-list ref] wrote:
On Tue, 14 Jul 2026 11:15:55 +0100,
Fuad Tabba [off-list ref] wrote:
quoted
The vcpu_{read,write}_sys_reg() accessors are only valid on a VHE host,
so helpers built on them such as kvm_vcpu_set_be()/kvm_vcpu_is_be()
cannot be shared with hyp code. exception.c already wraps them in local
helpers that pick the host- or hyp-side accessor via has_vhe().
Rename the host-only implementations to __vcpu_{read,write}_sysreg_vhe()
I'm a bit puzzled by this. There is nothing that makes these functions
VHE-specific. Look at where they are called from: plenty of non-VHE
uses. These helpers are the canonical accessors for any system
register, and they don't cater for any particular mode.
I might have misunderstood what Oliver asked me to do here [1]:
Can you instead name the wrappers vcpu_{read,write}_sys_reg() and rename
the current implementations, like __vcpu_{read,write}_sysreg_vhe()?
Since they're only used and gated by has_vhe(), they're vhe-specific?
Cheers,
/fuad
[1] https://lore.kernel.org/all/alWDI7uj9YFedXET@kernel.org/ (local)
m.
--
Without deviation from the norm, progress is not possible.