Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbbG2LG6 (ORCPT ); Wed, 29 Jul 2015 07:06:58 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:60359 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbbG2LG4 (ORCPT ); Wed, 29 Jul 2015 07:06:56 -0400 X-IronPort-AV: E=Sophos;i="5.15,570,1432598400"; d="scan'208";a="288801241" Message-ID: <55B8B39A.5020308@citrix.com> Date: Wed, 29 Jul 2015 12:06:02 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: David Vrabel , CC: , "H. Peter Anvin" , "Jiri Slaby" , Thomas Gleixner , , Russell King , , , Tomi Valkeinen , , "Jean-Christophe Plagniol-Villard" , , "James E.J. Bottomley" , Boris Ostrovsky , Ingo Molnar , , Juergen Gross , "Wei Liu" , Greg Kroah-Hartman , Dmitry Torokhov , , , , =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= Subject: Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory terminologies References: <1438095769-2560-1-git-send-email-julien.grall@citrix.com> <1438095769-2560-5-git-send-email-julien.grall@citrix.com> <55B7B8D2.5060107@citrix.com> In-Reply-To: <55B7B8D2.5060107@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2027 Lines: 48 On 28/07/15 18:16, David Vrabel wrote: > On 28/07/15 16:02, Julien Grall wrote: >> Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN >> is meant, I suspect this is because the first support for Xen was for >> PV. This brough some misimplementation of helpers on ARM and make the >> developper confused the expected behavior. > > For the benefit of other subsystem maintainers, this is a purely > mechanical change in Xen-specific terminology. It doesn't need reviews > or acks from non-Xen people (IMO). > >> For instance, with pfn_to_mfn, we expect to get an MFN based on the name. >> Although, if we look at the implementation on x86, it's returning a GFN. >> >> For clarity and avoid new confusion, replace any reference of mfn into >> gnf in any helpers used by PV drivers. >> >> Take also the opportunity to simplify simple construction such >> as pfn_to_mfn(page_to_pfn(page)) into page_to_gfn. More complex clean up >> will come in follow-up patches. >> >> I think it may be possible to do further clean up in the x86 code to >> ensure that helpers returning machine address (such as virt_address) is >> not used by no auto-translated guests. I will let x86 xen expert doing >> it. > > Reviewed-by: David Vrabel > > It looks a bit odd to use GFN in some of the PV code where the > hypervisor API uses MFN but overall I think using the correct > terminology where possible is best. But I'd like to have Boris's or > Konrad's opinion on this. I was thinking to introduce mfn_to_pfn & co which would be used only for PV-guest (a BUG_ON would be here to ensure it) and hypercall related. I didn't do it as I haven't much knowledge on x86 Xen and was able to decide where I have to use pfn_to_mfn. Regards, -- Julien Grall -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/