Message ID | 20241010182427.1434605-1-seanjc@google.com |
---|---|
Headers | show |
Series | KVM: Stop grabbing references to PFNMAP'd pages | expand |
On Thu, Oct 10, 2024 at 8:24 PM Sean Christopherson <seanjc@google.com> wrote: > v13: > - Rebased onto v6.12-rc2 > - Collect reviews. [Alex and others] > - Fix a transient bug in arm64 and RISC-V where KVM would leak a page > refcount. [Oliver] > - Fix a dangling comment. [Alex] > - Drop kvm_lookup_pfn(), as the x86 that "needed" it was stupid and is (was?) > eliminated in v6.12. > - Drop check_user_page_hwpoison(). [Paolo] > - Drop the arm64 MTE fixes that went into 6.12. > - Slightly redo the guest_memfd interaction to account for 6.12 changes. Here is my own summary of the changes: patches removed from v12: 01/02 - already upstream 09 - moved to separate A/D series [1] 34 - not needed due to new patch 36 35 - gone after 620525739521376a65a690df899e1596d56791f8 patches added or substantially changed in v13: 05/06/07 - new, suggested by Yan Zhao 08 - code was folded from mmu_spte_age into kvm_rmap_age_gfn_range 14 - new, suggested by me in reply to 84/84 (yuck) 15 - new, suggested by me in reply to 84/84 19 - somewhat rewritten for new follow_pfnmap API 27 - smaller changes due to new follow_pfnmap API 36 - rewritten, suggested by me 45 - new, cleanup 46 - much simplified due to new patch 45 Looks good to me, thanks and congratulations!! Should we merge it in kvm/next asap? Paolo [1] https://patchew.org/linux/20241011021051.1557902-1-seanjc@google.com/20241011021051.1557902-5-seanjc@google.com/
On Thu, Oct 17, 2024, Paolo Bonzini wrote: > On Thu, Oct 10, 2024 at 8:24 PM Sean Christopherson <seanjc@google.com> wrote: > > v13: > > - Rebased onto v6.12-rc2 > > - Collect reviews. [Alex and others] > > - Fix a transient bug in arm64 and RISC-V where KVM would leak a page > > refcount. [Oliver] > > - Fix a dangling comment. [Alex] > > - Drop kvm_lookup_pfn(), as the x86 that "needed" it was stupid and is (was?) > > eliminated in v6.12. > > - Drop check_user_page_hwpoison(). [Paolo] > > - Drop the arm64 MTE fixes that went into 6.12. > > - Slightly redo the guest_memfd interaction to account for 6.12 changes. > > Here is my own summary of the changes: Yep, looks right to me. > patches removed from v12: > 01/02 - already upstream > 09 - moved to separate A/D series [1] > 34 - not needed due to new patch 36 > 35 - gone after 620525739521376a65a690df899e1596d56791f8 > > patches added or substantially changed in v13: > 05/06/07 - new, suggested by Yan Zhao > 08 - code was folded from mmu_spte_age into kvm_rmap_age_gfn_range > 14 - new, suggested by me in reply to 84/84 (yuck) > 15 - new, suggested by me in reply to 84/84 > 19 - somewhat rewritten for new follow_pfnmap API > 27 - smaller changes due to new follow_pfnmap API > 36 - rewritten, suggested by me > 45 - new, cleanup > 46 - much simplified due to new patch 45 > > Looks good to me, thanks and congratulations!! Should we merge it in > kvm/next asap? That has my vote, though I'm obvious extremely biased :-)
On 10/10/24 21:23, Sean Christopherson wrote: > TL;DR: Eliminate KVM's long-standing (and heinous) behavior of essentially > guessing which pfns are refcounted pages (see kvm_pfn_to_refcounted_page()). > > Getting there requires "fixing" arch code that isn't obviously broken. > Specifically, to get rid of kvm_pfn_to_refcounted_page(), KVM needs to > stop marking pages/folios dirty/accessed based solely on the pfn that's > stored in KVM's stage-2 page tables. > > Instead of tracking which SPTEs correspond to refcounted pages, simply > remove all of the code that operates on "struct page" based ona the pfn > in stage-2 PTEs. This is the back ~40-50% of the series. > > For x86 in particular, which sets accessed/dirty status when that info > would be "lost", e.g. when SPTEs are zapped or KVM clears the dirty flag > in a SPTE, foregoing the updates provides very measurable performance > improvements for related operations. E.g. when clearing dirty bits as > part of dirty logging, and zapping SPTEs to reconstitue huge pages when > disabling dirty logging. > > The front ~40% of the series is cleanups and prep work, and most of it is > x86 focused (purely because x86 added the most special cases, *sigh*). > E.g. several of the inputs to hva_to_pfn() (and it's myriad wrappers), > can be removed by cleaning up and deduplicating x86 code. > > v13: > - Rebased onto v6.12-rc2 > - Collect reviews. [Alex and others] > - Fix a transient bug in arm64 and RISC-V where KVM would leak a page > refcount. [Oliver] > - Fix a dangling comment. [Alex] > - Drop kvm_lookup_pfn(), as the x86 that "needed" it was stupid and is (was?) > eliminated in v6.12. > - Drop check_user_page_hwpoison(). [Paolo] > - Drop the arm64 MTE fixes that went into 6.12. > - Slightly redo the guest_memfd interaction to account for 6.12 changes. Thanks a lot for working on this patchset! I tested it with native amdgpu/intel contexts and venus/virgl with dGPU and iGPU, no problems spotted. Please merge sooner, this will unblock lots of new virtio-gpu features. Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
On Tue, Oct 22, 2024 at 2:25 AM Sean Christopherson <seanjc@google.com> wrote: > > Looks good to me, thanks and congratulations!! Should we merge it in > > kvm/next asap? > > That has my vote, though I'm obvious extremely biased :-) Your wish is my command... Merged. Paolo