[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1624524331.zsin3qejl9.astroid@bobo.none>
Date: Thu, 24 Jun 2021 18:52:06 +1000
From: Nicholas Piggin <npiggin@...il.com>
To: Aleksandar Markovic <aleksandar.qemu.devel@...il.com>,
Huacai Chen <chenhuacai@...nel.org>,
Marc Zyngier <maz@...nel.org>,
Paul Mackerras <paulus@...abs.org>,
Paolo Bonzini <pbonzini@...hat.com>,
David Stevens <stevensd@...omium.org>,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
Zhi Wang <zhi.a.wang@...el.com>
Cc: Alexandru Elisei <alexandru.elisei@....com>,
dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org,
James Morse <james.morse@....com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvmarm@...ts.cs.columbia.edu,
kvm-ppc@...r.kernel.org, kvm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Sean Christopherson <seanjc@...gle.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Will Deacon <will@...nel.org>
Subject: Re: [PATCH 2/6] KVM: mmu: also return page from gfn_to_pfn
Excerpts from David Stevens's message of June 24, 2021 1:57 pm:
> From: David Stevens <stevensd@...omium.org>
>
> Return a struct kvm_pfn_page containing both a pfn and an optional
> struct page from the gfn_to_pfn family of functions. This differentiates
> the gup and follow_fault_pfn cases, which allows callers that only need
> a pfn to avoid touching the page struct in the latter case. For callers
> that need a struct page, introduce a helper function that unwraps a
> struct kvm_pfn_page into a struct page. This helper makes the call to
> kvm_get_pfn which had previously been in hva_to_pfn_remapped.
>
> For now, wrap all calls to gfn_to_pfn functions in the new helper
> function. Callers which don't need the page struct will be updated in
> follow-up patches.
Hmm. You mean callers that do need the page will be updated? Normally
if there will be leftover users that don't need the struct page then
you would go the other way and keep the old call the same, and add a new
one (gfn_to_pfn_page) just for those that need it.
Most kernel code I look at passes back multiple values by updating
pointers to struct or variables rather than returning a struct, I
suppose that's not really a big deal and a matter of taste.
Thanks,
Nick
Powered by blists - more mailing lists