Skip to content

Commit fc670ad

Browse files
committed
Revert "KVM: arm64: Reschedule as needed when destroying the stage-2 page-tables"
This reverts commit e9abe31. syzkaller has managed to tease out multiple bugs in this change and fixing-forward didn't remedy the situation. Considering newly-introduced memory safety issues the potential for scheduler stalls don't seem that bad in comparison Link: https://lore.kernel.org/kvmarm/[email protected]/ Message-ID: <[email protected]> Signed-off-by: Oliver Upton <[email protected]>
1 parent c04f174 commit fc670ad

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

arch/arm64/kvm/mmu.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -904,35 +904,11 @@ static int kvm_init_ipa_range(struct kvm_s2_mmu *mmu, unsigned long type)
904904
return 0;
905905
}
906906

907-
/*
908-
* Assume that @pgt is valid and unlinked from the KVM MMU to free the
909-
* page-table without taking the kvm_mmu_lock and without performing any
910-
* TLB invalidations.
911-
*
912-
* Also, the range of addresses can be large enough to cause need_resched
913-
* warnings, for instance on CONFIG_PREEMPT_NONE kernels. Hence, invoke
914-
* cond_resched() periodically to prevent hogging the CPU for a long time
915-
* and schedule something else, if required.
916-
*/
917-
static void stage2_destroy_range(struct kvm_pgtable *pgt, phys_addr_t addr,
918-
phys_addr_t end)
919-
{
920-
u64 next;
921-
922-
do {
923-
next = stage2_range_addr_end(addr, end);
924-
KVM_PGT_FN(kvm_pgtable_stage2_destroy_range)(pgt, addr,
925-
next - addr);
926-
if (next != end)
927-
cond_resched();
928-
} while (addr = next, addr != end);
929-
}
930-
931907
static void kvm_stage2_destroy(struct kvm_pgtable *pgt)
932908
{
933909
unsigned int ia_bits = VTCR_EL2_IPA(pgt->mmu->vtcr);
934910

935-
stage2_destroy_range(pgt, 0, BIT(ia_bits));
911+
KVM_PGT_FN(kvm_pgtable_stage2_destroy_range)(pgt, 0, BIT(ia_bits));
936912
KVM_PGT_FN(kvm_pgtable_stage2_destroy_pgd)(pgt);
937913
}
938914

0 commit comments

Comments
 (0)