[PATCH v2 3/3] KVM: Take gpa_t in kvm_vcpu_map[_readonly]()

Yosry Ahmed yosry at kernel.org
Wed Apr 22 09:08:17 AEST 2026


On Tue, Apr 07, 2026 at 05:11:30PM -0700, Peter Fang wrote:
> Move the conversion from a gpa_t to a gfn_t into kvm_vcpu_map() and
> kvm_vcpu_map_readonly() so that they take a gpa_t directly, reducing
> boilerplate at call sites.
> 
> __kvm_vcpu_map() still takes a gfn_t because guest page mapping is
> fundamentally GFN-based.
> 
> No functional change intended.
> 
> Compile-tested on x86 and ppc, which are the current users of these
> interfaces.
> 
> Suggested-by: Yosry Ahmed <yosry at kernel.org>
> Signed-off-by: Peter Fang <peter.fang at intel.com>
> ---

I was going to suggest a WARN in kvm_vcpu_map() and
kvm_vcpu_map_readonly() if the passed GPA is not page-aligned, but Sean
usually hates my paranoid WARN suggestions.

Anyway:
Reviewed-by: Yosry Ahmed <yosry at kernel.org>


More information about the Linuxppc-dev mailing list