ia64/xen-unstable

changeset 18367:0ac39e4bf63a

[IA64] fix mca hander.

When reloading dtr[], itr[], overlapping must be avoided.
Add overlap check.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Aug 25 19:04:37 2008 +0900 (2008-08-25)
parents efee1e0f2e08
children 01e95ec5b433
files xen/arch/ia64/linux-xen/mca_asm.S
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/mca_asm.S	Mon Aug 25 19:04:37 2008 +0900
     1.2 +++ b/xen/arch/ia64/linux-xen/mca_asm.S	Mon Aug 25 19:04:37 2008 +0900
     1.3 @@ -540,6 +540,17 @@ ia64_reload_tr:
     1.4  	;;
     1.5  	dep r17=0,r17,0,IA64_GRANULE_SHIFT
     1.6  	;;
     1.7 +	
     1.8 +	// avoid overlapping with stack
     1.9 +	GET_THIS_PADDR(r2, cpu_kr);;
    1.10 +	add r2=IA64_KR_CURRENT_STACK_OFFSET,r2
    1.11 +	;;
    1.12 +	ld8 r19=[r2]
    1.13 +	;;
    1.14 +	shl r19=r19,IA64_GRANULE_SHIFT
    1.15 +	;;
    1.16 +	cmp.eq p0,p7=r17,r19
    1.17 +
    1.18  	movl r20=PAGE_KERNEL
    1.19  	;;
    1.20  	or r17=r20,r17		// construct PA | page properties
    1.21 @@ -552,7 +563,7 @@ ia64_reload_tr:
    1.22  	;;
    1.23  	itr.i itr[r16]=r17
    1.24  	;;
    1.25 -	itr.d dtr[r18]=r17
    1.26 +(p7)	itr.d dtr[r18]=r17
    1.27  	;;
    1.28  	srlz.i
    1.29  	;;
    1.30 @@ -567,24 +578,37 @@ ia64_reload_tr:
    1.31  	cmp.eq p7,p0=r2,r0
    1.32  	;;
    1.33  (p7)	br.cond.sptk    .overlap_vhpt   // vhpt isn't mapped.
    1.34 +	
    1.35 +	dep r16=0,r2,0,IA64_GRANULE_SHIFT
    1.36 +	;;
    1.37 +	dep r17=0,r16,60,4		// physical address of
    1.38 +	                                // va_vhpt & ~(IA64_GRANULE_SIZE - 1)
    1.39  
    1.40  	// avoid overlapping with stack TR
    1.41 -	dep r16=0,r2,0,IA64_GRANULE_SHIFT
    1.42 -	;;
    1.43  	GET_THIS_PADDR(r2,cpu_kr);;
    1.44 -	add r2=IA64_KR_CURRENT_OFFSET,r2
    1.45 +	add r2=IA64_KR_CURRENT_STACK_OFFSET,r2
    1.46  	;;
    1.47  	ld8 r2=[r2]
    1.48  	;;
    1.49 -	dep r17=0,r2,0,IA64_GRANULE_SHIFT
    1.50 -	;; 
    1.51 -	cmp.eq p7,p0=r16,r17
    1.52 +	shl r18=r2,IA64_GRANULE_SHIFT
    1.53 +	;;
    1.54 +	cmp.eq p7,p0=r17,r18
    1.55  (p7)	br.cond.sptk	.overlap_vhpt
    1.56 +
    1.57 +	// avoid overlapping with VPD
    1.58 +	GET_THIS_PADDR(r2, inserted_vpd);;
    1.59 +	ld8 r18=[r2]
    1.60 +	;;
    1.61 +	dep r18=0,r18,60,4
    1.62 +	;;
    1.63 +	dep r18=0,r18,0,IA64_GRANULE_SHIFT
    1.64 +	;;
    1.65 +	cmp.eq p7,p0=r17,r18
    1.66 +(p7)	br.cond.sptk	.overlap_vhpt
    1.67 +
    1.68  	movl r20=PAGE_KERNEL
    1.69  	;;
    1.70  	mov r18=IA64_TR_VHPT
    1.71 -	dep r17=0,r16,60,4		// physical address of
    1.72 -	                                // va_vhpt & ~(IA64_GRANULE_SIZE - 1)
    1.73  	mov r19=IA64_GRANULE_SHIFT<<2
    1.74  	;;
    1.75  	or r17=r17,r20			// construct PA | page properties