ia64/xen-unstable

changeset 16765:70db89a4beab

[IA64] Make vmx_swtich_rr7() consistent to ia64_new_rr7() so that it maps stack.

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 50ac3b26b252
children 8909a5717cd7
files xen/arch/ia64/vmx/vmx_entry.S
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmx_entry.S	Thu Jan 17 12:05:43 2008 -0700
     1.2 +++ b/xen/arch/ia64/vmx/vmx_entry.S	Thu Jan 17 12:05:43 2008 -0700
     1.3 @@ -627,7 +627,6 @@ END(ia64_leave_hypercall)
     1.4  #define PSR_BITS_TO_SET    IA64_PSR_BN
     1.5  
     1.6  //extern void vmx_switch_rr7(unsigned long rid, void *guest_vhpt, void * pal_vaddr );
     1.7 -
     1.8  GLOBAL_ENTRY(vmx_switch_rr7)
     1.9         // not sure this unwind statement is correct...
    1.10         .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(1)
    1.11 @@ -679,6 +678,7 @@ 1:
    1.12  	mov cr.ifa=r17
    1.13  	mov r16=IA64_TR_KERNEL
    1.14  	movl r25 = PAGE_KERNEL
    1.15 +	// r2=KERNEL_TR_PAGE_SHIFT truncated physicall address of ip
    1.16  	dep r2=0,r3,0,KERNEL_TR_PAGE_SHIFT
    1.17  	;;
    1.18  	or r24=r2,r25
    1.19 @@ -700,6 +700,25 @@ 1:
    1.20  	itr.d dtr[r16]=r24
    1.21  	;;
    1.22  
    1.23 +	// re-pin mapping for stack (current)
    1.24 +	// unless overlaps with IA64_TR_XEN_HEAP_REGS
    1.25 +	mov r26=IA64_GRANULE_SHIFT<<2
    1.26 +	dep r21=0,r13,60,4              // physical address of "current"
    1.27 +	;;
    1.28 +	dep r3=0,r21,0,KERNEL_TR_PAGE_SHIFT
    1.29 +	;; 
    1.30 +	cmp.eq p7,p0=r2,r3
    1.31 +(p7)	br.cond.sptk .stack_overlaps
    1.32 +	;;
    1.33 +	ptr.d   r13,r26
    1.34 +	or r23=r21,r25                  // construct PA | page properties
    1.35 +	mov cr.itir=r26
    1.36 +	mov cr.ifa=r13                  // VA of next task...
    1.37 +	mov r18=IA64_TR_CURRENT_STACK
    1.38 +	;;
    1.39 +	itr.d dtr[r18]=r23              // wire in new mapping...
    1.40 +.stack_overlaps:
    1.41 +
    1.42  	// re-pin mappings for per-cpu data
    1.43  	movl r22 = PERCPU_ADDR
    1.44  	;;
    1.45 @@ -716,8 +735,16 @@ 1:
    1.46  	;;
    1.47  
    1.48  	// re-pin mappings for guest_vhpt
    1.49 +	// unless overlaps with IA64_TR_XEN_HEAP_REGS or IA64_TR_CURRENT_STACK
    1.50 +	dep r18=0,loc5,0,KERNEL_TR_PAGE_SHIFT
    1.51 +	dep r21=0,r21,0,IA64_GRANULE_SHIFT 
    1.52 +	dep r17=0,loc5,0,IA64_GRANULE_SHIFT 
    1.53 +	;;
    1.54 +	cmp.eq p6,p0=r18,r2             // check overlap with xen heap
    1.55 +	cmp.eq p7,p0=r17,r21            // check overlap with current stack
    1.56 +(p6)	br.cond.sptk .vhpt_overlaps
    1.57 +(p7)	br.cond.sptk .vhpt_overlaps
    1.58  	mov r24=IA64_TR_VHPT
    1.59 -	movl r25=PAGE_KERNEL
    1.60  	;;
    1.61  	or loc5 = r25,loc5              // construct PA | page properties
    1.62  	mov r23 = IA64_GRANULE_SHIFT <<2
    1.63 @@ -729,6 +756,7 @@ 1:
    1.64  	;;
    1.65  	itr.d dtr[r24]=loc5             // wire in new mapping...
    1.66  	;;
    1.67 +.vhpt_overlaps:
    1.68  
    1.69  	// re-pin mappings for PAL code section
    1.70  	mov r24=IA64_TR_PALCODE