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-ia64-devel

[Xen-ia64-devel] [PATCH 11/16] domheap: Don't pin xenheap down.

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 11/16] domheap: Don't pin xenheap down.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Mon, 7 Jan 2008 16:52:34 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Sun, 06 Jan 2008 23:55:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1198815001 -32400
# Node ID 96e207574e536b5ac029e2a1c57ca20ad879a72f
# Parent  2767d660e895dd4a62930d26b698f86affbe2256
Don't pin xenheap down. Now it's unnecessary.
PATCHNAME: dont_pin_down_xenheap

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/linux-xen/entry.S
--- a/xen/arch/ia64/linux-xen/entry.S   Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/linux-xen/entry.S   Fri Dec 28 13:10:01 2007 +0900
@@ -256,33 +256,6 @@ GLOBAL_ENTRY(ia64_switch_to)
        br.ret.sptk.many rp             // boogie on out in new context
 
 .map:
-#ifdef XEN
-       // in0: next in virtual address which must be in 
-       //      the xen identity mapping area.
-       // r20: physical address of next
-       // r22: ksp offset: used: don't overwrite. will be used later
-       // r24: = THIS_CPU(cpu_kr)+IA64_KR_CURRENT_STACK_OFFSET
-       // r26: (physical address of next) >> IA64_GRANULE_SHIFT
-       //
-       // r8: return value
-       // r13:  thread pointer
-       // r21:  thread pointer for VTi domain ??? can be removed?
-       
-       // avoid overlapping with xenheap TR
-       mov r28=ip                      // get kernel tr area
-       ;;
-       tpa r27=r28                     // convert to physical address
-       ;;
-       dep r25=0,r27,0,KERNEL_TR_PAGE_SHIFT
-       dep r23=0,r20,0,KERNEL_TR_PAGE_SHIFT
-       ;;
-       cmp.eq p7,p6=r25,r23
-       mov r28=-1
-       ;;
-(p7)   st8 [r24]=r28                   // remember we don't map stack.
-(p7)   br.cond.sptk .done
-       ;;
-#endif
        rsm psr.ic                      // interrupts (psr.i) are already 
disabled here
        movl r25=PAGE_KERNEL
 #ifdef XEN     
diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/linux-xen/head.S
--- a/xen/arch/ia64/linux-xen/head.S    Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/linux-xen/head.S    Fri Dec 28 13:10:01 2007 +0900
@@ -263,16 +263,6 @@ start_ap:
        itr.d dtr[r16]=r18
        ;;
        srlz.i
-       ;;
-       /* XEN HEAP is identity mapped */
-       mov r16 = IA64_TR_XEN_HEAP_REGS
-       dep r17 = -1, r2, 60, 4
-       ;;
-       mov cr.ifa = r17
-       ;;
-       itr.d dtr[r16]=r18
-       ;;
-       srlz.i
 
        /*
         * Switch into virtual mode:
@@ -335,20 +325,7 @@ 1: // now we are in virtual mode
        ;;
        tpa r3=r2               // r3 == phys addr of task struct
        mov r16=-1
-#ifdef XEN
-       ;;
-       dep r2=-1,r3,60,4       // IMVA of task 
-       // XEN: check overlap with XENHEAP
-       mov r17=ip
-       ;;
-       tpa r17=r17
-       ;;
-       dep r17=0,r17,0,KERNEL_TR_PAGE_SHIFT
-       dep r18=0,r3,0,KERNEL_TR_PAGE_SHIFT
-       ;;
-       cmp.eq p4,p0=r17,r18
-(p4)   br.cond.dpnt .load_current
-#else
+#ifndef XEN
 (isBP) br.cond.dpnt .load_current // BP stack is on region 5 --- no need to 
map it
 #endif
 
@@ -360,7 +337,9 @@ 1:  // now we are in virtual mode
        dep r18=0,r3,0,12
        ;;
        or r18=r17,r18
-#ifndef XEN
+#ifdef XEN
+       dep r2=-1,r3,60,4       // IMVA of task 
+#else
        dep r2=-1,r3,61,3       // IMVA of task
 #endif
        ;;
diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/linux-xen/mca_asm.S
--- a/xen/arch/ia64/linux-xen/mca_asm.S Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/linux-xen/mca_asm.S Fri Dec 28 13:10:01 2007 +0900
@@ -279,19 +279,6 @@ 4:
        ;;
        srlz.d
        ;;
-#ifdef XEN
-       /* xen heap is identity mapped */
-       mov r19=ip
-       ;; 
-       dep r17=0,r19,0,KERNEL_TR_PAGE_SHIFT
-       ;; 
-       dep r17=-1,r17,60,4
-       ;; 
-       ptr.d r17,r18
-       ;;
-       srlz.d
-       ;; 
-#endif
        // 2. Purge DTR for PERCPU data.
        movl r16=PERCPU_ADDR
        mov r18=PERCPU_PAGE_SHIFT<<2
