KVM: arm64: Use the in-context stage-1 in __kvm_find_s1_desc_level()
PATCH 1/1 KVM: arm64: Use the in-context stage-1 in __kvm_find_s1_desc_level()
Running the external_aborts selftest at EL2 leads to an ugly splat due to the stage-1 MMU being disabled for the walked context, owing to the fact that __kvm_find_s1_desc_level() is hardcoded to the EL1&0 regime.
Select the appropriate translation regime for the stage-1 walk based on the current vCPU context.
--- arch/arm64/kvm/at.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm64/kvm/at.c +5 -1
@@ -1602,13 +1602,17 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa, int *level) .fn = match_s1_desc, .priv = &dm, }, - .regime = TR_EL10, .as_el0 = false, .pan = false, };struct s1_walk_result wr = {};int ret; +if (is_hyp_ctxt (vcpu)) + wi.regime =vcpu_el2_e2h_is_set (vcpu) ?TR_EL20 :TR_EL2 ; +else + wi.regime =TR_EL10 ; + ret =setup_s1_walk (vcpu, &wi, &wr, va);if (ret)return ret;
base-commit: 10fd0285305d0b48e8a3bf15d4f17fc4f3d68cb6
Signature · 1 line
2.47.3
Quoted 8 lines · Oliver Upton
Running the
external_abortsselftest at EL2 leads to an ugly splat due to the stage-1 MMU being disabled for the walked context, owing to the fact that__kvm_find_s1_desc_level()is hardcoded to the EL1&0 regime.Select the appropriate translation regime for the stage-1 walk based on the current vCPU context.
[...]
Applied to fixes, thanks!
[1/1] KVM: arm64: Use the in-context stage-1 in __kvm_find_s1_desc_level()
commit: fcaa3f59fda3579ee77127abbc58896c67c36cab
Cheers,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.