]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm: Alloc dummy async #PF token outside of raw spinlock
authorSean Christopherson <seanjc@google.com>
Thu, 19 May 2022 14:57:11 +0000 (07:57 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 May 2022 09:12:34 +0000 (05:12 -0400)
commite0d50520ece8f8a0c6acc9fbdda16e9094896a83
treede982b2497750eadb1712b450b42de53c0cb30a3
parent7bdcc473d7de4185bbc97f38bd40c572a91b8370
x86/kvm: Alloc dummy async #PF token outside of raw spinlock

Drop the raw spinlock in kvm_async_pf_task_wake() before allocating the
the dummy async #PF token, the allocator is preemptible on PREEMPT_RT
kernels and must not be called from truly atomic contexts.

Opportunistically document why it's ok to loop on allocation failure,
i.e. why the function won't get stuck in an infinite loop.

Reported-by: Yajun Deng <yajun.deng@linux.dev>
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvm.c