diff mbox series

[Xen-devel,v3,10/15] xen/x86: p2m-pod: Use typesafe GFN in pod_eager_record

Message ID 20171002125941.11274-11-julien.grall@arm.com
State Accepted
Commit f496854297f8fc5cf94801cf4bd96431baac5819
Headers show
Series xen/x86: Clean-up the PoD code | expand

Commit Message

Julien Grall Oct. 2, 2017, 12:59 p.m. UTC
Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>

---

Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>

    Changes in v3:
        - Add Wei's reviewed-by

    Changes in v2:
        - Add Andrew's acked-by
---
 xen/arch/x86/mm/p2m-pod.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

George Dunlap Oct. 2, 2017, 4:11 p.m. UTC | #1
On 10/02/2017 01:59 PM, Julien Grall wrote:
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>

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

Patch

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index b8a51cf12a..176d06cb42 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -1062,15 +1062,15 @@  static void pod_eager_reclaim(struct p2m_domain *p2m)
     } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
 }
 
-static void pod_eager_record(struct p2m_domain *p2m,
-                             unsigned long gfn, unsigned int order)
+static void pod_eager_record(struct p2m_domain *p2m, gfn_t gfn,
+                             unsigned int order)
 {
     struct pod_mrp_list *mrp = &p2m->pod.mrp;
 
-    ASSERT(gfn != gfn_x(INVALID_GFN));
+    ASSERT(!gfn_eq(gfn, INVALID_GFN));
 
     mrp->list[mrp->idx++] =
-        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+        gfn_x(gfn) | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
     mrp->idx %= ARRAY_SIZE(mrp->list);
 }
 
@@ -1160,7 +1160,7 @@  p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1UL << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
-    pod_eager_record(p2m, gfn_x(gfn_aligned), order);
+    pod_eager_record(p2m, gfn_aligned, order);
 
     if ( tb_init_done )
     {