mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC 0/2] kvm/x86: more huge page recovery fallout
@ 2025-02-26  2:42 Keith Busch
  0 siblings, 0 replies; only message in thread
From: Keith Busch @ 2025-02-26  2:42 UTC (permalink / raw)
  To: pbonzini, seanjc, kvm; +Cc: x86, virtualization, linux-kernel, Keith Busch

From: Keith Busch <kbusch@kernel.org>

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(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-26  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-26  2:42 [RFC 0/2] kvm/x86: more huge page recovery fallout Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®