2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/arch/x86/kvm/mmu
Keith Busch 916b7f42b3 kvm: retry nx_huge_page_recovery_thread creation
A VMM may send a non-fatal signal to its threads, including vCPU tasks,
at any time, and thus may signal vCPU tasks during KVM_RUN.  If a vCPU
task receives the signal while its trying to spawn the huge page recovery
vhost task, then KVM_RUN will fail due to copy_process() returning
-ERESTARTNOINTR.

Rework call_once() to mark the call complete if and only if the called
function succeeds, and plumb the function's true error code back to the
call_once() invoker.  This provides userspace with the correct, non-fatal
error code so that the VMM doesn't terminate the VM on -ENOMEM, and allows
subsequent KVM_RUN a succeed by virtue of retrying creation of the NX huge
page task.

Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
[implemented the kvm user side]
Signed-off-by: Keith Busch <kbusch@kernel.org>
Message-ID: <20250227230631.303431-3-kbusch@meta.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-03-01 02:54:18 -05:00
..
mmu_internal.h Merge branch 'kvm-mirror-page-tables' into HEAD 2025-01-20 07:15:58 -05:00
mmu.c kvm: retry nx_huge_page_recovery_thread creation 2025-03-01 02:54:18 -05:00
mmutrace.h KVM: x86/mmu: Trigger unprotect logic only on write-protection page faults 2024-09-09 20:16:19 -07:00
page_track.c KVM: Use vfree for memory allocated by vcalloc()/__vcalloc() 2024-04-09 12:18:38 -07:00
page_track.h KVM: x86/mmu: Drop @slot param from exported/external page-track APIs 2023-08-31 14:08:18 -04:00
paging_tmpl.h KVM: x86/mmu: Mark pages/folios dirty at the origin of make_spte() 2024-10-25 12:59:08 -04:00
spte.c KVM: x86/mmu: Rename make_huge_page_split_spte() to make_small_spte() 2024-11-04 18:37:23 -08:00
spte.h KVM: x86/mmu: Add an is_mirror member for union kvm_mmu_page_role 2024-12-23 08:29:45 -05:00
tdp_iter.c KVM: x86/mmu: Support GFN direct bits 2024-12-23 08:31:54 -05:00
tdp_iter.h KVM: x86/mmu: Support GFN direct bits 2024-12-23 08:31:54 -05:00
tdp_mmu.c KVM: x86/tdp_mmu: Don't zap valid mirror roots in kvm_tdp_mmu_zap_all() 2024-12-23 08:31:55 -05:00
tdp_mmu.h KVM: x86/tdp_mmu: Take root types for kvm_tdp_mmu_invalidate_all_roots() 2024-12-23 08:31:54 -05:00