Skip to content

Commit a46c09b

Browse files
ouptonMarc Zyngier
authored andcommitted
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. Fixes: b8e6251 ("KVM: arm64: Add S1 IPA to page table level walker") Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 9a1950f commit a46c09b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm64/kvm/at.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,13 +1602,17 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa, int *level)
16021602
.fn = match_s1_desc,
16031603
.priv = &dm,
16041604
},
1605-
.regime = TR_EL10,
16061605
.as_el0 = false,
16071606
.pan = false,
16081607
};
16091608
struct s1_walk_result wr = {};
16101609
int ret;
16111610

1611+
if (is_hyp_ctxt(vcpu))
1612+
wi.regime = vcpu_el2_e2h_is_set(vcpu) ? TR_EL20 : TR_EL2;
1613+
else
1614+
wi.regime = TR_EL10;
1615+
16121616
ret = setup_s1_walk(vcpu, &wi, &wr, va);
16131617
if (ret)
16141618
return ret;

0 commit comments

Comments
 (0)