From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicholas Piggin Date: Thu, 24 Jun 2021 09:57:57 +0000 Subject: Re: [PATCH 2/6] KVM: mmu: also return page from gfn_to_pfn Message-Id: <1624528342.s2ezcyp90x.astroid@bobo.none> List-Id: References: <20210624035749.4054934-1-stevensd@google.com> <20210624035749.4054934-3-stevensd@google.com> <1624524331.zsin3qejl9.astroid@bobo.none> <201b68a7-10ea-d656-0c1e-5511b1f22674@redhat.com> In-Reply-To: <201b68a7-10ea-d656-0c1e-5511b1f22674@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Aleksandar Markovic , Huacai Chen , Marc Zyngier , Paul Mackerras , Paolo Bonzini , David Stevens , Zhenyu Wang , Zhi Wang Cc: Alexandru Elisei , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, James Morse , Jim Mattson , Joerg Roedel , kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Sean Christopherson , Suzuki K Poulose , Vitaly Kuznetsov , Wanpeng Li , Will Deacon Excerpts from Paolo Bonzini's message of June 24, 2021 7:42 pm: > On 24/06/21 10:52, Nicholas Piggin wrote: >>> 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. > > Needing kvm_pfn_page_unwrap is a sign that something might be buggy, so > it's a good idea to move the short name to the common case and the ugly > kvm_pfn_page_unwrap(gfn_to_pfn(...)) for the weird one. In fact I'm not > sure there should be any kvm_pfn_page_unwrap in the end. If all callers were updated that is one thing, but from the changelog it sounds like that would not happen and there would be some gfn_to_pfn users left over. But yes in the end you would either need to make gfn_to_pfn never return a page found via follow_pte, or change all callers to the new way. If the plan is for the latter then I guess that's fine. Thanks, Nick