Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-10 Thread David Woodhouse
On Fri, 2021-12-10 at 15:53 +0100, Paolo Bonzini wrote: > On 12/10/21 13:25, David Woodhouse wrote: > > On Thu, 2021-12-09 at 23:34 +0100, Paolo Bonzini wrote: > > > Compared to the review it's missing this hunk: > > > > > > @@ -265,7 +265,7 @@ void kvm_gfn_to_pfn_cache_unmap(struct kvm *kvm, > >

Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-10 Thread Paolo Bonzini
On 12/10/21 13:25, David Woodhouse wrote: On Thu, 2021-12-09 at 23:34 +0100, Paolo Bonzini wrote: Compared to the review it's missing this hunk: @@ -265,7 +265,7 @@ void kvm_gfn_to_pfn_cache_unmap(struct kvm *kvm, struct gfn_to_pfn_cache *gpc) gpc->valid = false; - old_khva =

Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-10 Thread David Woodhouse
On Thu, 2021-12-09 at 23:34 +0100, Paolo Bonzini wrote: > > Compared to the review it's missing this hunk: > > @@ -265,7 +265,7 @@ void kvm_gfn_to_pfn_cache_unmap(struct kvm *kvm, struct > gfn_to_pfn_cache *gpc) > > gpc->valid = false; > > - old_khva = gpc->khva; > + old

Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-09 Thread David Woodhouse
On Thu, 2021-12-09 at 23:34 +0100, Paolo Bonzini wrote: > Compared to the review it's missing this hunk: > > @@ -265,7 +265,7 @@ void kvm_gfn_to_pfn_cache_unmap(struct kvm *kvm, struct > gfn_to_pfn_cache *gpc) > > gpc->valid = false; > > - old_khva = gpc->khva; > + old_khva

Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-09 Thread Paolo Bonzini
On 12/9/21 21:40, David Woodhouse wrote: NP, very useful fixes. Thanks. Incremental patch looks like this. It passes the xen_shinfo_test self-test; will test it with real Xen guests tomorrow and repost based on your kvm/next tree once it shows up. Compared to the review it's missing this hunk:

Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-09 Thread David Woodhouse
On Thu, 2021-12-09 at 19:34 +0100, Paolo Bonzini wrote: > Sorry for the late review... NP, very useful fixes. Thanks. Incremental patch looks like this. It passes the xen_shinfo_test self-test; will test it with real Xen guests tomorrow and repost based on your kvm/next tree once it shows up. di

Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-12-09 Thread Paolo Bonzini
Sorry for the late review... On 11/21/21 13:54, David Woodhouse wrote: +EXPORT_SYMBOL_GPL(kvm_gfn_to_pfn_cache_check); + +static void __release_gpc(struct kvm *kvm, kvm_pfn_t pfn, void *khva, + gpa_t gpa, bool dirty) +{ + /* Unmap the old page if it was mapped befor

[PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

2021-11-21 Thread David Woodhouse
From: David Woodhouse This can be used in two modes. There is an atomic mode where the cached mapping is accessed while holding the rwlock, and a mode where the physical address is used by a vCPU in guest mode. For the latter case, an invalidation will wake the vCPU with the new KVM_REQ_GPC_INVA