Skip to contentSkip to conversation

KVM: Drop gfn_to_pfn_atomic()

PATCH linmiaohe 2 participants 2 messages Mar 5, 2020 KVM

lore
Share & tools
lore

linmiaohe

author Reviewed-by
#0 lore raw
Quoted 7 lines · Peter Xu

It's never used anywhere now.

---
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.

#1 lore raw
Quoted 16 lines · linmiaohe
Quoted 7 lines · Peter Xu

It's never used anywhere now.

---
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()

Quoted 2 lines

Thanks.

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,

Signature · 1 line
Peter Xu