Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-21 Thread Sean Christopherson
On Sat, Nov 12, 2022, Yan Zhao wrote: > And I'm also not sure if a slots_arch_lock is required for > kvm_slot_page_track_add_page() and kvm_slot_page_track_remove_page(). It's not required. slots_arch_lock protects interaction between memslot updates mmu_first_shadow_root_alloc(). When CONFIG_KV

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-21 Thread Sean Christopherson
On Tue, Nov 15, 2022, Yan Zhao wrote: > On Mon, Nov 14, 2022 at 04:32:34PM +, Sean Christopherson wrote: > > On Mon, Nov 14, 2022, Yan Zhao wrote: > > > On Sat, Nov 12, 2022 at 12:43:07AM +, Sean Christopherson wrote: > > > > On Sat, Nov 12, 2022, Yan Zhao wrote: > > > > > And I'm also not

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-21 Thread Sean Christopherson
TL;DR: I'm going to try to add more aggressive patches for this into my series to clean up the KVM side of things, along with many more patches to clean up the page track APIs. I'll post patches next week if things go well (fingers crossed), and if not I'll give an update On Fri, Nov 11, 2022,

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-21 Thread Sean Christopherson
On Mon, Nov 14, 2022, Yan Zhao wrote: > On Sat, Nov 12, 2022 at 12:43:07AM +, Sean Christopherson wrote: > > On Sat, Nov 12, 2022, Yan Zhao wrote: > > > And I'm also not sure if a slots_arch_lock is required for > > > kvm_slot_page_track_add_page() and kvm_slot_page_track_remove_page(). > > >

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-21 Thread Sean Christopherson
On Tue, Nov 15, 2022, Yan Zhao wrote: > On Mon, Nov 14, 2022 at 11:24:16PM +, Sean Christopherson wrote: > > On Tue, Nov 15, 2022, Yan Zhao wrote: > > > On Mon, Nov 14, 2022 at 04:32:34PM +, Sean Christopherson wrote: > > > > On Mon, Nov 14, 2022, Yan Zhao wrote: > > > > > On Sat, Nov 12, 2

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-14 Thread Yan Zhao
On Tue, Nov 15, 2022 at 12:55:42AM +, Sean Christopherson wrote: > On Tue, Nov 15, 2022, Yan Zhao wrote: > > On Mon, Nov 14, 2022 at 11:24:16PM +, Sean Christopherson wrote: > > > On Tue, Nov 15, 2022, Yan Zhao wrote: > > > > On Mon, Nov 14, 2022 at 04:32:34PM +, Sean Christopherson wro

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-14 Thread Yan Zhao
On Mon, Nov 14, 2022 at 11:24:16PM +, Sean Christopherson wrote: > On Tue, Nov 15, 2022, Yan Zhao wrote: > > On Mon, Nov 14, 2022 at 04:32:34PM +, Sean Christopherson wrote: > > > On Mon, Nov 14, 2022, Yan Zhao wrote: > > > > On Sat, Nov 12, 2022 at 12:43:07AM +, Sean Christopherson wro

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-14 Thread Yan Zhao
On Mon, Nov 14, 2022 at 04:32:34PM +, Sean Christopherson wrote: > On Mon, Nov 14, 2022, Yan Zhao wrote: > > On Sat, Nov 12, 2022 at 12:43:07AM +, Sean Christopherson wrote: > > > On Sat, Nov 12, 2022, Yan Zhao wrote: > > > > And I'm also not sure if a slots_arch_lock is required for > > >

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-13 Thread Yan Zhao
On Sat, Nov 12, 2022 at 12:43:07AM +, Sean Christopherson wrote: > On Sat, Nov 12, 2022, Yan Zhao wrote: > > And I'm also not sure if a slots_arch_lock is required for > > kvm_slot_page_track_add_page() and kvm_slot_page_track_remove_page(). > > It's not required. slots_arch_lock protects int

Re: [Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-11 Thread Yan Zhao
On Fri, Nov 11, 2022 at 06:19:15PM +, Sean Christopherson wrote: > TL;DR: I'm going to try to add more aggressive patches for this into my > series to > clean up the KVM side of things, along with many more patches to clean up the > page > track APIs. > > I'll post patches next week if thing

[Intel-gfx] [PATCH v2 1/3] KVM: x86: add a new page track hook track_remove_slot

2022-11-11 Thread Yan Zhao
Page track hook track_remove_slot is used to notify users that a slot has been removed and is called when a slot DELETE/MOVE is about to be completed. Users of this hook can drop write protections in the removed slot. Note: Since KVM_MR_MOVE currently never actually happens in KVM/QEMU, and has n