KVM: Async #PF fixes and cleanups
Status from this message: Applied to kvm-x86 asyncpf, with comment tweaks as per Vitaly. Thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | KVM: Always flush async #PF workqueue when vCPU is being destroyedvirt/ | +32 | 10 replies | |
| 2/4 | KVM: Put mm immediately after async #PF worker completes remote gup()virt/ | +1 | 2 replies | |
| 3/4 | KVM: Get reference to VM's address space in the async #PF workerinclude/ virt/ | +18 | 5 replies | |
| 4/4 | KVM: Nullify async #PF worker's "apf" pointer as soon as it might be freedvirt/ | +6 | 2 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Xu Yilun | Vitaly Kuznetsov |
|---|---|---|
| 1/4 | R-b | |
| 2/4 | R-b | R-b |
| 3/4 | R-b | R-b |
| 4/4 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] KVM: Async #PF fixes and cleanups
Fix a use-after-module-unload bug in the async #PF code by ensuring all workqueue items fully complete before tearing down vCPUs. Do a bit of cleanup to try and make the code slightly more readable.
Side topic, I'm pretty s390's flic_set_attr() is broken/racy. The async #PF code assumes that only the vCPU can invoke kvm_clear_async_pf_completion_queue(), as there are multiple assets that are effectively protected by vcpu->mutex. I don't any real world VMMs trigger the race(s), but AFAICT it's a bug. I think/assume taking all vCPUs' mutexes would plug the hole?
Sean Christopherson (4):
KVM: Always flush async #PF workqueue when vCPU is being destroyed
KVM: Put mm immediately after async #PF worker completes remote gup()
KVM: Get reference to VM's address space in the async #PF worker
KVM: Nullify async #PF worker's "apf" pointer as soon as it might be
freed
include/linux/kvm_host.h | 1 - virt/kvm/async_pf.c | 79 ++++++++++++++++++++++++++++------------ 2 files changed, 55 insertions(+), 25 deletions(-)
base-commit: 1c6d984f523f67ecfad1083bb04c55d91977bb15
Signature · 1 line
2.43.0.472.g3155946c3a-goog