WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64][MINIOS] PKR support

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64][MINIOS] PKR support
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Sep 2007 09:12:49 -0700
Delivery-date: Fri, 07 Sep 2007 09:16:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1185840869 21600
# Node ID d69a57b29e3fa38a044010c12f366f15244e4257
# Parent  57f519c41534de7448f8029df96917ffd71f6334
[IA64][MINIOS] PKR support

- adds optimization feature for region 7 identity mapping
- adds protection keys to region 5 and region 7 addresses,
  may be used for testing the hypervisor protection key support

Signed-off-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
---
 extras/mini-os/arch/ia64/common.c            |   21 ++++++++++++++++++++-
 extras/mini-os/arch/ia64/ia64.S              |   14 ++++++++++++--
 extras/mini-os/arch/ia64/ivt.S               |    4 ++--
 extras/mini-os/include/ia64/hypercall-ia64.h |   10 ++++++++++
 extras/mini-os/include/ia64/ia64_cpu.h       |    2 +-
 extras/mini-os/include/ia64/page.h           |    4 ++++
 6 files changed, 49 insertions(+), 6 deletions(-)

diff -r 57f519c41534 -r d69a57b29e3f extras/mini-os/arch/ia64/common.c
--- a/extras/mini-os/arch/ia64/common.c Mon Jul 30 16:51:52 2007 -0600
+++ b/extras/mini-os/arch/ia64/common.c Mon Jul 30 18:14:29 2007 -0600
@@ -103,7 +103,8 @@ map_pal_code(void)
         */
        ia64_ptc_l(machineFwG.ia64_pal_base, PTE_PS_16K);
        ia64_write_itr_i(&pte, IA64_TR_PAL,
-                        (uint64_t) machineFwG.ia64_pal_base, PTE_PS_16K, 0);
+                        (uint64_t)machineFwG.ia64_pal_base,
+                        PTE_PS_16K, IA64_KEY_REG7);
        xen_set_virtual_psr_ic(1);
 }
 
@@ -180,6 +181,21 @@ init_boot_params(void)
                bootverbose = 1;
 }
 
+static void
+set_opt_feature(void)
+{
+       struct xen_ia64_opt_feature optf;
+
+       optf.cmd = XEN_IA64_OPTF_IDENT_MAP_REG7;
+       optf.on = XEN_IA64_OPTF_ON;
+       optf.pgprot = ((1 << PTE_OFF_P) | (1 << PTE_OFF_A) | (1 << PTE_OFF_D) |
+                      (PTE_MA_WB << PTE_OFF_MA) |
+                      (PTE_PL_KERN << PTE_OFF_PL) |
+                      (PTE_AR_RW << PTE_OFF_AR));
+       optf.key = IA64_KEY_REG7;
+       HYPERVISOR_opt_feature(&optf);
+}
+
 void
 arch_init(start_info_t *si)
 {
@@ -213,6 +229,9 @@ arch_init(start_info_t *si)
                printk("efi_get_time() failed\n");
 
        registerCallback();
+
+       set_opt_feature();
+
        initialized = 1;
 }
 
diff -r 57f519c41534 -r d69a57b29e3f extras/mini-os/arch/ia64/ia64.S
--- a/extras/mini-os/arch/ia64/ia64.S   Mon Jul 30 16:51:52 2007 -0600
+++ b/extras/mini-os/arch/ia64/ia64.S   Mon Jul 30 18:14:29 2007 -0600
@@ -101,11 +101,21 @@ ENTRY(_start)
        ;;
        mov     rr[r3]=r2
        ;;
-
+       /*
+        * Setup protection keys for region 5 and 7.
+        */
+       mov     r2=(IA64_KEY_REG5 << IA64_PKR_KEY) | IA64_PKR_VALID
+       mov     r3=(IA64_KEY_REG7 << IA64_PKR_KEY) | IA64_PKR_VALID
+       mov     r14=0x1
+       ;;
+       mov     pkr[r0]=r2      /* Region 5 */
+       mov     pkr[r14]=r3     /* Region 7 */
+       ;;
        /*
         * Now pin mappings into the TLB for kernel text and data
         */
-       mov     r18=KERNEL_TR_PAGE_SIZE<<IA64_ITIR_PS
+       mov     r18=(KERNEL_TR_PAGE_SIZE<<IA64_ITIR_PS)| \
+                       (IA64_KEY_REG5<<IA64_ITIR_KEY)
        movl    r17=KERNEL_START
        ;;
        mov     cr.itir=r18
