Skip to content

RFC kvm/x86: more huge page recovery fallout

Keith Busch kvm lkml virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vhost: return error instead of NULL on createarch/x86/kvm/mmu/mmu.c drivers/vhost/vhost.c kernel/vhost_task.c+4 -40 replies
2/2kvm: retry nx_huge_page_recovery_thread creationarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/x86.c+11 -172 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/2] kvm/x86: more huge page recovery fallout

From: Keith Busch <[email protected]>

Another corner case on the KVM vhost task!

The crosvm VMM might send signals to its threads that have entered KVM_RUN. The signal specifically is SIGRTRMIN from here:

https://github.com/google/crosvm/blob/main/src/crosvm/sys/linux/vcpu.rs#L651

If this happens to occur when the huge page recovery is trying to create its vhost task, that will fail with ERESTARTNOINTR. Once this happens, all KVM_RUN calls will fail with ENOMEM despite memory not being the problem.

This series propogates the error up so we can distinguish that from the current defaulting to ENOMEM and replaces the call_once since we need to be able to call it repeatedly due to this condition.

Keith Busch (2):
vhost: return error instead of NULL on create
kvm: retry nx_huge_page_recovery_thread creation

 arch/x86/include/asm/kvm_host.h |  3 +--
 arch/x86/kvm/mmu/mmu.c          | 25 ++++++++++---------------
 arch/x86/kvm/x86.c              |  2 +-
 drivers/vhost/vhost.c           |  2 +-
 kernel/vhost_task.c             |  4 ++--
 5 files changed, 15 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.5