diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-09-13 08:06:52 -0400 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-09-13 08:06:52 -0400 |
commit | b3b52fd87e8f7544fde75a471108bd5bd4492c90 (patch) | |
tree | e0a8e3ed2ca59b2db9d53424fc9aa6d8dbcb6ac1 /arch/arm/xen | |
parent | ef61ee0dc7ba0409dc0e8122de90d4e48d4c8669 (diff) |
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>
Diffstat (limited to 'arch/arm/xen')
-rw-r--r-- | arch/arm/xen/enlighten.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index c2a47a724870..036a4d84e861 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -1,8 +1,12 @@ | |||
1 | #include <xen/xen.h> | 1 | #include <xen/xen.h> |
2 | #include <xen/grant_table.h> | ||
3 | #include <xen/hvm.h> | ||
2 | #include <xen/interface/xen.h> | 4 | #include <xen/interface/xen.h> |
3 | #include <xen/interface/memory.h> | 5 | #include <xen/interface/memory.h> |
6 | #include <xen/interface/hvm/params.h> | ||
4 | #include <xen/features.h> | 7 | #include <xen/features.h> |
5 | #include <xen/platform_pci.h> | 8 | #include <xen/platform_pci.h> |
9 | #include <xen/xenbus.h> | ||
6 | #include <asm/xen/hypervisor.h> | 10 | #include <asm/xen/hypervisor.h> |
7 | #include <asm/xen/hypercall.h> | 11 | #include <asm/xen/hypercall.h> |
8 | #include <linux/module.h> | 12 | #include <linux/module.h> |
@@ -42,6 +46,7 @@ EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); | |||
42 | * see Documentation/devicetree/bindings/arm/xen.txt for the | 46 | * see Documentation/devicetree/bindings/arm/xen.txt for the |
43 | * documentation of the Xen Device Tree format. | 47 | * documentation of the Xen Device Tree format. |
44 | */ | 48 | */ |
49 | #define GRANT_TABLE_PHYSADDR 0 | ||
45 | static int __init xen_guest_init(void) | 50 | static int __init xen_guest_init(void) |
46 | { | 51 | { |
47 | struct xen_add_to_physmap xatp; | 52 | struct xen_add_to_physmap xatp; |
@@ -51,6 +56,7 @@ static int __init xen_guest_init(void) | |||
51 | const char *s = NULL; | 56 | const char *s = NULL; |
52 | const char *version = NULL; | 57 | const char *version = NULL; |
53 | const char *xen_prefix = "xen,xen-"; | 58 | const char *xen_prefix = "xen,xen-"; |
59 | struct resource res; | ||
54 | 60 | ||
55 | node = of_find_compatible_node(NULL, NULL, "xen,xen"); | 61 | node = of_find_compatible_node(NULL, NULL, "xen,xen"); |
56 | if (!node) { | 62 | if (!node) { |
@@ -65,6 +71,9 @@ static int __init xen_guest_init(void) | |||
65 | pr_debug("Xen version not found\n"); | 71 | pr_debug("Xen version not found\n"); |
66 | return 0; | 72 | return 0; |
67 | } | 73 | } |
74 | if (of_address_to_resource(node, GRANT_TABLE_PHYSADDR, &res)) | ||
75 | return 0; | ||
76 | xen_hvm_resume_frames = res.start >> PAGE_SHIFT; | ||
68 | xen_domain_type = XEN_HVM_DOMAIN; | 77 | xen_domain_type = XEN_HVM_DOMAIN; |
69 | 78 | ||
70 | xen_setup_features(); | 79 | xen_setup_features(); |
@@ -98,6 +107,11 @@ static int __init xen_guest_init(void) | |||
98 | * is required to use VCPUOP_register_vcpu_info to place vcpu info | 107 | * is required to use VCPUOP_register_vcpu_info to place vcpu info |
99 | * for secondary CPUs as they are brought up. */ | 108 | * for secondary CPUs as they are brought up. */ |
100 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; | 109 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; |
110 | |||
111 | gnttab_init(); | ||
112 | if (!xen_initial_domain()) | ||
113 | xenbus_probe(NULL); | ||
114 | |||
101 | return 0; | 115 | return 0; |
102 | } | 116 | } |
103 | core_initcall(xen_guest_init); | 117 | core_initcall(xen_guest_init); |