]> xenbits.xensource.com Git - people/royger/linux-2.6.18-xen.git/commitdiff
[IA64] Fix linux restore. It should reset opt feature.
authorAlex Williamson <alex.williamson@hp.com>
Mon, 15 Oct 2007 17:45:42 +0000 (11:45 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 15 Oct 2007 17:45:42 +0000 (11:45 -0600)
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
arch/ia64/kernel/setup.c
arch/ia64/xen/hypervisor.c
include/asm-ia64/hypervisor.h

index d7de1d5d602fdbb2e3c98429bc6731eb0c0415af..73391c8417bbe11be540cfcde05926a09dcba8a5 100644 (file)
@@ -522,8 +522,6 @@ setup_arch (char **cmdline_p)
 
 #ifdef CONFIG_XEN
        if (is_running_on_xen()) {
-               struct xen_ia64_opt_feature optf;
-
                /* Must be done before any hypercall.  */
                xencomm_initialize();
 
@@ -533,12 +531,7 @@ setup_arch (char **cmdline_p)
                                               &xen_panic_block);
                pm_power_off = xen_pm_power_off;
 
-               /* Enable region 7 identity map optimizations in Xen */
-               optf.cmd = XEN_IA64_OPTF_IDENT_MAP_REG7;
-               optf.on = XEN_IA64_OPTF_ON;
-               optf.pgprot = pgprot_val(PAGE_KERNEL);
-               optf.key = 0;   /* No key on linux. */
-               HYPERVISOR_opt_feature(&optf);
+               xen_ia64_enable_opt_feature();
        }
 #endif
 
index f1b995eb66470162c35abf72654dd52def7b60bb..fc27fda7e0989161c3c8d7cc3935feb8e67d1150 100644 (file)
@@ -1477,6 +1477,21 @@ xen_ia64_unmap_resource(struct resource* res)
 }
 EXPORT_SYMBOL_GPL(xen_ia64_unmap_resource);
 
+///////////////////////////////////////////////////////////////////////////
+// opt feature
+void
+xen_ia64_enable_opt_feature(void)
+{
+       /* Enable region 7 identity map optimizations in Xen */
+       struct xen_ia64_opt_feature optf;
+
+       optf.cmd = XEN_IA64_OPTF_IDENT_MAP_REG7;
+       optf.on = XEN_IA64_OPTF_ON;
+       optf.pgprot = pgprot_val(PAGE_KERNEL);
+       optf.key = 0;   /* No key on linux. */
+       HYPERVISOR_opt_feature(&optf);
+}
+
 ///////////////////////////////////////////////////////////////////////////
 // suspend/resume
 void
@@ -1486,5 +1501,6 @@ xen_post_suspend(int suspend_cancelled)
                return;
        
        p2m_expose_resume();
+       xen_ia64_enable_opt_feature();
        /* add more if necessary */
 }
index b76f67047ce1cc52233496e5ed7bc7f8023be182..cbc31b39d266144d96ee360ec7d122e4b5c60cc2 100644 (file)
@@ -170,6 +170,9 @@ int xen_limit_pages_to_max_mfn(struct page *pages, unsigned int order,
 /* For drivers/xen/core/machine_reboot.c */
 #define HAVE_XEN_POST_SUSPEND
 void xen_post_suspend(int suspend_cancelled);
+
+/* For setup_arch() in arch/ia64/kernel/setup.c */
+void xen_ia64_enable_opt_feature(void);
 #endif /* !CONFIG_VMX_GUEST */
 
 #define __pte_ma(_x)   ((pte_t) {(_x)})        /* unmodified use */