Skip to content

KVM: arm64: Fix sleeping while atomic BUG() on OOM

Will Deacon kvm kvmarm lkml stable 1 version Applied

Status from this message: Applied to kvm-arm64/pt-rework-base, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: Pass MMU notifier range flags to kvm_unmap_hva_range()arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/mmu.c arch/mips/include/asm/kvm_host.h +7 more+17 -102 replies
2/2KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not setarch/arm64/kvm/mmu.c+13 -41 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchSuzuki K Poulose
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: arm64: Fix sleeping while atomic BUG() on OOM

Hi all,

While stress-testing my arm64 stage-2 page-table rewrite [1], I ran into a sleeping while atomic BUG() during OOM that I can reproduce with mainline.

The problem is that the arm64 page-table code periodically calls cond_resched_lock() when unmapping the stage-2 page-tables, but in the case of OOM, this occurs in atomic context.

These couple of patches (based on 5.8) propagate the flags from the MMU notifier range structure, which in turn indicate whether or not blocking is permitted.

Cheers,

Will

[1] https://android-kvm.googlesource.com/linux/+/refs/heads/topic/pgtable

Cc Marc Zyngier <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc James Morse <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Sean Christopherson <[email protected]>

--->8

Will Deacon (2):
KVM: Pass MMU notifier range flags to kvm_unmap_hva_range()
KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set

 arch/arm64/include/asm/kvm_host.h   |  2 +-
 arch/arm64/kvm/mmu.c                | 19 ++++++++++++++-----
 arch/mips/include/asm/kvm_host.h    |  2 +-
 arch/mips/kvm/mmu.c                 |  3 ++-
 arch/powerpc/include/asm/kvm_host.h |  3 ++-
 arch/powerpc/kvm/book3s.c           |  3 ++-
 arch/powerpc/kvm/e500_mmu_host.c    |  3 ++-
 arch/x86/include/asm/kvm_host.h     |  3 ++-
 arch/x86/kvm/mmu/mmu.c              |  3 ++-
 virt/kvm/kvm_main.c                 |  3 ++-
 10 files changed, 30 insertions(+), 14 deletions(-)
Signature · 1 line
2.28.0.236.gb10cc79966-goog