Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen/arm: initialize grant_table on ARM

Initialize the grant table mapping at the address specified at index 0
in the DT under the /xen node.
After the grant table is initialized, call xenbus_probe (if not dom0).

Changes in v2:

- introduce GRANT_TABLE_PHYSADDR;
- remove unneeded initialization of boot_max_nr_grant_frames.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

+14
+14
arch/arm/xen/enlighten.c
··· 1 1 #include <xen/xen.h> 2 + #include <xen/grant_table.h> 3 + #include <xen/hvm.h> 2 4 #include <xen/interface/xen.h> 3 5 #include <xen/interface/memory.h> 6 + #include <xen/interface/hvm/params.h> 4 7 #include <xen/features.h> 5 8 #include <xen/platform_pci.h> 9 + #include <xen/xenbus.h> 6 10 #include <asm/xen/hypervisor.h> 7 11 #include <asm/xen/hypercall.h> 8 12 #include <linux/module.h> ··· 46 42 * see Documentation/devicetree/bindings/arm/xen.txt for the 47 43 * documentation of the Xen Device Tree format. 48 44 */ 45 + #define GRANT_TABLE_PHYSADDR 0 49 46 static int __init xen_guest_init(void) 50 47 { 51 48 struct xen_add_to_physmap xatp; ··· 56 51 const char *s = NULL; 57 52 const char *version = NULL; 58 53 const char *xen_prefix = "xen,xen-"; 54 + struct resource res; 59 55 60 56 node = of_find_compatible_node(NULL, NULL, "xen,xen"); 61 57 if (!node) { ··· 71 65 pr_debug("Xen version not found\n"); 72 66 return 0; 73 67 } 68 + if (of_address_to_resource(node, GRANT_TABLE_PHYSADDR, &res)) 69 + return 0; 70 + xen_hvm_resume_frames = res.start >> PAGE_SHIFT; 74 71 xen_domain_type = XEN_HVM_DOMAIN; 75 72 76 73 xen_setup_features(); ··· 107 98 * is required to use VCPUOP_register_vcpu_info to place vcpu info 108 99 * for secondary CPUs as they are brought up. */ 109 100 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; 101 + 102 + gnttab_init(); 103 + if (!xen_initial_domain()) 104 + xenbus_probe(NULL); 105 + 110 106 return 0; 111 107 } 112 108 core_initcall(xen_guest_init);