diff -r 57f519c41534 -r d69a57b29e3f extras/mini-os/arch/ia64/ivt.S
--- a/extras/mini-os/arch/ia64/ivt.S    Mon Jul 30 16:51:52 2007 -0600
+++ b/extras/mini-os/arch/ia64/ivt.S    Mon Jul 30 18:14:29 2007 -0600
@@ -249,7 +249,7 @@ ENTRY(save_tf_rse_switch)
                /* xen special handling for possibly lazy cover */
        movl    r8=XSI_PRECOVER_IFS;
        ;;
-       ld8     r21=[r8];
+       ld8     r21=[r8]
        ;;
 #if defined(BIG_ENDIAN)                        // swap because mini-os is in BE
        mux1    r21=r21,@rev
@@ -771,7 +771,7 @@ adt_reg7_addr:
         * addresses. Currently I don't do a check.
         */
        movl    r20=~((7 << IA64_RR_IDX_POS) | 0xfff)
-       movl    r18=((PTE_PS_16K<<IA64_ITIR_PS)|(0<<IA64_ITIR_KEY))
+       movl    r18=((PTE_PS_16K<<IA64_ITIR_PS)|(IA64_KEY_REG7<<IA64_ITIR_KEY))
        ;;
        movl    r19=    ((1<<PTE_OFF_P) | (PTE_MA_WB<<PTE_OFF_MA) | \
                         (1<<PTE_OFF_A) | (1<<PTE_OFF_D) | \
diff -r 57f519c41534 -r d69a57b29e3f 
extras/mini-os/include/ia64/hypercall-ia64.h
--- a/extras/mini-os/include/ia64/hypercall-ia64.h      Mon Jul 30 16:51:52 
2007 -0600
+++ b/extras/mini-os/include/ia64/hypercall-ia64.h      Mon Jul 30 18:14:29 
2007 -0600
@@ -223,4 +223,14 @@ xencomm_arch_hypercall_grant_table_op(un
 
 int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
 
+static inline int
+HYPERVISOR_opt_feature(void *arg)
+{
+       struct xencomm_handle *new_arg;
+
+       new_arg = xencomm_create_inline(arg);
+
+       return _hypercall1(int, opt_feature, new_arg);
+}
+
 #endif /* __HYPERCALL_H__ */
diff -r 57f519c41534 -r d69a57b29e3f extras/mini-os/include/ia64/ia64_cpu.h
--- a/extras/mini-os/include/ia64/ia64_cpu.h    Mon Jul 30 16:51:52 2007 -0600
+++ b/extras/mini-os/include/ia64/ia64_cpu.h    Mon Jul 30 18:14:29 2007 -0600
@@ -141,7 +141,7 @@
 #define MOS_IA64_PSR_BE        0
 #endif
 
-#define STARTUP_PSR (IA64_PSR_IT | \
+#define STARTUP_PSR (IA64_PSR_IT | IA64_PSR_PK | \
                     IA64_PSR_DT | IA64_PSR_RT | MOS_IA64_PSR_BE | \
                     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
 
diff -r 57f519c41534 -r d69a57b29e3f extras/mini-os/include/ia64/page.h
--- a/extras/mini-os/include/ia64/page.h        Mon Jul 30 16:51:52 2007 -0600
+++ b/extras/mini-os/include/ia64/page.h        Mon Jul 30 18:14:29 2007 -0600
@@ -99,6 +99,10 @@ extern paddr_t phys_avail[];
 #define KERN_VIRT_2_PHYS(x) (((x) - KERNEL_START) + \
                                (1 << KERNEL_PHYS_START_SHIFT))
 
+/* Some protection keys for region 5 and 7 addresses. */
+#define IA64_KEY_REG7  0x234   /* Region 7 - identity mapped addresses */
+#define IA64_KEY_REG5  0x89a   /* Region 5 - kernel addresses */
+
 // This is xen specific !
 #define PAGE_SHIFT_XEN_16K     14      // For 16KB page size
 #define mfn_to_virt(mfn)       ((void*)__va((mfn) << PAGE_SHIFT_XEN_16K))

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64][MINIOS] PKR support, Xen patchbot-unstable <=