diff mbox series

[Xen-devel,for-4.11,v6,03/16] xen/arm: mm: Use gaddr_to_gfn rather than _gfn(paddr_to_pfn(...))

Message ID 20180321044737.20794-4-julien.grall@arm.com
State Superseded
Headers show
Series xen: Convert page_to_mfn and mfn_to_page to use typesafe MFN | expand

Commit Message

Julien Grall March 21, 2018, 4:47 a.m. UTC
Signed-off-by: Julien Grall <julien.grall@arm.com>

---
Cc: Stefano Stabellini <sstabellini@kernel.org>

    Changes in v6:
        - Remove the justification from the commit message
        - Add George's reviewed-by

    Changes in v4:
        - Patch added
---
 xen/arch/arm/mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Julien Grall March 22, 2018, 8:30 a.m. UTC | #1
Hi,

On 03/21/2018 04:47 AM, Julien Grall wrote:
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> 
> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>

Sorry I added in the changelog but forgot to add George's reviewed-by

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

Cheers,

> 
>      Changes in v6:
>          - Remove the justification from the commit message
>          - Add George's reviewed-by
> 
>      Changes in v4:
>          - Patch added
> ---
>   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 baa3b0de1d..1126e246c0 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -1431,7 +1431,7 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame,
>       if ( flags & GNTMAP_readonly )
>           t = p2m_grant_map_ro;
>   
> -    rc = guest_physmap_add_entry(current->domain, _gfn(addr >> PAGE_SHIFT),
> +    rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(addr),
>                                    _mfn(frame), 0, t);
>   
>       if ( rc )
> @@ -1443,7 +1443,7 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame,
>   int replace_grant_host_mapping(unsigned long addr, unsigned long mfn,
>           unsigned long new_addr, unsigned int flags)
>   {
> -    gfn_t gfn = _gfn(addr >> PAGE_SHIFT);
> +    gfn_t gfn = gaddr_to_gfn(addr);
>       struct domain *d = current->domain;
>       int rc;
>   
>
diff mbox series

Patch

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index baa3b0de1d..1126e246c0 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1431,7 +1431,7 @@  int create_grant_host_mapping(unsigned long addr, unsigned long frame,
     if ( flags & GNTMAP_readonly )
         t = p2m_grant_map_ro;
 
-    rc = guest_physmap_add_entry(current->domain, _gfn(addr >> PAGE_SHIFT),
+    rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(addr),
                                  _mfn(frame), 0, t);
 
     if ( rc )
@@ -1443,7 +1443,7 @@  int create_grant_host_mapping(unsigned long addr, unsigned long frame,
 int replace_grant_host_mapping(unsigned long addr, unsigned long mfn,
         unsigned long new_addr, unsigned int flags)
 {
-    gfn_t gfn = _gfn(addr >> PAGE_SHIFT);
+    gfn_t gfn = gaddr_to_gfn(addr);
     struct domain *d = current->domain;
     int rc;