All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: Drop gfn_to_pfn_atomic()
@ 2020-03-04 17:51 Peter Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Xu @ 2020-03-04 17:51 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: peterx, Paolo Bonzini

It's never used anywhere now.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 include/linux/kvm_host.h | 1 -
 virt/kvm/kvm_main.c      | 6 ------
 2 files changed, 7 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index bcb9b2ac0791..3faa062ea108 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -704,7 +704,6 @@ void kvm_release_page_clean(struct page *page);
 void kvm_release_page_dirty(struct page *page);
 void kvm_set_page_accessed(struct page *page);
 
-kvm_pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
 kvm_pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
 kvm_pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault,
 		      bool *writable);
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 70f03ce0e5c1..d29718c7017c 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1754,12 +1754,6 @@ kvm_pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn)
 }
 EXPORT_SYMBOL_GPL(gfn_to_pfn_memslot_atomic);
 
-kvm_pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn)
-{
-	return gfn_to_pfn_memslot_atomic(gfn_to_memslot(kvm, gfn), gfn);
-}
-EXPORT_SYMBOL_GPL(gfn_to_pfn_atomic);
-
 kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn)
 {
 	return gfn_to_pfn_memslot_atomic(kvm_vcpu_gfn_to_memslot(vcpu, gfn), gfn);
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: Drop gfn_to_pfn_atomic()
  2020-03-05  1:52 linmiaohe
@ 2020-03-05 15:49 ` Peter Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Xu @ 2020-03-05 15:49 UTC (permalink / raw)
  To: linmiaohe; +Cc: Paolo Bonzini, linux-kernel, kvm

On Thu, Mar 05, 2020 at 01:52:24AM +0000, linmiaohe wrote:
> Peter Xu <peterx@redhat.com> writes:
> >It's never used anywhere now.
> >
> >Signed-off-by: Peter Xu <peterx@redhat.com>
> >---
> > include/linux/kvm_host.h | 1 -
> > virt/kvm/kvm_main.c      | 6 ------
> > 2 files changed, 7 deletions(-)
> 
> It seems we prefer to use kvm_vcpu_gfn_to_pfn_atomic instead now. :)
> Patch looks good, but maybe we should update Documentation/virt/kvm/locking.rst too:
> In locking.rst:
> 	For direct sp, we can easily avoid it since the spte of direct sp is fixed
> 	to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
> 	to pin gfn to pfn, because after gfn_to_pfn_atomic()
> 
> Thanks.
> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

Yes we should update the document, however instead of replacing with
the vcpu helper, I'd rather reorganize the locking doc for a bit more
because the fast page fault is not enabled for indirect sp at all,
afaict...

I'll add a pre-requisite patch to refine the document, and keep your
r-b for this patch.

Thanks,

-- 
Peter Xu


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: Drop gfn_to_pfn_atomic()
@ 2020-03-05  1:52 linmiaohe
  2020-03-05 15:49 ` Peter Xu
  0 siblings, 1 reply; 3+ messages in thread
From: linmiaohe @ 2020-03-05  1:52 UTC (permalink / raw)
  To: Peter Xu; +Cc: Paolo Bonzini, linux-kernel, kvm

Peter Xu <peterx@redhat.com> writes:
>It's never used anywhere now.
>
>Signed-off-by: Peter Xu <peterx@redhat.com>
>---
> include/linux/kvm_host.h | 1 -
> virt/kvm/kvm_main.c      | 6 ------
> 2 files changed, 7 deletions(-)

It seems we prefer to use kvm_vcpu_gfn_to_pfn_atomic instead now. :)
Patch looks good, but maybe we should update Documentation/virt/kvm/locking.rst too:
In locking.rst:
	For direct sp, we can easily avoid it since the spte of direct sp is fixed
	to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
	to pin gfn to pfn, because after gfn_to_pfn_atomic()

Thanks.
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-05 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 17:51 [PATCH] KVM: Drop gfn_to_pfn_atomic() Peter Xu
2020-03-05  1:52 linmiaohe
2020-03-05 15:49 ` Peter Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.