]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen: Use correctly the Xen memory terminologies
authorJulien Grall <julien.grall@citrix.com>
Fri, 7 Aug 2015 16:34:37 +0000 (17:34 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 30 Nov 2015 19:50:39 +0000 (14:50 -0500)
commitc51d8af1883cb1c78374c83fbbca6c0fbccbf419
treeb8604d650381916f0ab5a0b2da0a1b770c1ee4fc
parentfe6b942823ba2dfceb321b4008bb74ee61628dcb
xen: Use correctly the Xen memory terminologies

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 resulted in some misimplementation of helpers on ARM and
confused developers about the expected behavior.

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 to mfn with
gfn in any helpers used by PV drivers. The x86 code will still keep some
reference of pfn_to_mfn which may be used by all kind of guests
No changes as been made in the hypercall field, even
though they may be invalid, in order to keep the same as the defintion
in xen repo.

Note that page_to_mfn has been renamed to xen_page_to_gfn to avoid a
name to close to the KVM function gfn_to_page.

Take also the opportunity to simplify simple construction such
as pfn_to_mfn(page_to_pfn(page)) into xen_page_to_gfn. More complex clean up
will come in follow-up patches.

[1] http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=e758ed14f390342513405dd766e874934573e6cb

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
(cherry picked from commit 0df4f266b3af90442bbeb5e685a84a80745beba0)
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
20 files changed:
arch/arm/include/asm/xen/page.h
arch/x86/include/asm/xen/page.h
arch/x86/xen/smp.c
drivers/block/xen-blkfront.c
drivers/input/misc/xen-kbdfront.c
drivers/net/xen-netback/netback.c
drivers/net/xen-netfront.c
drivers/scsi/xen-scsifront.c
drivers/tty/hvc/hvc_xen.c
drivers/video/fbdev/xen-fbfront.c
drivers/xen/balloon.c
drivers/xen/events/events_base.c
drivers/xen/events/events_fifo.c
drivers/xen/gntalloc.c
drivers/xen/manage.c
drivers/xen/tmem.c
drivers/xen/xenbus/xenbus_client.c
drivers/xen/xenbus/xenbus_dev_backend.c
drivers/xen/xenbus/xenbus_probe.c
include/xen/page.h