xen/xenbus: Use Xen page definition
authorJulien Grall <julien.grall@citrix.com>
Tue, 5 May 2015 15:38:27 +0000 (16:38 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Fri, 23 Oct 2015 13:20:37 +0000 (14:20 +0100)
All the ring (xenstore, and PV rings) are always based on the page
granularity of Xen.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
drivers/xen/xenbus/xenbus_client.c
drivers/xen/xenbus/xenbus_probe.c

index aa304d05101ba7a90ad2055dd20cca44879b89a5..42abee3bbb27b20314b40df9e036e67f6c8b9d2e 100644 (file)
@@ -388,7 +388,7 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr,
                }
                grefs[i] = err;
 
-               vaddr = vaddr + PAGE_SIZE;
+               vaddr = vaddr + XEN_PAGE_SIZE;
        }
 
        return 0;
@@ -555,7 +555,7 @@ static int xenbus_map_ring_valloc_pv(struct xenbus_device *dev,
        if (!node)
                return -ENOMEM;
 
-       area = alloc_vm_area(PAGE_SIZE * nr_grefs, ptes);
+       area = alloc_vm_area(XEN_PAGE_SIZE * nr_grefs, ptes);
        if (!area) {
                kfree(node);
                return -ENOMEM;
@@ -749,7 +749,7 @@ static int xenbus_unmap_ring_vfree_pv(struct xenbus_device *dev, void *vaddr)
                unsigned long addr;
 
                memset(&unmap[i], 0, sizeof(unmap[i]));
-               addr = (unsigned long)vaddr + (PAGE_SIZE * i);
+               addr = (unsigned long)vaddr + (XEN_PAGE_SIZE * i);
                unmap[i].host_addr = arbitrary_virt_to_machine(
                        lookup_address(addr, &level)).maddr;
                unmap[i].dev_bus_addr = 0;
index 3cbe0556de26625b75f1e62f02d8372555d59b7f..33a31cfef55dd407c829f29a8c3b71379442799a 100644 (file)
@@ -802,7 +802,8 @@ static int __init xenbus_init(void)
                        goto out_error;
                xen_store_gfn = (unsigned long)v;
                xen_store_interface =
-                       xen_remap(xen_store_gfn << PAGE_SHIFT, PAGE_SIZE);
+                       xen_remap(xen_store_gfn << XEN_PAGE_SHIFT,
+                                 XEN_PAGE_SIZE);
                break;
        default:
                pr_warn("Xenstore state unknown\n");