# HG changeset patch # User dietmar.hahn@xxxxxxxxxxxxxxxxxxx # Node ID 5a4d4c779bb4e5ccf38eb2ae73f417c59044cc33 # Parent e9426682eb0c31a8a4d25363eb2d180f493d01d5 Added the usage of the new hypervisor call HYPERVISOR_opt_feature() for identity mapping region 7. Signed-off-by: Dietmar Hahn diff -r e9426682eb0c -r 5a4d4c779bb4 arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Thu Jul 5 14:36:59 2007 -0600 +++ b/arch/ia64/kernel/setup.c Fri Jul 6 15:21:02 2007 +0200 @@ -454,6 +454,13 @@ setup_arch (char **cmdline_p) atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block); pm_power_off = xen_pm_power_off; + + struct xen_ia64_opt_feature optf; + optf.cmd = OPTF_IDENT_MAP_REG7; + optf.on = OPTF_ON; + optf.pgprot = pgprot_val(PAGE_KERNEL); + optf.key = 0; /* No key on linux. */ + HYPERVISOR_opt_feature(OPTF_IDENT_MAP_REG7, &optf); } #endif diff -r e9426682eb0c -r 5a4d4c779bb4 arch/ia64/xen/xcom_hcall.c --- a/arch/ia64/xen/xcom_hcall.c Thu Jul 5 14:36:59 2007 -0600 +++ b/arch/ia64/xen/xcom_hcall.c Fri Jul 6 15:21:02 2007 +0200 @@ -397,9 +397,18 @@ xencomm_hypercall_vcpu_op(int cmd, int c xencomm_create_inline(arg)); } +long +xencomm_hypercall_opt_feature(unsigned long cmd, void *arg) +{ + return xencomm_arch_hypercall_opt_feature(cmd, + xencomm_create_inline(arg)); +} + int xencomm_hypercall_fpswa_revision(unsigned int *revision) { return xencomm_arch_hypercall_fpswa_revision( xencomm_create_inline(revision)); } + + diff -r e9426682eb0c -r 5a4d4c779bb4 include/asm-ia64/hypercall.h --- a/include/asm-ia64/hypercall.h Thu Jul 5 14:36:59 2007 -0600 +++ b/include/asm-ia64/hypercall.h Fri Jul 6 15:21:02 2007 +0200 @@ -227,6 +227,12 @@ xencomm_arch_hypercall_xenoprof_op(int o xencomm_arch_hypercall_xenoprof_op(int op, struct xencomm_handle *arg) { return _hypercall2(int, xenoprof_op, op, arg); +} + +static inline long +xencomm_arch_hypercall_opt_feature(unsigned long op, struct xencomm_handle *arg) +{ + return _hypercall2(long, opt_feature, op, arg); } extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); @@ -427,6 +433,7 @@ HYPERVISOR_add_io_space(unsigned long ph #define HYPERVISOR_suspend xencomm_hypercall_suspend #define HYPERVISOR_vcpu_op xencomm_hypercall_vcpu_op +#define HYPERVISOR_opt_feature xencomm_hypercall_opt_feature /* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */ #define HYPERVISOR_mmu_update(req, count, success_count, domid) ({BUG();0;}) diff -r e9426682eb0c -r 5a4d4c779bb4 include/asm-ia64/xen/xcom_hcall.h --- a/include/asm-ia64/xen/xcom_hcall.h Thu Jul 5 14:36:59 2007 -0600 +++ b/include/asm-ia64/xen/xcom_hcall.h Fri Jul 6 15:21:02 2007 +0200 @@ -53,6 +53,8 @@ extern int xencomm_hypercall_perfmon_op( extern long xencomm_hypercall_vcpu_op(int cmd, int cpu, void *arg); +extern long xencomm_hypercall_opt_feature(unsigned long, void *arg); + /* Using mini xencomm. */ extern int xencomm_mini_hypercall_console_io(int cmd, int count, char *str); diff -r e9426682eb0c -r 5a4d4c779bb4 include/xen/interface/arch-ia64.h --- a/include/xen/interface/arch-ia64.h Thu Jul 5 14:36:59 2007 -0600 +++ b/include/xen/interface/arch-ia64.h Fri Jul 6 15:21:02 2007 +0200 @@ -558,6 +558,40 @@ struct xen_ia64_boot_param { #define XENCOMM_INLINE_ADDR(addr) \ ((unsigned long)(addr) & ~XENCOMM_INLINE_MASK) +#ifndef __ASSEMBLY__ + +/* Optimization features. + * The hypervisor may do some special optimizations for guests. This hypercall + * can be used to switch on/of these special optimizations. + */ +#define __HYPERVISOR_opt_feature 0x700UL + +#define OPTF_OFF 0x0 +#define OPTF_ON 0x1 + +/* If this feature is switched on, the hypervisor does inserting the + * tlb entries without calling the guests traphandler. + * This is usable in guests using region 7 for identity mapping like + * the linux kernel does. + */ +#define OPTF_IDENT_MAP_REG7 0x1UL + +struct xen_ia64_opt_feature { + unsigned long cmd; /* Which feature */ + unsigned char on; /* Switch feature on/off */ + union { + struct { + /* The page protection bit mask of the pte. + * This will be or'ed with the pte. */ + unsigned long pgprot; + unsigned long key; /* A protection key for itir. */ + }; + }; +}; + +#endif /* __ASSEMBLY__ */ + + /* xen perfmon */ #ifdef XEN #ifndef __ASSEMBLY__