# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1192430976 -32400 # Node ID acd79fd1b07783be9a78907bc4aa640d3c514d7b # Parent 4cf72481b5ed20ed719c380f60a560aa14b12a26 fix linux restore. It should reset opt feature. PATCHNAME: fix_linux_restore_path Signed-off-by: Isaku Yamahata diff -r 4cf72481b5ed -r acd79fd1b077 arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Fri Oct 12 14:21:34 2007 -0600 +++ b/arch/ia64/kernel/setup.c Mon Oct 15 15:49:36 2007 +0900 @@ -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 diff -r 4cf72481b5ed -r acd79fd1b077 arch/ia64/xen/hypervisor.c --- a/arch/ia64/xen/hypervisor.c Fri Oct 12 14:21:34 2007 -0600 +++ b/arch/ia64/xen/hypervisor.c Mon Oct 15 15:49:36 2007 +0900 @@ -1478,6 +1478,21 @@ EXPORT_SYMBOL_GPL(xen_ia64_unmap_resourc 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 xen_post_suspend(int suspend_cancelled) @@ -1486,5 +1501,6 @@ xen_post_suspend(int suspend_cancelled) return; p2m_expose_resume(); + xen_ia64_enable_opt_feature(); /* add more if necessary */ } diff -r 4cf72481b5ed -r acd79fd1b077 include/asm-ia64/hypervisor.h --- a/include/asm-ia64/hypervisor.h Fri Oct 12 14:21:34 2007 -0600 +++ b/include/asm-ia64/hypervisor.h Mon Oct 15 15:49:36 2007 +0900 @@ -170,6 +170,9 @@ int xen_limit_pages_to_max_mfn(struct pa /* 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 */