@@ -427,18 +414,6 @@ ia64_reload_tr:
        srlz.i
        srlz.d
        ;;
-#ifdef XEN
-       /* xen heap is identity mapped */
-       mov r16=IA64_TR_XEN_HEAP_REGS  
-       dep r17=-1,r17,60,4
-       ;; 
-       mov cr.ifa=r17
-       ;;
-       itr.d dtr[r16]=r18
-       ;;
-       srlz.d
-       ;; 
-#endif
        // 2. Reload DTR register for PERCPU data.
        GET_THIS_PADDR(r2, ia64_mca_per_cpu_pte)
        ;;
@@ -475,29 +450,12 @@ ia64_reload_tr:
        ;;
        // 4. Reload DTR for stack.
 #ifdef XEN
-       // avoid overlapping with xenheap TR
-       mov r17=ip
-       ;;
-       dep r17=0,r17,0,KERNEL_TR_PAGE_SHIFT
-       ;;
-       shr.u r17=r17,IA64_GRANULE_SHIFT
-       ;; 
        // Kernel registers are saved in a per_cpu cpu_kr_ia64_t
        // to allow the kernel registers themselves to be used by domains.
        GET_THIS_PADDR(r2, cpu_kr);;
        add r2=IA64_KR_CURRENT_STACK_OFFSET,r2
        ;;
        ld8 r16=[r2]
-       ;;
-#if KERNEL_TR_PAGE_SHIFT < IA64_GRANULE_SHIFT
-# error "KERNEL_TR_PAGE_SHIFT < IA64_GRANULE_SHIFT shouldn't happen"
-#endif
-#if KERNEL_TR_PAGE_SHIFT > IA64_GRANULE_SHIFT
-       dep  r18=0,r16,0,KERNEL_TR_PAGE_SHIFT-IA64_GRANULE_SHIFT
-       ;;
-#endif
-       cmp.eq p7,p0=r17,r18
-(p7)   br.cond.sptk    .reload_vhpt
 #else
        mov r16=IA64_KR(CURRENT_STACK)
 #endif
@@ -524,16 +482,6 @@ ia64_reload_tr:
        // 5. VHPT
 #if VHPT_ENABLED
        GET_VA_VCPU_VHPT_MADDR(r2,r3);;
-       dep r3=0,r2,0,KERNEL_TR_PAGE_SHIFT
-       ;; 
-       dep r3=0,r3,60,4                // physical address of
-                                       // va_vhpt & ~(KERNEL_TR_PAGE_SHIFT - 1)
-       ;;
-       shr.u r3=r3,IA64_GRANULE_SHIFT
-       ;;
-       cmp.eq p7,p0=r3,r17
-(p7)   br.cond.sptk    .overlap_vhpt
-       ;;
 
        // avoid overlapping with stack TR
        shr.u r17=r2,IA64_GRANULE_SHIFT
diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/vmx/vmx_entry.S
--- a/xen/arch/ia64/vmx/vmx_entry.S     Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_entry.S     Fri Dec 28 13:10:01 2007 +0900
@@ -686,26 +686,10 @@ 1:
        ;;
        itr.d dtr[r16]=r24
        ;;
-       /* xen heap is also identity mapped */
-       mov r16 = IA64_TR_XEN_HEAP_REGS
-       dep r17=-1,r3,60,4
-       ;;
-       ptr.d r17, r18
-       ;;
-       mov cr.ifa=r17
-       ;;
-       itr.d dtr[r16]=r24
-       ;;
 
        // re-pin mapping for stack (current)
