]> xenbits.xensource.com Git - people/sstabellini/linux-pvhvm-deprecated.git/commitdiff
xen/arm: initialize grant_table on ARM
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 4 Jul 2012 10:20:59 +0000 (10:20 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 4 Jul 2012 10:20:59 +0000 (10:20 +0000)
Initialize the grant table mapping it at HVM_PARAM_GRANT_START_PFN.
After the grant table is initialized, call xenbus_probe (if not dom0).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
arch/arm/xen/enlighten.c
drivers/xen/grant-table.c
include/xen/interface/hvm/params.h

index ddacecfafa40f13f93384d265dc44293445f6125..6901e374d45010e41b7e3cc7d4354c7c7b844c4b 100644 (file)
@@ -1,9 +1,13 @@
 #include <xen/xen.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/memory.h>
+#include <xen/interface/hvm/params.h>
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
 #include <xen/features.h>
+#include <xen/grant_table.h>
+#include <xen/hvm.h>
+#include <xen/xenbus.h>
 
 #include <linux/module.h>
 
@@ -133,6 +137,7 @@ static void __init xen_hvm_init_shared_info(void)
        int cpu;
        struct xen_add_to_physmap xatp;
        static struct shared_info *shared_info_page = 0;
+       uint64_t val;
 
        xen_setup_features();
        if (xen_feature(XENFEAT_dom0))
@@ -171,6 +176,19 @@ static void __init xen_hvm_init_shared_info(void)
        for_each_online_cpu(cpu) {
                per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
        }
+
+       if (!xen_hvm_resume_frames) {
+               if (hvm_get_parameter(HVM_PARAM_GRANT_START_PFN, &val) >= 0)
+                       xen_hvm_resume_frames = val << PAGE_SHIFT;
+               else {
+                       printk(KERN_ERR "error getting "
+                                       "HVM_PARAM_GRANT_START_PFN");
+                       return;
+               }
+       }
+       gnttab_init();
+       if (!xen_initial_domain())
+               xenbus_probe(NULL);
 }
 core_initcall(xen_hvm_init_shared_info);
 
index db3964bb9f69012289a3d5bf5035aa988ab628ff..766fc352061c2ba151d703f650459295ec2b698b 100644 (file)
@@ -58,7 +58,7 @@
 
 static grant_ref_t **gnttab_list;
 static unsigned int nr_grant_frames;
-static unsigned int boot_max_nr_grant_frames;
+static unsigned int boot_max_nr_grant_frames = 1;
 static int gnttab_free_count;
 static grant_ref_t gnttab_free_head;
 static DEFINE_SPINLOCK(gnttab_list_lock);
index 1b4f923d70868a4c02380e0e41d72970ed92db69..e51269bf4ff82f7fee8a1c2b0bbe6e137d36bd3e 100644 (file)
@@ -94,6 +94,8 @@
 #define HVM_PARAM_CONSOLE_PFN    17
 #define HVM_PARAM_CONSOLE_EVTCHN 18
 
-#define HVM_NR_PARAMS          19
+#define HVM_PARAM_GRANT_START_PFN 30
+
+#define HVM_NR_PARAMS          31
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */