From: "Jan Beulich" Subject: Re: [PATCH] x86/mm: use existing 'pfn' in p2m_get_mem_access Date: Tue, 26 May 2015 10:58:24 +0100 Message-ID: <55645FE0020000780007DD06@mail.emea.novell.com> References: <1432625640-30891-1-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1432625640-30891-1-git-send-email-vkuznets@redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: Andrew Cooper , Tim Deegan , Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 26.05.15 at 09:34, wrote: > 'gfn' is not defined in p2m_get_mem_access() and this code compiles only > because of a coincidence: gfn_lock/gfn_unlock are currently macros which > don't use their second argument. > > Signed-off-by: Vitaly Kuznetsov > --- > xen/arch/x86/mm/p2m.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c > index 1fd1194..18db9bd 100644 > --- a/xen/arch/x86/mm/p2m.c > +++ b/xen/arch/x86/mm/p2m.c > @@ -1696,9 +1696,9 @@ int p2m_get_mem_access(struct domain *d, unsigned long pfn, > return 0; > } > > - gfn_lock(p2m, gfn, 0); > + gfn_lock(p2m, pfn, 0); > mfn = p2m->get_entry(p2m, pfn, &t, &a, 0, NULL); > - gfn_unlock(p2m, gfn, 0); > + gfn_unlock(p2m, pfn, 0); Looks okay from the perspective of fixing the immediate issue, but gets things into kind of an inconsistent state: What is named "pfn" here should really be named "gfn" imo, i.e. the renaming should be done the other way around. Jan