[Xen-devel,18/24] xen/arm: mm: Use typesafe MFN in dump_pt_walk

Message ID 20170613161323.25196-19-julien.grall@arm.com
State New
Headers show
Series
  • xen/arm: Extend the usage of typesafe MFN
Related show

Commit Message

Julien Grall June 13, 2017, 4:13 p.m.
Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Stabellini June 15, 2017, 11:30 p.m. | #1
On Tue, 13 Jun 2017, Julien Grall wrote:
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  xen/arch/arm/mm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 8573192e3a..452c1e26c3 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -181,7 +181,7 @@ void dump_pt_walk(paddr_t ttbr, paddr_t addr,
>                    unsigned int nr_root_tables)
>  {
>      static const char *level_strs[4] = { "0TH", "1ST", "2ND", "3RD" };
> -    const unsigned long root_pfn = paddr_to_pfn(ttbr);
> +    const mfn_t root_mfn = maddr_to_mfn(ttbr);
>      const unsigned int offsets[4] = {
>          zeroeth_table_offset(addr),
>          first_table_offset(addr),
> @@ -215,7 +215,7 @@ void dump_pt_walk(paddr_t ttbr, paddr_t addr,
>      else
>          root_table = 0;
>  
> -    mapping = map_domain_page(_mfn(root_pfn + root_table));
> +    mapping = map_domain_page(mfn_add(root_mfn, root_table));
>  
>      for ( level = root_level; ; level++ )
>      {
> -- 
> 2.11.0
>

Patch hide | download patch | download mbox

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8573192e3a..452c1e26c3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -181,7 +181,7 @@  void dump_pt_walk(paddr_t ttbr, paddr_t addr,
                   unsigned int nr_root_tables)
 {
     static const char *level_strs[4] = { "0TH", "1ST", "2ND", "3RD" };
-    const unsigned long root_pfn = paddr_to_pfn(ttbr);
+    const mfn_t root_mfn = maddr_to_mfn(ttbr);
     const unsigned int offsets[4] = {
         zeroeth_table_offset(addr),
         first_table_offset(addr),
@@ -215,7 +215,7 @@  void dump_pt_walk(paddr_t ttbr, paddr_t addr,
     else
         root_table = 0;
 
-    mapping = map_domain_page(_mfn(root_pfn + root_table));
+    mapping = map_domain_page(mfn_add(root_mfn, root_table));
 
     for ( level = root_level; ; level++ )
     {