Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: Convert HPFAR_EL2 to sysreg table

Switch over to the typical sysreg table for HPFAR_EL2 as we're about to
start using more fields in the register.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250402201725.2963645-3-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>

+11 -2
+3 -1
arch/arm64/include/asm/kvm_emulate.h
··· 305 305 306 306 static __always_inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu) 307 307 { 308 - return ((phys_addr_t)vcpu->arch.fault.hpfar_el2 & HPFAR_MASK) << 8; 308 + u64 hpfar = vcpu->arch.fault.hpfar_el2; 309 + 310 + return FIELD_GET(HPFAR_EL2_FIPA, hpfar) << 12; 309 311 } 310 312 311 313 static inline u64 kvm_vcpu_get_disr(const struct kvm_vcpu *vcpu)
+1 -1
arch/arm64/kvm/hyp/nvhe/mem_protect.c
··· 578 578 return; 579 579 } 580 580 581 - addr = (fault.hpfar_el2 & HPFAR_MASK) << 8; 581 + addr = FIELD_GET(HPFAR_EL2_FIPA, fault.hpfar_el2) << 12; 582 582 ret = host_stage2_idmap(addr); 583 583 BUG_ON(ret && ret != -EAGAIN); 584 584 }
+7
arch/arm64/tools/sysreg
··· 3433 3433 Field 4 P 3434 3434 Field 3:0 Align 3435 3435 EndSysreg 3436 + 3437 + Sysreg HPFAR_EL2 3 4 6 0 4 3438 + Field 63 NS 3439 + Res0 62:48 3440 + Field 47:4 FIPA 3441 + Res0 3:0 3442 + EndSysreg