[PATCH v2 0/3] KVM: Fix and clean up kvm_vcpu_map[_readonly]() usages

David Woodhouse dwmw2 at infradead.org
Fri Apr 24 20:27:03 AEST 2026


On Tue, 2026-04-07 at 17:11 -0700, Peter Fang wrote:
> kvm_vcpu_map() and kvm_vcpu_map_readonly() are declared to take a gpa_t
> in kvm_host.h when they're supposed to take a gfn_t. First fix the
> function prototypes, and then refactor them to correctly take a gpa_t,
> reducing boilerplate gpa->gfn conversions at all call sites.
> 
> No actual harm has been done yet as all of the call sites are correctly
> passing in a gfn.
> 
> No functional change intended. All changes are compile-tested on x86 and
> ppc, which are the current users of these APIs.

Fred is already removing all the usage of kvm_vcpu_map() in nested VMX¹
and nested SVM probably wants the same treatment. And the PowerPC one
looks like it could just as easily operate on the userspace address? 

Could we just kill kvm_vcpu_map() completely?



¹ https://lore.kernel.org/kvm/20260102142429.896101-1-griffoul@gmail.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5069 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20260424/d0ed2939/attachment.p7s>


More information about the Linuxppc-dev mailing list