lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Jul 2015 12:06:02 +0100
From:	Julien Grall <julien.grall@...rix.com>
To:	David Vrabel <david.vrabel@...rix.com>,
	<xen-devel@...ts.xenproject.org>
CC:	<linux-fbdev@...r.kernel.org>, "H. Peter Anvin" <hpa@...or.com>,
	"Jiri Slaby" <jslaby@...e.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	<stefano.stabellini@...citrix.com>,
	Russell King <linux@....linux.org.uk>,
	<linux-scsi@...r.kernel.org>, <x86@...nel.org>,
	Tomi Valkeinen <tomi.valkeinen@...com>,
	<linux-input@...r.kernel.org>,
	"Jean-Christophe Plagniol-Villard" <plagnioj@...osoft.com>,
	<ian.campbell@...rix.com>,
	"James E.J. Bottomley" <JBottomley@...n.com>,
	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	Ingo Molnar <mingo@...hat.com>,
	<linux-arm-kernel@...ts.infradead.org>,
	Juergen Gross <jgross@...e.com>,
	"Wei Liu" <wei.liu2@...rix.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
	<linuxppc-dev@...ts.ozlabs.org>,
	Roger Pau Monné <roger.pau@...rix.com>
Subject: Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory
 terminologies

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 <david.vrabel@...rix.com>
> 
> 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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