ia64/xen-unstable

changeset 9743:dc05c0ce9139

[IA64] cleanup of vhpt.h

Cleanup: collision chain declaration and code removed (was unused).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Wed Apr 19 10:35:31 2006 -0600 (2006-04-19)
parents c3972d632ff6
children 7ed6c203efe9
files xen/include/asm-ia64/vhpt.h
line diff
     1.1 --- a/xen/include/asm-ia64/vhpt.h	Wed Apr 19 10:32:36 2006 -0600
     1.2 +++ b/xen/include/asm-ia64/vhpt.h	Wed Apr 19 10:35:31 2006 -0600
     1.3 @@ -11,12 +11,8 @@
     1.4  /* Number of entries in the VHPT.  The size of an entry is 4*8B == 32B */
     1.5  #define	VHPT_NUM_ENTRIES		(1 << (VHPT_SIZE_LOG2 - 5))
     1.6  
     1.7 -#define VHPT_CACHE_MASK			(VHPT_NUM_ENTRIES - 1)
     1.8 -#define	VHPT_CACHE_ENTRY_SIZE		64
     1.9 -
    1.10  #define	VHPT_PAGE_SHIFT			VHPT_SIZE_LOG2
    1.11  
    1.12 -
    1.13  #ifdef CONFIG_SMP
    1.14  # define vhpt_flush_all()	smp_vhpt_flush_all()
    1.15  #else
    1.16 @@ -29,83 +25,7 @@
    1.17  #define	VLE_TITAG_OFFSET		16
    1.18  #define	VLE_CCHAIN_OFFSET		24
    1.19  
    1.20 -#define	VCE_TITAG_OFFSET		0
    1.21 -#define	VCE_CCNEXT_OFFSET		8
    1.22 -#define	VCE_CCPREV_OFFSET		16
    1.23 -#define	VCE_PGFLAGS_OFFSET		24
    1.24 -#define	VCE_ITIR_OFFSET			32
    1.25 -#define	VCE_FNEXT_OFFSET		32
    1.26 -#define	VCE_CCHEAD_OFFSET		40
    1.27 -#define	VCE_VADDR_OFFSET		48
    1.28 -
    1.29 -//FIXME: change and declare elsewhere
    1.30 -#define	CAUSE_VHPT_CC_HANDLED		0
    1.31 -
    1.32  #ifndef __ASSEMBLY__
    1.33 -
    1.34 -//
    1.35 -// VHPT collison chain entry (part of the "V-Cache")
    1.36 -// DO NOT CHANGE THE SIZE OF THIS STRUCTURE (see vhpt.S banked regs calculations)
    1.37 -//
    1.38 -struct vcache_entry {
    1.39 -    union {
    1.40 -        struct {
    1.41 -            unsigned long tag  : 63; // 0-62
    1.42 -            unsigned long ti   :  1; // 63
    1.43 -        };
    1.44 -        unsigned long ti_tag;
    1.45 -    };
    1.46 -
    1.47 -    struct vcache_entry *CCNext;    // collision chain next
    1.48 -    struct vcache_entry *CCPrev;    // collision chain previous
    1.49 -
    1.50 -    union {
    1.51 -        struct {
    1.52 -            unsigned long p    :  1; // 0
    1.53 -            unsigned long      :  1; // 1
    1.54 -            unsigned long ma   :  3; // 2-4
    1.55 -            unsigned long a    :  1; // 5
    1.56 -            unsigned long d    :  1; // 6
    1.57 -            unsigned long pl   :  2; // 7-8
    1.58 -            unsigned long ar   :  3; // 9-11
    1.59 -            unsigned long ppn  : 38; // 12-49
    1.60 -            unsigned long      :  2; // 50-51
    1.61 -            unsigned long ed   :  1; // 52
    1.62 -
    1.63 -            unsigned long translation_type :  2; // 53-54 -- hack
    1.64 -            unsigned long Counter :  9; // 55-63
    1.65 -        };
    1.66 -        unsigned long page_flags;
    1.67 -    };
    1.68 -
    1.69 -    union {
    1.70 -        struct {
    1.71 -            unsigned long      :  2; // 0-1
    1.72 -            unsigned long ps   :  6; // 2-7
    1.73 -            unsigned long key  : 24; // 8-31
    1.74 -            unsigned long      : 32; // 32-63
    1.75 -        };
    1.76 -        unsigned long itir;
    1.77 -
    1.78 -        //
    1.79 -        // the free list pointer when entry not in use
    1.80 -        //
    1.81 -        struct vcache_entry *FNext;    // free list
    1.82 -    };
    1.83 -
    1.84 -    //
    1.85 -    // store head of collison chain for removal since thash will only work if
    1.86 -    // current RID is same as when element was added to chain.
    1.87 -    //
    1.88 -    struct vhpt_lf_entry *CCHead;
    1.89 -
    1.90 -    unsigned long virtual_address;
    1.91 -
    1.92 -    unsigned int CChainCnt;
    1.93 -    unsigned int Signature;
    1.94 -};
    1.95 -
    1.96 -
    1.97  //
    1.98  // VHPT Long Format Entry (as recognized by hw)
    1.99  //
   1.100 @@ -113,7 +33,7 @@ struct vhpt_lf_entry {
   1.101      unsigned long page_flags;
   1.102      unsigned long itir;
   1.103      unsigned long ti_tag;
   1.104 -    struct vcache_entry *CChain;
   1.105 +    unsigned long CChain;
   1.106  };
   1.107  
   1.108  #define INVALID_TI_TAG 0x8000000000000000L
   1.109 @@ -140,9 +60,6 @@ DECLARE_PER_CPU (unsigned long, vhpt_pen
   1.110  #if !VHPT_ENABLED
   1.111  #define VHPT_CCHAIN_LOOKUP(Name, i_or_d)
   1.112  #else
   1.113 -#if 0 /* One VHPT per cpu! def CONFIG_SMP */
   1.114 -#warning "FIXME SMP: VHPT_CCHAIN_LOOKUP needs a semaphore on the VHPT!"
   1.115 -#endif
   1.116  
   1.117  // VHPT_CCHAIN_LOOKUP is intended to run with psr.i+ic off
   1.118  #define VHPT_CCHAIN_LOOKUP(Name, i_or_d) 			\
   1.119 @@ -150,369 +67,47 @@ DECLARE_PER_CPU (unsigned long, vhpt_pen
   1.120  CC_##Name:;							\
   1.121  	mov r31 = pr;						\
   1.122  	mov r16 = cr.ifa;					\
   1.123 -	movl r30 = int_counts;					\
   1.124  	;;							\
   1.125  	extr.u r17=r16,59,5					\
   1.126  	;;							\
   1.127 +	/* If address belongs to VMM, go to alt tlb handler */	\
   1.128  	cmp.eq p6,p0=0x1e,r17;					\
   1.129 -(p6)	br.cond.spnt	.Alt_##Name				\
   1.130 +(p6)	br.cond.spnt	late_alt_##Name				\
   1.131  	;;							\
   1.132  	cmp.eq p6,p0=0x1d,r17;					\
   1.133 -(p6)	br.cond.spnt	.Alt_##Name				\
   1.134 -	;;							\
   1.135 -	thash r28 = r16;					\
   1.136 -	adds  r30 = CAUSE_VHPT_CC_HANDLED << 3, r30;		\
   1.137 -	;;							\
   1.138 -	ttag r19 = r16;						\
   1.139 -ld8 r27 = [r30];					\
   1.140 -adds r17 = VLE_CCHAIN_OFFSET, r28;			\
   1.141 -	;;							\
   1.142 -	ld8 r17 = [r17];					\
   1.143 -	;;							\
   1.144 -	cmp.eq p6,p0 = 0, r17;					\
   1.145 -	mov r21 = r17;						\
   1.146 -	adds r22 = VCE_CCNEXT_OFFSET, r17;			\
   1.147 -	adds r28 = VLE_ITIR_OFFSET, r28;			\
   1.148 -(p6)	br .Out_##Name;						\
   1.149 -	;;							\
   1.150 -								\
   1.151 -.loop_##Name:;							\
   1.152 -	ld8 r20 = [r21];					\
   1.153 -	ld8 r18 = [r22];					\
   1.154 -	adds r23 = VCE_PGFLAGS_OFFSET, r21;			\
   1.155 -	adds r24 = VCE_ITIR_OFFSET, r21;			\
   1.156 -	cmp.eq p6,p0 = r17, r21;				\
   1.157 -	cmp.eq p7,p0 = r0, r0;					\
   1.158 -	;;							\
   1.159 -	lfetch [r18];						\
   1.160 -	cmp.eq.andcm p6,p7 = r19, r20;				\
   1.161 -	mov r21 = r18;						\
   1.162 -	adds r22 = VCE_CCNEXT_OFFSET, r18;			\
   1.163 -(p6)	br.spnt .Out_##Name;					\
   1.164 -(p7)	br.sptk .loop_##Name;					\
   1.165 -	;;							\
   1.166 -								\
   1.167 -	ld8 r26 = [r23];					\
   1.168 -	ld8 r25 = [r24];					\
   1.169 -	adds r29 = VLE_TITAG_OFFSET - VLE_ITIR_OFFSET, r28;	\
   1.170 -	adds  r27 = 1, r27;					\
   1.171 -	;;							\
   1.172 -	mov cr.itir = r25;					\
   1.173 -	st8 [r28] = r25, VLE_PGFLAGS_OFFSET - VLE_ITIR_OFFSET;	\
   1.174 -	or r26 = 1, r26;					\
   1.175 -	st8 [r30] = r27;					\
   1.176 -	;;							\
   1.177 -	itc.i_or_d r26;						\
   1.178 -	;;							\
   1.179 -	srlz.i_or_d;						\
   1.180 -	;;							\
   1.181 -	st8 [r28] = r26;					\
   1.182 -	mov pr = r31, 0x1ffff;					\
   1.183 -	st8 [r29] = r20;					\
   1.184 -	rfi;							\
   1.185 +(p6)	br.cond.spnt	late_alt_##Name				\
   1.186  	;;							\
   1.187 -								\
   1.188 -.Alt_##Name:;							\
   1.189 -	mov pr = r31, 0x1ffff;					\
   1.190 -	;;							\
   1.191 -	br.cond.sptk late_alt_##Name				\
   1.192 -	;;							\
   1.193 -.Out_##Name:;							\
   1.194  	mov pr = r31, 0x1ffff;					\
   1.195 -	;;							\
   1.196 -.End_##Name:;
   1.197 -
   1.198 -//	 br.cond.sptk.few dorfi;	
   1.199 -
   1.200 -
   1.201 -
   1.202 -#define VHPT_INSERT() \
   1.203 -	{.mmi;\
   1.204 -		thash r17 = r16;\
   1.205 -		or r26 = 1, r26;\
   1.206 -		nop 0;\
   1.207 -		;;\
   1.208 -	};\
   1.209 -	{.mii;\
   1.210 -		ttag r21 = r16;\
   1.211 -		adds r18 = VLE_ITIR_OFFSET, r17;\
   1.212 -		adds r19 = VLE_PGFLAGS_OFFSET, r17;\
   1.213 -		;;\
   1.214 -	};\
   1.215 -	{.mmi;\
   1.216 -\
   1.217 -		st8[r18] = r27;\
   1.218 -		adds r20 = VLE_TITAG_OFFSET, r17;\
   1.219 -		nop 0;\
   1.220 -		;;\
   1.221 -	};\
   1.222 -	{.mmb;\
   1.223 -		st8[r19] = r26;\
   1.224 -		st8[r20] = r21;\
   1.225 -		nop 0;\
   1.226 -		;;\
   1.227 -	};\
   1.228 -
   1.229 -
   1.230 -
   1.231 -
   1.232 -
   1.233 -
   1.234 -
   1.235 -
   1.236 -
   1.237 -
   1.238 -
   1.239 -
   1.240 -
   1.241 -
   1.242 +	;;							
   1.243  
   1.244  
   1.245 -#define VHPT_INSERT1() \
   1.246 -VCacheInsert:;\
   1.247 -		mov r18 = 1;\
   1.248 -		extr.u r17 = r27, 2, 6;\
   1.249 -		;;\
   1.250 -\
   1.251 -\
   1.252 -		shl r17 = r18, r17;\
   1.253 -		;;\
   1.254 -\
   1.255 -\
   1.256 -		add r30 = r16, r17;\
   1.257 -		;;\
   1.258 -\
   1.259 -.MainLoop:;\
   1.260 -		thash r18 = r16;\
   1.261 -		;;\
   1.262 -\
   1.263 -		ttag  r24 = r16;\
   1.264 -		adds r29 = VLE_CCHAIN_OFFSET, r18;\
   1.265 -		;;\
   1.266 -\
   1.267 -\
   1.268 -		ld8 r21 = [r29];\
   1.269 -		;;\
   1.270 -\
   1.271 -		adds r19 = VCE_CCNEXT_OFFSET, r21;\
   1.272 -		adds r20 = VCE_TITAG_OFFSET, r21;\
   1.273 -		mov r28 = r21;\
   1.274 -\
   1.275 -		cmp.eq p11, p4 = r0, r21;\
   1.276 -(p11)    br FindOne;\
   1.277 -		;;\
   1.278 -\
   1.279 -\
   1.280 -.find_loop:;\
   1.281 -\
   1.282 -		ld8 r17 = [r19];\
   1.283 -		ld8 r18 = [r20];\
   1.284 -		;;\
   1.285 -\
   1.286 -		adds r19 = VCE_CCNEXT_OFFSET, r17;\
   1.287 -		adds r20 = VCE_TITAG_OFFSET, r17;\
   1.288 -		cmp.eq.unc p10, p8 = r18, r24;\
   1.289 -\
   1.290 -\
   1.291 -\
   1.292 -		cmp.eq.unc p1, p2 = r17, r21;\
   1.293 -\
   1.294 -\
   1.295 -(p10)      br .FillVce;\
   1.296 -		;;\
   1.297 -\
   1.298 -\
   1.299 -(p8)   mov r28 = r17;\
   1.300 -\
   1.301 -		lfetch [r19];\
   1.302 -\
   1.303 -(p2)   br .find_loop;\
   1.304 -		;;\
   1.305 -\
   1.306 -FindOne:;\
   1.307 -\
   1.308 -\
   1.309 -\
   1.310 -		movl r22 = G_VCacheRpl;\
   1.311 -		;;\
   1.312 -\
   1.313 -\
   1.314 -		ld8 r23 = [r22];\
   1.315 -		;;\
   1.316 -\
   1.317 -\
   1.318 -		mov r28 = r23;\
   1.319 -\
   1.320 -\
   1.321 -		adds r17 = VCE_FNEXT_OFFSET, r23;\
   1.322 -\
   1.323 -\
   1.324 -		cmp.eq p14, p3 = r0, r23;\
   1.325 -		;;\
   1.326 -\
   1.327 -(p3)  ld8 r23 = [r17];\
   1.328 -		;;\
   1.329 -\
   1.330 -\
   1.331 -(p3)  st8 [r22] = r23;\
   1.332 -(p3)  br .AddChain;\
   1.333 -		;;\
   1.334 -\
   1.335 -\
   1.336 -\
   1.337 -\
   1.338 -		movl r24 = VHPT_CACHE_MASK;\
   1.339 -\
   1.340 -\
   1.341 -		adds r25 = 8, r22;\
   1.342 -		;;\
   1.343 -\
   1.344 -\
   1.345 -		ld8 r23 = [r25];\
   1.346 -		;;\
   1.347 -\
   1.348 -\
   1.349 -		adds r23 = VHPT_CACHE_ENTRY_SIZE, r23;\
   1.350 -		;;\
   1.351 -\
   1.352 -\
   1.353 -		and r23 = r23, r24;\
   1.354 -\
   1.355 -\
   1.356 -		movl r17 = VHPT_ADDR;\
   1.357 -		;;\
   1.358 -\
   1.359 -\
   1.360 -		st8 [r25] = r23;\
   1.361 -\
   1.362 -\
   1.363 -		add r28 = r17, r23;\
   1.364 -		;;\
   1.365 -\
   1.366 -\
   1.367 -		adds r22 = VCE_CCHEAD_OFFSET, r28;\
   1.368 -		;;\
   1.369 -\
   1.370 -		ld8 r17 = [r22], VLE_PGFLAGS_OFFSET - VLE_CCHAIN_OFFSET;\
   1.371 -\
   1.372 -		adds r19 = VCE_CCNEXT_OFFSET, r28;\
   1.373 -		adds r20 = VCE_CCPREV_OFFSET, r28;\
   1.374 -		;;\
   1.375 -\
   1.376 -		ld8 r20 = [r20];\
   1.377 -		ld8 r19 = [r19];\
   1.378 -\
   1.379 -		adds r21 = VLE_CCHAIN_OFFSET, r17;\
   1.380 -		;;\
   1.381 -\
   1.382 -		ld8 r18 = [r21];\
   1.383 -\
   1.384 -\
   1.385 -		cmp.eq.unc p9, p7 = r19, r28;\
   1.386 -\
   1.387 -\
   1.388 -		adds r23 = VLE_TITAG_OFFSET + 7, r17;\
   1.389 -\
   1.390 -\
   1.391 -		mov r17 = 0x80;\
   1.392 -		;;\
   1.393 -\
   1.394 -\
   1.395 -(p9)       st8 [r21] = r0;\
   1.396 -\
   1.397 -\
   1.398 -(p9)       st1 [r23] = r17;\
   1.399 -\
   1.400 -		adds r24 = VCE_CCPREV_OFFSET, r19;\
   1.401 -		adds r25 = VCE_CCNEXT_OFFSET, r20;\
   1.402 -\
   1.403 -\
   1.404 -(p7)    cmp.eq.unc p13, p6 = r18, r28;\
   1.405 -		;;\
   1.406 -\
   1.407 -(p7)    st8 [r24] = r20;\
   1.408 -(p7)    st8 [r25] = r19;\
   1.409 -\
   1.410 -		adds r17 = VCE_PGFLAGS_OFFSET, r28;\
   1.411 -		;;\
   1.412 -\
   1.413 -(p13)     st8 [r21] = r19;\
   1.414 -(p13)     ld8 r18 = [r17], VCE_ITIR_OFFSET - VCE_PGFLAGS_OFFSET;\
   1.415 -		;;\
   1.416 -(p13)     st8 [r22] = r18, VLE_ITIR_OFFSET - VLE_PGFLAGS_OFFSET;\
   1.417 -\
   1.418 -		;;\
   1.419 -(p13)     ld8 r18 = [r17], VCE_TITAG_OFFSET - VCE_ITIR_OFFSET;\
   1.420 -		;;\
   1.421 -\
   1.422 -(p13)     st8 [r22] = r18, VLE_TITAG_OFFSET - VLE_ITIR_OFFSET;\
   1.423 -		;;\
   1.424 -\
   1.425 -.AddChain:;\
   1.426 -\
   1.427 -\
   1.428 -		ld8 r24 = [r29];\
   1.429 -		;;\
   1.430 -\
   1.431 -\
   1.432 -		st8 [r29] = r28, 0 - VLE_CCHAIN_OFFSET;\
   1.433 -\
   1.434 -		adds r25 = VCE_CCNEXT_OFFSET, r28;\
   1.435 -		adds r19 = VCE_CCPREV_OFFSET, r28;\
   1.436 -		adds r20 = VCE_CCHEAD_OFFSET, r28;\
   1.437 -		;;\
   1.438 -\
   1.439 -\
   1.440 -		st8 [r20] = r29;\
   1.441 -\
   1.442 -		cmp.eq p12, p5 = r0, r24;\
   1.443 -\
   1.444 -		adds r23 = VCE_CCPREV_OFFSET, r24;\
   1.445 -		;;\
   1.446 -\
   1.447 -(p12)   st8 [r25] = r28;\
   1.448 -(p12)   st8 [r19] = r28;\
   1.449 -\
   1.450 -(p5)ld8 r21 = [r23];\
   1.451 -		adds r29 = VLE_CCHAIN_OFFSET, r29;\
   1.452 -		;;\
   1.453 -\
   1.454 -(p5)st8 [r25] = r24;\
   1.455 -(p5)st8 [r19] = r21;\
   1.456 -\
   1.457 -		adds r22 = VCE_CCNEXT_OFFSET, r21;\
   1.458 -		;;\
   1.459 -\
   1.460 -(p5)st8 [r22] = r28;\
   1.461 -(p5)st8 [r23] = r28;\
   1.462 -		;;\
   1.463 -\
   1.464 -.FillVce:;\
   1.465 -		ttag r24 = r16;\
   1.466 -\
   1.467 -\
   1.468 -		adds r29 = 0 - VLE_CCHAIN_OFFSET, r29;\
   1.469 -		adds r17 = VCE_PGFLAGS_OFFSET, r28;\
   1.470 -		movl r19 = PAGE_SIZE_OFFSET;\
   1.471 -		;;\
   1.472 -\
   1.473 -		st8 [r29] = r26, VLE_ITIR_OFFSET - VLE_PGFLAGS_OFFSET;\
   1.474 -		st8 [r17] = r26, VCE_ITIR_OFFSET - VCE_PGFLAGS_OFFSET;\
   1.475 -		add r16 = r16, r19;\
   1.476 -		;;\
   1.477 -\
   1.478 -		st8 [r29] = r27, VLE_TITAG_OFFSET - VLE_ITIR_OFFSET;\
   1.479 -		st8 [r17] = r27, VCE_TITAG_OFFSET - VCE_ITIR_OFFSET;\
   1.480 -		;;\
   1.481 -\
   1.482 -		st8 [r29] = r24;\
   1.483 -		st8 [r17] = r24;\
   1.484 -\
   1.485 -		cmp.lt p15, p0 = r16, r30;\
   1.486 -(p15)     br  .MainLoop;\
   1.487 -		;;\
   1.488 -
   1.489 -
   1.490 +/* r16 = vadr, r26 = pte, r27 = logps */ 
   1.491 +#define VHPT_INSERT()					\
   1.492 +	{.mmi;						\
   1.493 +		thash r17 = r16;			\
   1.494 +		or r26 = 1, r26;			\
   1.495 +		nop 0;					\
   1.496 +		;;					\
   1.497 +	};						\
   1.498 +	{.mii;						\
   1.499 +		ttag r21 = r16;				\
   1.500 +		adds r18 = VLE_ITIR_OFFSET, r17;	\
   1.501 +		adds r19 = VLE_PGFLAGS_OFFSET, r17;	\
   1.502 +		;;					\
   1.503 +	};						\
   1.504 +	{.mmi;						\
   1.505 +							\
   1.506 +		st8[r18] = r27;				\
   1.507 +		adds r20 = VLE_TITAG_OFFSET, r17;	\
   1.508 +		nop 0;					\
   1.509 +		;;					\
   1.510 +	};						\
   1.511 +	{.mmb;						\
   1.512 +		st8[r19] = r26;				\
   1.513 +		st8[r20] = r21;				\
   1.514 +		nop 0;					\
   1.515 +		;;					\
   1.516 +	}
   1.517  
   1.518  
   1.519  #endif	/* VHPT_ENABLED */