[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] [IA64] Support special guest optimizations in the hypervisor



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1183994643 21600
# Node ID 56e84a427523b38a4aec928599ac837202449665
# Parent  e9426682eb0c31a8a4d25363eb2d180f493d01d5
[IA64] Support special guest optimizations in the hypervisor

Add the usage of the new hypervisor call HYPERVISOR_opt_feature() for
identity mapping region 7.

Signed-off-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
---
 arch/ia64/kernel/setup.c          |    9 +++++++++
 arch/ia64/xen/xcom_hcall.c        |    6 ++++++
 include/asm-ia64/hypercall.h      |    7 +++++++
 include/asm-ia64/xen/xcom_hcall.h |    2 ++
 include/xen/interface/arch-ia64.h |   35 +++++++++++++++++++++++++++++++++++
 5 files changed, 59 insertions(+)

diff -r e9426682eb0c -r 56e84a427523 arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c  Thu Jul 05 14:36:59 2007 -0600
+++ b/arch/ia64/kernel/setup.c  Mon Jul 09 09:24:03 2007 -0600
@@ -446,6 +446,8 @@ 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_init();
 
@@ -454,6 +456,13 @@ setup_arch (char **cmdline_p)
                atomic_notifier_chain_register(&panic_notifier_list,
                                               &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);
        }
 #endif
 
diff -r e9426682eb0c -r 56e84a427523 arch/ia64/xen/xcom_hcall.c
--- a/arch/ia64/xen/xcom_hcall.c        Thu Jul 05 14:36:59 2007 -0600
+++ b/arch/ia64/xen/xcom_hcall.c        Mon Jul 09 09:24:03 2007 -0600
@@ -397,6 +397,12 @@ xencomm_hypercall_vcpu_op(int cmd, int c
                                              xencomm_create_inline(arg));
 }
 
+long
+xencomm_hypercall_opt_feature(void *arg)
+{
+       return xencomm_arch_hypercall_opt_feature(xencomm_create_inline(arg));
+}
+
 int
 xencomm_hypercall_fpswa_revision(unsigned int *revision)
 {
diff -r e9426682eb0c -r 56e84a427523 include/asm-ia64/hypercall.h
--- a/include/asm-ia64/hypercall.h      Thu Jul 05 14:36:59 2007 -0600
+++ b/include/asm-ia64/hypercall.h      Mon Jul 09 09:24:03 2007 -0600
@@ -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(struct xencomm_handle *arg)
+{
+       return _hypercall1(long, opt_feature, 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 56e84a427523 include/asm-ia64/xen/xcom_hcall.h
--- a/include/asm-ia64/xen/xcom_hcall.h Thu Jul 05 14:36:59 2007 -0600
+++ b/include/asm-ia64/xen/xcom_hcall.h Mon Jul 09 09:24:03 2007 -0600
@@ -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(void *arg);
+
 /* Using mini xencomm.  */
 extern int xencomm_mini_hypercall_console_io(int cmd, int count, char *str);
 
diff -r e9426682eb0c -r 56e84a427523 include/xen/interface/arch-ia64.h
--- a/include/xen/interface/arch-ia64.h Thu Jul 05 14:36:59 2007 -0600
+++ b/include/xen/interface/arch-ia64.h Mon Jul 09 09:24:03 2007 -0600
@@ -558,6 +558,41 @@ 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 XEN_IA64_OPTF_OFF      0x0
+#define XEN_IA64_OPTF_ON       0x1
+
+/*
+ * If this feature is switched on, the hypervisor inserts the
+ * tlb entries without calling the guests traphandler.
+ * This is useful in guests using region 7 for identity mapping
+ * like the linux kernel does.
+ */
+#define XEN_IA64_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__

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.