mbox series

[Xen-devel,0/7] xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN

Message ID 20171004181526.9405-1-julien.grall@linaro.org
Headers show
Series xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN | expand

Message

Julien Grall Oct. 4, 2017, 6:15 p.m. UTC
Hi all,

Most of the users of page_to_mfn and mfn_to_page are either overriding
the macros to make them work with mfn_t or use mfn_x/_mfn becaue the rest
of the function use mfn_t.

So I think it is time to make __page_to_mfn and __mfn_to_page using typesafe
MFN.

The first 6 patches will convert of the code to use typesafe MFN, easing
the tree-wide conversion in patch 7.

Cheers,

Cc:  Andrew Cooper <andrew.cooper3@citrix.com>
Cc:  Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc:  Elena Ufimtseva <elena.ufimtseva@oracle.com>
Cc:  Gang Wei <gang.wei@intel.com>
Cc:  George Dunlap <george.dunlap@eu.citrix.com>
Cc:  George Dunlap <George.Dunlap@eu.citrix.com>
Cc:  Ian Jackson <ian.jackson@eu.citrix.com>
Cc:  Jan Beulich <jbeulich@suse.com>
Cc:  Julien Grall <julien.grall@arm.com>
Cc:  Jun Nakajima <jun.nakajima@intel.com>
Cc:  Kevin Tian <kevin.tian@intel.com>
Cc:  Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc:  Paul Durrant <paul.durrant@citrix.com>
Cc:  Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc:  Shane Wang <shane.wang@intel.com>
Cc:  Stefano Stabellini <sstabellini@kernel.org>
Cc:  Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc:  Tamas K Lengyel <tamas@tklengyel.com>
Cc:  Tim Deegan <tim@xen.org>
Cc:  Wei Liu <wei.liu2@citrix.com>

Julien Grall (7):
  xen/arm: domain_build: Clean-up insert_11_bank
  xen/arm32: mm: Rework is_xen_heap_page to avoid nameclash
  xen/x86: Use maddr_to_page and maddr_to_mfn to avoid open-coded >>
    PAGE_SHIFT
  xen/kimage: Remove defined but unused variables
  xen/xenoprof: Convert the file to use typesafe MFN
  xen/tmem: Convert the file common/tmem_xen.c to use typesafe MFN
  xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN

 xen/arch/arm/domain_build.c             | 15 ++++++++-------
 xen/arch/arm/kernel.c                   |  2 +-
 xen/arch/arm/mem_access.c               |  2 +-
 xen/arch/arm/mm.c                       |  2 +-
 xen/arch/arm/p2m.c                      |  8 +-------
 xen/arch/x86/cpu/vpmu.c                 |  6 +++---
 xen/arch/x86/debug.c                    |  2 +-
 xen/arch/x86/domain.c                   | 21 +++++++++++----------
 xen/arch/x86/domctl.c                   |  2 +-
 xen/arch/x86/hvm/dm.c                   |  2 +-
 xen/arch/x86/hvm/dom0_build.c           |  6 +++---
 xen/arch/x86/hvm/hvm.c                  | 16 ++++++++--------
 xen/arch/x86/hvm/ioreq.c                |  6 +++---
 xen/arch/x86/hvm/stdvga.c               |  2 +-
 xen/arch/x86/hvm/svm/svm.c              |  4 ++--
 xen/arch/x86/hvm/viridian.c             |  8 ++++----
 xen/arch/x86/hvm/vmx/vmcs.c             |  2 +-
 xen/arch/x86/hvm/vmx/vmx.c              | 10 +++++-----
 xen/arch/x86/hvm/vmx/vvmx.c             |  2 +-
 xen/arch/x86/mm.c                       |  6 ------
 xen/arch/x86/mm/guest_walk.c            |  6 +++---
 xen/arch/x86/mm/hap/guest_walk.c        |  2 +-
 xen/arch/x86/mm/hap/hap.c               |  6 ------
 xen/arch/x86/mm/hap/nested_ept.c        |  2 +-
 xen/arch/x86/mm/mem_sharing.c           |  9 ++-------
 xen/arch/x86/mm/p2m-ept.c               |  4 ++++
 xen/arch/x86/mm/p2m-pod.c               |  6 ------
 xen/arch/x86/mm/p2m.c                   |  6 ------
 xen/arch/x86/mm/paging.c                |  6 ------
 xen/arch/x86/mm/shadow/common.c         |  2 +-
 xen/arch/x86/mm/shadow/multi.c          |  6 +++---
 xen/arch/x86/mm/shadow/private.h        | 16 ++--------------
 xen/arch/x86/numa.c                     |  2 +-
 xen/arch/x86/physdev.c                  |  2 +-
 xen/arch/x86/pv/callback.c              |  6 ------
 xen/arch/x86/pv/descriptor-tables.c     |  6 ------
 xen/arch/x86/pv/dom0_build.c            |  6 ++++++
 xen/arch/x86/pv/domain.c                |  6 ------
 xen/arch/x86/pv/emul-gate-op.c          |  6 ------
 xen/arch/x86/pv/emul-priv-op.c          | 10 ----------
 xen/arch/x86/pv/grant_table.c           |  6 ------
 xen/arch/x86/pv/ro-page-fault.c         |  6 ------
 xen/arch/x86/smpboot.c                  |  6 ------
 xen/arch/x86/tboot.c                    |  4 ++--
 xen/arch/x86/traps.c                    |  2 +-
 xen/arch/x86/x86_64/mm.c                |  6 ++++++
 xen/common/domain.c                     |  4 ++--
 xen/common/event_fifo.c                 |  2 +-
 xen/common/grant_table.c                |  6 ++++++
 xen/common/kimage.c                     | 25 +++++++++++--------------
 xen/common/memory.c                     |  6 ++++++
 xen/common/page_alloc.c                 |  6 ++++++
 xen/common/tmem.c                       |  2 +-
 xen/common/tmem_xen.c                   | 24 ++++++++++++------------
 xen/common/trace.c                      |  6 ++++++
 xen/common/vmap.c                       |  9 +++++----
 xen/common/xenoprof.c                   | 17 +++++++++++------
 xen/drivers/passthrough/amd/iommu_map.c |  6 ++++++
 xen/drivers/passthrough/iommu.c         |  2 +-
 xen/drivers/passthrough/x86/iommu.c     |  2 +-
 xen/include/asm-arm/mm.h                | 22 ++++++++++++----------
 xen/include/asm-arm/p2m.h               |  4 ++--
 xen/include/asm-x86/mm.h                | 12 ++++++------
 xen/include/asm-x86/p2m.h               |  2 +-
 xen/include/asm-x86/page.h              | 32 ++++++++++++++++----------------
 xen/include/xen/domain_page.h           |  4 ++--
 xen/include/xen/tmem_xen.h              |  2 +-
 67 files changed, 206 insertions(+), 258 deletions(-)

Comments

Tim Deegan Oct. 6, 2017, 5:31 p.m. UTC | #1
At 19:15 +0100 on 04 Oct (1507144519), Julien Grall wrote:
> Hi all,
> 
> Most of the users of page_to_mfn and mfn_to_page are either overriding
> the macros to make them work with mfn_t or use mfn_x/_mfn becaue the rest
> of the function use mfn_t.
> 
> So I think it is time to make __page_to_mfn and __mfn_to_page using typesafe
> MFN.
> 
> The first 6 patches will convert of the code to use typesafe MFN, easing
> the tree-wide conversion in patch 7.

x86 shadow code changes Acked-by: Tim Deegan <tim@xen.org>