-       // unless overlaps with IA64_TR_XEN_HEAP_REGS
        mov r26=IA64_GRANULE_SHIFT<<2
        dep r21=0,r13,60,4              // physical address of "current"
-       ;;
-       dep r3=0,r21,0,KERNEL_TR_PAGE_SHIFT
-       ;; 
-       cmp.eq p7,p0=r2,r3
-(p7)   br.cond.sptk .stack_overlaps
        ;;
        ptr.d   r13,r26
        or r23=r21,r25                  // construct PA | page properties
@@ -714,7 +698,6 @@ 1:
        mov r18=IA64_TR_CURRENT_STACK
        ;;
        itr.d dtr[r18]=r23              // wire in new mapping...
-.stack_overlaps:
 
        // re-pin mappings for per-cpu data
        movl r22 = PERCPU_ADDR
@@ -732,16 +715,13 @@ 1:
        ;;
 
        // re-pin mappings for guest_vhpt
-       // unless overlaps with IA64_TR_XEN_HEAP_REGS or IA64_TR_CURRENT_STACK
-       dep r18=0,loc5,0,KERNEL_TR_PAGE_SHIFT
+       // unless overlaps with IA64_TR_CURRENT_STACK
        // r21 = (current physical addr) & (IA64_GRANULE_SIZE - 1)
        dep r21=0,r21,0,IA64_GRANULE_SHIFT 
        // r17 = (guest_vhpt physical addr) & (IA64_GRANULE_SIZE - 1)
        dep r17=0,loc5,0,IA64_GRANULE_SHIFT 
        ;;
-       cmp.eq p6,p0=r18,r2             // check overlap with xen heap
        cmp.eq p7,p0=r17,r21            // check overlap with current stack
-(p6)   br.cond.sptk .vhpt_overlaps
 (p7)   br.cond.sptk .vhpt_overlaps
        mov r24=IA64_TR_VHPT
        ;;
@@ -773,18 +753,11 @@ 1:
        // r16, r19, r20 are used by
        //  ia64_switch_mode_phys()/ia64_switch_mode_virt()
        // re-pin mappings for privregs
-       // r2   = ia64_tpa(ip) & (KERNEL_TR_PAGE_SIZE - 1)
        // r21  = (current physical addr) & (IA64_GRANULE_SIZE - 1)
        // r17  = (guest_vhpt physical addr) & (IA64_GRANULE_SIZE - 1)
-
-       // r24  = (privregs physical addr) & (KERNEL_TR_PAGE_SIZE - 1)
        // loc6 = (((pal phys addr) & (IA64_GRANULE_SIZE - 1) << 2)) | 
PAGE_KERNEL
        // loc7 = (privregs physical addr) & (IA64_GRANULE_SIZE - 1)
-       dep r24 = 0,loc7,0,KERNEL_TR_PAGE_SHIFT
-       ;;
-       cmp.ne p6,p0=r24,r2             // check overlap with xen heap
-       ;; 
-(p6)   cmp.ne.unc p7,p0=r21,loc7       // check overlap with current stack
+       cmp.ne.unc p7,p0=r21,loc7       // check overlap with current stack
        ;;
 (p7)   cmp.ne.unc p8,p0=r17,loc7       // check overlap with guest_vhpt
        ;;
@@ -805,7 +778,6 @@ 1:
        ;;
 (p8)   itr.d dtr[r24]=loc7         // wire in new mapping...
        ;;
-.privregs_overlaps:
 
        // done, switch back to virtual and return
        mov r16=loc4                    // r16= original psr
diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c      Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_init.c      Fri Dec 28 13:10:01 2007 +0900
@@ -210,13 +210,6 @@ __vmx_vpd_pin(struct vcpu* v)
        unsigned long privregs = (unsigned long)v->arch.privregs;
        u64 psr;
        
-       // check overlapping with xenheap
-       if ((privregs &
-            ~(KERNEL_TR_PAGE_SIZE - 1)) ==
-           ((unsigned long)__va(ia64_tpa(current_text_addr())) &
-            ~(KERNEL_TR_PAGE_SIZE - 1)))
-               return;
-               
        privregs &= ~(IA64_GRANULE_SIZE - 1);
 
        // check overlapping with current stack
diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/xen/xenasm.S
--- a/xen/arch/ia64/xen/xenasm.S        Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/xen/xenasm.S        Fri Dec 28 13:10:01 2007 +0900
@@ -93,22 +93,8 @@ 1:
        ;; 
        itr.d dtr[r16]=r18
        ;;
-       /* xen heap is also identity mapped */
-       mov r16 = IA64_TR_XEN_HEAP_REGS  
-       dep r17=-1,loc6,60,4
-       ;;
-       ptr.d r17,r24
-       ;;
-       mov cr.ifa=r17
-       ;;
-       itr.d dtr[r16]=r18
-       ;;
+
        // re-pin mappings for stack (current)
-       // unless overlaps with IA64_TR_XEN_HEAP_REGS
-       dep r18=0,r13,0,KERNEL_TR_PAGE_SHIFT
-       ;;
-       cmp.eq p7,p0=r17,r18
-(p7)   br.cond.sptk    .stack_overlaps
        mov r25=IA64_GRANULE_SHIFT<<2
        dep r21=0,r13,60,4              // physical address of "current"
        ;;
@@ -121,7 +107,6 @@ 1:
        itr.d dtr[r21]=r23              // wire in new mapping...
 
        //  Per-cpu     
-.stack_overlaps:
        mov r24=PERCPU_PAGE_SHIFT<<2
        movl r22=PERCPU_ADDR
        ;;
@@ -138,14 +123,11 @@ 1:
 #if IA64_GRANULE_SHIFT < VHPT_SIZE_LOG2
 #error "it must be that VHPT_SIZE_LOG2 <= IA64_GRANULE_SHIFT"
 #endif 
-       // unless overlaps with KERNEL_TR and IA64_TR_CURRENT_STACK
-       dep r14=0,in4,0,KERNEL_TR_PAGE_SHIFT
+       // unless overlaps with IA64_TR_CURRENT_STACK
        dep r15=0,in4,0,IA64_GRANULE_SHIFT
        dep r21=0,r13,0,IA64_GRANULE_SHIFT
        ;;
-       cmp.eq p7,p0=r17,r14
        cmp.eq p8,p0=r15,r21
-(p7)   br.cond.sptk    .vhpt_overlaps
 (p8)   br.cond.sptk    .vhpt_overlaps
        mov r21=IA64_TR_VHPT
        dep r22=0,r15,60,4              // physical address of
diff -r 2767d660e895 -r 96e207574e53 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/arch/ia64/xen/xensetup.c      Fri Dec 28 13:10:01 2007 +0900
@@ -328,7 +328,7 @@ void __init start_kernel(void)
     }
 
     printk("Xen command line: %s\n", saved_command_line);
-    /* xenheap should be in same TR-covered range with xen image */
+
     xenheap_phys_end = xen_pstart + xenheap_size;
     printk("xen image pstart: 0x%lx, xenheap pend: 0x%lx\n",
            xen_pstart, xenheap_phys_end);
diff -r 2767d660e895 -r 96e207574e53 xen/include/asm-ia64/xenkregs.h
--- a/xen/include/asm-ia64/xenkregs.h   Tue Dec 25 21:10:59 2007 +0900
+++ b/xen/include/asm-ia64/xenkregs.h   Fri Dec 28 13:10:01 2007 +0900
@@ -4,10 +4,9 @@
 /*
  * Translation registers:
  */
-#define IA64_TR_XEN_HEAP_REGS  3       /* dtr3: xen heap identity mapped regs 
*/
+#define IA64_TR_MAPPED_REGS    3       /* dtr3: vcpu mapped regs */
 #define IA64_TR_SHARED_INFO    4       /* dtr4: page shared with domain */
-#define IA64_TR_MAPPED_REGS    5       /* dtr5: vcpu mapped regs */
-#define        IA64_TR_VHPT            6       /* dtr6: vhpt */
+#define IA64_TR_VHPT           5       /* dtr5: vhpt */
 
 #define IA64_TR_VPD            2       /* itr2: vpd */
 

Attachment: 16705_96e207574e53_dont_pin_down_xenheap.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 11/16] domheap: Don't pin xenheap down., Isaku Yamahata <=