Re: [PATCH v4 13/17] [GMEM-DEPENDENT] KVM: guest_memfd: Add helpers to get start/end gfns give gmem+slot+pgoff
From: Edgecombe, Rick P
Date: Thu Oct 08 2026 - 19:17:16 EST
On Mon, 2026-09-28 at 17:11 +0800, Yan Zhao wrote:
> From: Sean Christopherson <seanjc@xxxxxxxxxx>
>
> Add helpers for getting a gfn given a gmem slot+pgoff, and for getting a
> gfn given a starting or ending pgoff, i.e. an offset that may be beyond
> the range of the memslot binding. Providing helpers will avoid duplicate
> boilerplate code "if" future code also needs to iterate over gfn ranges.
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Signed-off-by: Yan Zhao <yan.y.zhao@xxxxxxxxx>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>