KVM: arm/arm64: Introduce vcpu_el1_is_32bit
We have numerous checks around that checks if the HCR_EL2 has the RW bit set to figure out if we're running an AArch64 or AArch32 VM. In some cases, directly checking the RW bit (given its unintuitive name), is a bit confusing, and that's not going to improve as we move logic around for the following patches that optimize KVM on AArch64 hosts with VHE. Therefore, introduce a helper, vcpu_el1_is_32bit, and replace existing direct checks of HCR_EL2.RW with the helper. Reviewed-by:Julien Grall <julien.grall@arm.com> Reviewed-by:
Julien Thierry <julien.thierry@arm.com> Acked-by:
Marc Zyngier <marc.zyngier@arm.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by:
Marc Zyngier <marc.zyngier@arm.com>
Showing
- arch/arm64/include/asm/kvm_emulate.h 6 additions, 1 deletionarch/arm64/include/asm/kvm_emulate.h
- arch/arm64/kvm/hyp/switch.c 5 additions, 6 deletionsarch/arm64/kvm/hyp/switch.c
- arch/arm64/kvm/hyp/sysreg-sr.c 3 additions, 2 deletionsarch/arm64/kvm/hyp/sysreg-sr.c
- arch/arm64/kvm/inject_fault.c 3 additions, 3 deletionsarch/arm64/kvm/inject_fault.c
Please register or sign in to comment