ia64/xen-unstable

changeset 16785:af3550f53874

[IA64] domheap: Don't pin xenheap down. Now it's unnecessary.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Jan 17 12:05:43 2008 -0700 (2008-01-17)
parents 6a7fa7dbde56
children a739d3edc185
files xen/arch/ia64/linux-xen/entry.S xen/arch/ia64/linux-xen/head.S xen/arch/ia64/linux-xen/mca_asm.S xen/arch/ia64/vmx/vmx_entry.S xen/arch/ia64/vmx/vmx_init.c xen/arch/ia64/xen/xenasm.S xen/arch/ia64/xen/xensetup.c xen/include/asm-ia64/xenkregs.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/entry.S	Thu Jan 17 12:05:43 2008 -0700
     1.2 +++ b/xen/arch/ia64/linux-xen/entry.S	Thu Jan 17 12:05:43 2008 -0700
     1.3 @@ -256,33 +256,6 @@ GLOBAL_ENTRY(ia64_switch_to)
     1.4  	br.ret.sptk.many rp		// boogie on out in new context
     1.5  
     1.6  .map:
     1.7 -#ifdef XEN
     1.8 -	// in0:	next in virtual address which must be in 
     1.9 -	//      the xen identity mapping area.
    1.10 -	// r20:	physical address of next
    1.11 -	// r22:	ksp offset: used: don't overwrite. will be used later
    1.12 -	// r24:	= THIS_CPU(cpu_kr)+IA64_KR_CURRENT_STACK_OFFSET
    1.13 -	// r26:	(physical address of next) >> IA64_GRANULE_SHIFT
    1.14 -	//
    1.15 -	// r8: return value
    1.16 -	// r13:	 thread pointer
    1.17 -	// r21:	 thread pointer for VTi domain ??? can be removed?
    1.18 -	
    1.19 -	// avoid overlapping with xenheap TR
    1.20 -	mov r28=ip			// get kernel tr area
    1.21 -	;;
    1.22 -	tpa r27=r28			// convert to physical address
    1.23 -	;;
    1.24 -	dep r25=0,r27,0,KERNEL_TR_PAGE_SHIFT
    1.25 -	dep r23=0,r20,0,KERNEL_TR_PAGE_SHIFT
    1.26 -	;;
    1.27 -	cmp.eq p7,p6=r25,r23
    1.28 -	mov r28=-1
    1.29 -	;;
    1.30 -(p7)	st8 [r24]=r28			// remember we don't map stack.
    1.31 -(p7)	br.cond.sptk .done
    1.32 -	;;
    1.33 -#endif
    1.34  	rsm psr.ic			// interrupts (psr.i) are already disabled here
    1.35  	movl r25=PAGE_KERNEL
    1.36  #ifdef XEN	
     2.1 --- a/xen/arch/ia64/linux-xen/head.S	Thu Jan 17 12:05:43 2008 -0700
     2.2 +++ b/xen/arch/ia64/linux-xen/head.S	Thu Jan 17 12:05:43 2008 -0700
     2.3 @@ -263,16 +263,6 @@ start_ap:
     2.4  	itr.d dtr[r16]=r18
     2.5  	;;
     2.6  	srlz.i
     2.7 -	;;
     2.8 -	/* XEN HEAP is identity mapped */
     2.9 -	mov r16 = IA64_TR_XEN_HEAP_REGS
    2.10 -	dep r17 = -1, r2, 60, 4
    2.11 -	;;
    2.12 -	mov cr.ifa = r17
    2.13 -	;;
    2.14 -	itr.d dtr[r16]=r18
    2.15 -	;;
    2.16 -	srlz.i
    2.17  
    2.18  	/*
    2.19  	 * Switch into virtual mode:
    2.20 @@ -335,20 +325,7 @@ 1:	// now we are in virtual mode
    2.21  	;;
    2.22  	tpa r3=r2		// r3 == phys addr of task struct
    2.23  	mov r16=-1
    2.24 -#ifdef XEN
    2.25 -	;;
    2.26 -	dep r2=-1,r3,60,4	// IMVA of task	
    2.27 -	// XEN:	check overlap with XENHEAP
    2.28 -	mov r17=ip
    2.29 -	;;
    2.30 -	tpa r17=r17
    2.31 -	;;
    2.32 -	dep r17=0,r17,0,KERNEL_TR_PAGE_SHIFT
    2.33 -	dep r18=0,r3,0,KERNEL_TR_PAGE_SHIFT
    2.34 -	;;
    2.35 -	cmp.eq p4,p0=r17,r18
    2.36 -(p4)	br.cond.dpnt .load_current
    2.37 -#else
    2.38 +#ifndef XEN
    2.39  (isBP)	br.cond.dpnt .load_current // BP stack is on region 5 --- no need to map it
    2.40  #endif
    2.41  
    2.42 @@ -360,7 +337,9 @@ 1:	// now we are in virtual mode
    2.43  	dep r18=0,r3,0,12
    2.44  	;;
    2.45  	or r18=r17,r18
    2.46 -#ifndef XEN
    2.47 +#ifdef XEN
    2.48 +	dep r2=-1,r3,60,4       // IMVA of task 
    2.49 +#else
    2.50  	dep r2=-1,r3,61,3	// IMVA of task
    2.51  #endif
    2.52  	;;
     3.1 --- a/xen/arch/ia64/linux-xen/mca_asm.S	Thu Jan 17 12:05:43 2008 -0700
     3.2 +++ b/xen/arch/ia64/linux-xen/mca_asm.S	Thu Jan 17 12:05:43 2008 -0700
     3.3 @@ -279,19 +279,6 @@ 4:
     3.4  	;;
     3.5  	srlz.d
     3.6  	;;
     3.7 -#ifdef XEN
     3.8 -	/* xen heap is identity mapped */
     3.9 -	mov r19=ip
    3.10 -	;; 
    3.11 -	dep r17=0,r19,0,KERNEL_TR_PAGE_SHIFT
    3.12 -	;; 
    3.13 -	dep r17=-1,r17,60,4
    3.14 -	;; 
    3.15 -	ptr.d r17,r18
    3.16 -	;;
    3.17 -	srlz.d
    3.18 -	;; 
    3.19 -#endif
    3.20  	// 2. Purge DTR for PERCPU data.
    3.21  	movl r16=PERCPU_ADDR
    3.22  	mov r18=PERCPU_PAGE_SHIFT<<2
    3.23 @@ -427,18 +414,6 @@ ia64_reload_tr:
    3.24  	srlz.i
    3.25  	srlz.d
    3.26  	;;
    3.27 -#ifdef XEN
    3.28 -	/* xen heap is identity mapped */
    3.29 -	mov r16=IA64_TR_XEN_HEAP_REGS  
    3.30 -	dep r17=-1,r17,60,4
    3.31 -	;; 
    3.32 -	mov cr.ifa=r17
    3.33 -	;;
    3.34 -	itr.d dtr[r16]=r18
    3.35 -	;;
    3.36 -	srlz.d
    3.37 -	;; 
    3.38 -#endif
    3.39  	// 2. Reload DTR register for PERCPU data.
    3.40  	GET_THIS_PADDR(r2, ia64_mca_per_cpu_pte)
    3.41  	;;
    3.42 @@ -475,29 +450,12 @@ ia64_reload_tr:
    3.43  	;;
    3.44  	// 4. Reload DTR for stack.
    3.45  #ifdef XEN
    3.46 -	// avoid overlapping with xenheap TR
    3.47 -	mov r17=ip
    3.48 -	;;
    3.49 -	dep r17=0,r17,0,KERNEL_TR_PAGE_SHIFT
    3.50 -	;;
    3.51 -	shr.u r17=r17,IA64_GRANULE_SHIFT
    3.52 -	;; 
    3.53  	// Kernel registers are saved in a per_cpu cpu_kr_ia64_t
    3.54  	// to allow the kernel registers themselves to be used by domains.
    3.55  	GET_THIS_PADDR(r2, cpu_kr);;
    3.56  	add r2=IA64_KR_CURRENT_STACK_OFFSET,r2
    3.57  	;;
    3.58  	ld8 r16=[r2]
    3.59 -	;;
    3.60 -#if KERNEL_TR_PAGE_SHIFT < IA64_GRANULE_SHIFT
    3.61 -# error "KERNEL_TR_PAGE_SHIFT < IA64_GRANULE_SHIFT shouldn't happen"
    3.62 -#endif
    3.63 -#if KERNEL_TR_PAGE_SHIFT > IA64_GRANULE_SHIFT
    3.64 -	dep  r18=0,r16,0,KERNEL_TR_PAGE_SHIFT-IA64_GRANULE_SHIFT
    3.65 -	;;
    3.66 -#endif
    3.67 -	cmp.eq p7,p0=r17,r18
    3.68 -(p7)	br.cond.sptk	.reload_vhpt
    3.69  #else
    3.70  	mov r16=IA64_KR(CURRENT_STACK)
    3.71  #endif
    3.72 @@ -524,16 +482,6 @@ ia64_reload_tr:
    3.73  	// 5. VHPT
    3.74  #if VHPT_ENABLED
    3.75  	GET_VA_VCPU_VHPT_MADDR(r2,r3);;
    3.76 -	dep r3=0,r2,0,KERNEL_TR_PAGE_SHIFT
    3.77 -	;; 
    3.78 -	dep r3=0,r3,60,4		// physical address of
    3.79 -	                                // va_vhpt & ~(KERNEL_TR_PAGE_SHIFT - 1)
    3.80 -	;;
    3.81 -	shr.u r3=r3,IA64_GRANULE_SHIFT
    3.82 -	;;
    3.83 -	cmp.eq p7,p0=r3,r17
    3.84 -(p7)	br.cond.sptk	.overlap_vhpt
    3.85 -	;;
    3.86  
    3.87  	// avoid overlapping with stack TR
    3.88  	shr.u r17=r2,IA64_GRANULE_SHIFT
     4.1 --- a/xen/arch/ia64/vmx/vmx_entry.S	Thu Jan 17 12:05:43 2008 -0700
     4.2 +++ b/xen/arch/ia64/vmx/vmx_entry.S	Thu Jan 17 12:05:43 2008 -0700
     4.3 @@ -693,27 +693,11 @@ 1:
     4.4  	;;
     4.5  	itr.d dtr[r16]=r24
     4.6  	;;
     4.7 -	/* xen heap is also identity mapped */
     4.8 -	mov r16 = IA64_TR_XEN_HEAP_REGS
     4.9 -	dep r17=-1,r3,60,4
    4.10 -	;;
    4.11 -	ptr.d r17, r18
    4.12 -	;;
    4.13 -	mov cr.ifa=r17
    4.14 -	;;
    4.15 -	itr.d dtr[r16]=r24
    4.16 -	;;
    4.17  
    4.18  	// re-pin mapping for stack (current)
    4.19 -	// unless overlaps with IA64_TR_XEN_HEAP_REGS
    4.20  	mov r26=IA64_GRANULE_SHIFT<<2
    4.21  	dep r21=0,r13,60,4              // physical address of "current"
    4.22  	;;
    4.23 -	dep r3=0,r21,0,KERNEL_TR_PAGE_SHIFT
    4.24 -	;; 
    4.25 -	cmp.eq p7,p0=r2,r3
    4.26 -(p7)	br.cond.sptk .stack_overlaps
    4.27 -	;;
    4.28  	ptr.d   r13,r26
    4.29  	or r23=r21,r25                  // construct PA | page properties
    4.30  	mov cr.itir=r26
    4.31 @@ -721,7 +705,6 @@ 1:
    4.32  	mov r18=IA64_TR_CURRENT_STACK
    4.33  	;;
    4.34  	itr.d dtr[r18]=r23              // wire in new mapping...
    4.35 -.stack_overlaps:
    4.36  
    4.37  	// re-pin mappings for per-cpu data
    4.38  	movl r22 = PERCPU_ADDR
    4.39 @@ -739,16 +722,13 @@ 1:
    4.40  	;;
    4.41  
    4.42  	// re-pin mappings for guest_vhpt
    4.43 -	// unless overlaps with IA64_TR_XEN_HEAP_REGS or IA64_TR_CURRENT_STACK
    4.44 -	dep r18=0,loc5,0,KERNEL_TR_PAGE_SHIFT
    4.45 +	// unless overlaps with IA64_TR_CURRENT_STACK
    4.46  	// r21 = (current physical addr) & (IA64_GRANULE_SIZE - 1)
    4.47  	dep r21=0,r21,0,IA64_GRANULE_SHIFT 
    4.48  	// r17 = (guest_vhpt physical addr) & (IA64_GRANULE_SIZE - 1)
    4.49  	dep r17=0,loc5,0,IA64_GRANULE_SHIFT 
    4.50  	;;
    4.51 -	cmp.eq p6,p0=r18,r2             // check overlap with xen heap
    4.52  	cmp.eq p7,p0=r17,r21            // check overlap with current stack
    4.53 -(p6)	br.cond.sptk .vhpt_overlaps
    4.54  (p7)	br.cond.sptk .vhpt_overlaps
    4.55  	mov r24=IA64_TR_VHPT
    4.56  	;;
    4.57 @@ -780,18 +760,11 @@ 1:
    4.58  	// r16, r19, r20 are used by
    4.59  	//  ia64_switch_mode_phys()/ia64_switch_mode_virt()
    4.60  	// re-pin mappings for privregs
    4.61 -	// r2   = ia64_tpa(ip) & (KERNEL_TR_PAGE_SIZE - 1)
    4.62  	// r21  = (current physical addr) & (IA64_GRANULE_SIZE - 1)
    4.63  	// r17  = (guest_vhpt physical addr) & (IA64_GRANULE_SIZE - 1)
    4.64 -
    4.65 -	// r24  = (privregs physical addr) & (KERNEL_TR_PAGE_SIZE - 1)
    4.66  	// loc6 = (((pal phys addr) & (IA64_GRANULE_SIZE - 1) << 2)) | PAGE_KERNEL
    4.67  	// loc7 = (privregs physical addr) & (IA64_GRANULE_SIZE - 1)
    4.68 -	dep r24 = 0,loc7,0,KERNEL_TR_PAGE_SHIFT
    4.69 -	;;
    4.70 -	cmp.ne p6,p0=r24,r2		// check overlap with xen heap
    4.71 -	;; 
    4.72 -(p6)	cmp.ne.unc p7,p0=r21,loc7	// check overlap with current stack
    4.73 +	cmp.ne.unc p7,p0=r21,loc7	// check overlap with current stack
    4.74  	;;
    4.75  (p7)	cmp.ne.unc p8,p0=r17,loc7	// check overlap with guest_vhpt
    4.76  	;;
    4.77 @@ -812,7 +785,6 @@ 1:
    4.78  	;;
    4.79  (p8)	itr.d dtr[r24]=loc7         // wire in new mapping...
    4.80  	;;
    4.81 -.privregs_overlaps:
    4.82  
    4.83  	// done, switch back to virtual and return
    4.84  	mov r16=loc4                    // r16= original psr
     5.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Thu Jan 17 12:05:43 2008 -0700
     5.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Thu Jan 17 12:05:43 2008 -0700
     5.3 @@ -210,13 +210,6 @@ void
     5.4  	unsigned long privregs = (unsigned long)v->arch.privregs;
     5.5  	u64 psr;
     5.6  	
     5.7 -	// check overlapping with xenheap
     5.8 -	if ((privregs &
     5.9 -	     ~(KERNEL_TR_PAGE_SIZE - 1)) ==
    5.10 -	    ((unsigned long)__va(ia64_tpa(current_text_addr())) &
    5.11 -	     ~(KERNEL_TR_PAGE_SIZE - 1)))
    5.12 -		return;
    5.13 -		
    5.14  	privregs &= ~(IA64_GRANULE_SIZE - 1);
    5.15  
    5.16  	// check overlapping with current stack
     6.1 --- a/xen/arch/ia64/xen/xenasm.S	Thu Jan 17 12:05:43 2008 -0700
     6.2 +++ b/xen/arch/ia64/xen/xenasm.S	Thu Jan 17 12:05:43 2008 -0700
     6.3 @@ -93,22 +93,8 @@ 1:
     6.4  	;; 
     6.5  	itr.d dtr[r16]=r18
     6.6  	;;
     6.7 -	/* xen heap is also identity mapped */
     6.8 -	mov r16 = IA64_TR_XEN_HEAP_REGS  
     6.9 -	dep r17=-1,loc6,60,4
    6.10 -	;;
    6.11 -	ptr.d r17,r24
    6.12 -	;;
    6.13 -	mov cr.ifa=r17
    6.14 -	;;
    6.15 -	itr.d dtr[r16]=r18
    6.16 -	;;
    6.17 +
    6.18  	// re-pin mappings for stack (current)
    6.19 -	// unless overlaps with IA64_TR_XEN_HEAP_REGS
    6.20 -	dep r18=0,r13,0,KERNEL_TR_PAGE_SHIFT
    6.21 -	;;
    6.22 -	cmp.eq p7,p0=r17,r18
    6.23 -(p7)	br.cond.sptk	.stack_overlaps
    6.24  	mov r25=IA64_GRANULE_SHIFT<<2
    6.25  	dep r21=0,r13,60,4		// physical address of "current"
    6.26  	;;
    6.27 @@ -121,7 +107,6 @@ 1:
    6.28  	itr.d dtr[r21]=r23		// wire in new mapping...
    6.29  
    6.30  	//  Per-cpu	
    6.31 -.stack_overlaps:
    6.32  	mov r24=PERCPU_PAGE_SHIFT<<2
    6.33  	movl r22=PERCPU_ADDR
    6.34  	;;
    6.35 @@ -138,14 +123,11 @@ 1:
    6.36  #if IA64_GRANULE_SHIFT < VHPT_SIZE_LOG2
    6.37  #error "it must be that VHPT_SIZE_LOG2 <= IA64_GRANULE_SHIFT"
    6.38  #endif	
    6.39 -	// unless overlaps with KERNEL_TR and IA64_TR_CURRENT_STACK
    6.40 -	dep r14=0,in4,0,KERNEL_TR_PAGE_SHIFT
    6.41 +	// unless overlaps with IA64_TR_CURRENT_STACK
    6.42  	dep r15=0,in4,0,IA64_GRANULE_SHIFT
    6.43  	dep r21=0,r13,0,IA64_GRANULE_SHIFT
    6.44  	;;
    6.45 -	cmp.eq p7,p0=r17,r14
    6.46  	cmp.eq p8,p0=r15,r21
    6.47 -(p7)	br.cond.sptk	.vhpt_overlaps
    6.48  (p8)	br.cond.sptk	.vhpt_overlaps
    6.49  	mov r21=IA64_TR_VHPT
    6.50  	dep r22=0,r15,60,4		// physical address of
     7.1 --- a/xen/arch/ia64/xen/xensetup.c	Thu Jan 17 12:05:43 2008 -0700
     7.2 +++ b/xen/arch/ia64/xen/xensetup.c	Thu Jan 17 12:05:43 2008 -0700
     7.3 @@ -328,7 +328,7 @@ void __init start_kernel(void)
     7.4      }
     7.5  
     7.6      printk("Xen command line: %s\n", saved_command_line);
     7.7 -    /* xenheap should be in same TR-covered range with xen image */
     7.8 +
     7.9      xenheap_phys_end = xen_pstart + xenheap_size;
    7.10      printk("xen image pstart: 0x%lx, xenheap pend: 0x%lx\n",
    7.11             xen_pstart, xenheap_phys_end);
     8.1 --- a/xen/include/asm-ia64/xenkregs.h	Thu Jan 17 12:05:43 2008 -0700
     8.2 +++ b/xen/include/asm-ia64/xenkregs.h	Thu Jan 17 12:05:43 2008 -0700
     8.3 @@ -4,10 +4,9 @@
     8.4  /*
     8.5   * Translation registers:
     8.6   */
     8.7 -#define IA64_TR_XEN_HEAP_REGS	3	/* dtr3: xen heap identity mapped regs */
     8.8 +#define IA64_TR_MAPPED_REGS	3	/* dtr3: vcpu mapped regs */
     8.9  #define IA64_TR_SHARED_INFO	4	/* dtr4: page shared with domain */
    8.10 -#define IA64_TR_MAPPED_REGS	5	/* dtr5: vcpu mapped regs */
    8.11 -#define	IA64_TR_VHPT		6	/* dtr6: vhpt */
    8.12 +#define IA64_TR_VHPT		5	/* dtr5: vhpt */
    8.13  
    8.14  #define IA64_TR_VPD		2	/* itr2: vpd */
    8.15