[PATCH v5 2/8] KVM: arm64: Make vcpu_{read,write}_sys_reg available to HYP code

Marc Zyngier maz at kernel.org
Tue Jul 14 08:19:30 PDT 2026


On Tue, 14 Jul 2026 11:15:55 +0100,
Fuad Tabba <fuad.tabba at linux.dev> wrote:
> 
> 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.

	m.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list