aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-09-11 17:27:15 -0400
committerTony Luck <tony.luck@intel.com>2005-09-11 17:27:15 -0400
commitc85b2a5fe200d744a814d23c258460d4fc98a546 (patch)
treeb9fdf571d61a31808702b6aff9f12562ab650748
parent49a28cc8fd26f5317c47a9aeb2bdd1c33e21738e (diff)
parent6cf07a8cc86a0b471466c7fe45892f7ef434015b (diff)
Pull sim-fixes into release branch
-rw-r--r--arch/ia64/hp/sim/boot/boot_head.S31
-rw-r--r--arch/ia64/kernel/palinfo.c115
-rw-r--r--arch/ia64/mm/init.c15
3 files changed, 97 insertions, 64 deletions
diff --git a/arch/ia64/hp/sim/boot/boot_head.S b/arch/ia64/hp/sim/boot/boot_head.S
index 1c8c7e6a9a5e..a9bd71ac78e2 100644
--- a/arch/ia64/hp/sim/boot/boot_head.S
+++ b/arch/ia64/hp/sim/boot/boot_head.S
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <asm/asmmacro.h> 6#include <asm/asmmacro.h>
7#include <asm/pal.h>
7 8
8 .bss 9 .bss
9 .align 16 10 .align 16
@@ -49,7 +50,11 @@ GLOBAL_ENTRY(jmp_to_kernel)
49 br.sptk.few b7 50 br.sptk.few b7
50END(jmp_to_kernel) 51END(jmp_to_kernel)
51 52
52 53/*
54 * r28 contains the index of the PAL function
55 * r29--31 the args
56 * Return values in ret0--3 (r8--11)
57 */
53GLOBAL_ENTRY(pal_emulator_static) 58GLOBAL_ENTRY(pal_emulator_static)
54 mov r8=-1 59 mov r8=-1
55 mov r9=256 60 mov r9=256
@@ -62,7 +67,7 @@ GLOBAL_ENTRY(pal_emulator_static)
62 cmp.gtu p6,p7=r9,r28 67 cmp.gtu p6,p7=r9,r28
63(p6) br.cond.sptk.few stacked 68(p6) br.cond.sptk.few stacked
64 ;; 69 ;;
65static: cmp.eq p6,p7=6,r28 /* PAL_PTCE_INFO */ 70static: cmp.eq p6,p7=PAL_PTCE_INFO,r28
66(p7) br.cond.sptk.few 1f 71(p7) br.cond.sptk.few 1f
67 ;; 72 ;;
68 mov r8=0 /* status = 0 */ 73 mov r8=0 /* status = 0 */
@@ -70,21 +75,21 @@ static: cmp.eq p6,p7=6,r28 /* PAL_PTCE_INFO */
70 movl r10=0x0000000200000003 /* count[0], count[1] */ 75 movl r10=0x0000000200000003 /* count[0], count[1] */
71 movl r11=0x1000000000002000 /* stride[0], stride[1] */ 76 movl r11=0x1000000000002000 /* stride[0], stride[1] */
72 br.cond.sptk.few rp 77 br.cond.sptk.few rp
731: cmp.eq p6,p7=14,r28 /* PAL_FREQ_RATIOS */ 781: cmp.eq p6,p7=PAL_FREQ_RATIOS,r28
74(p7) br.cond.sptk.few 1f 79(p7) br.cond.sptk.few 1f
75 mov r8=0 /* status = 0 */ 80 mov r8=0 /* status = 0 */
76 movl r9 =0x100000064 /* proc_ratio (1/100) */ 81 movl r9 =0x100000064 /* proc_ratio (1/100) */
77 movl r10=0x100000100 /* bus_ratio<<32 (1/256) */ 82 movl r10=0x100000100 /* bus_ratio<<32 (1/256) */
78 movl r11=0x100000064 /* itc_ratio<<32 (1/100) */ 83 movl r11=0x100000064 /* itc_ratio<<32 (1/100) */
79 ;; 84 ;;
801: cmp.eq p6,p7=19,r28 /* PAL_RSE_INFO */ 851: cmp.eq p6,p7=PAL_RSE_INFO,r28
81(p7) br.cond.sptk.few 1f 86(p7) br.cond.sptk.few 1f
82 mov r8=0 /* status = 0 */ 87 mov r8=0 /* status = 0 */
83 mov r9=96 /* num phys stacked */ 88 mov r9=96 /* num phys stacked */
84 mov r10=0 /* hints */ 89 mov r10=0 /* hints */
85 mov r11=0 90 mov r11=0
86 br.cond.sptk.few rp 91 br.cond.sptk.few rp
871: cmp.eq p6,p7=1,r28 /* PAL_CACHE_FLUSH */ 921: cmp.eq p6,p7=PAL_CACHE_FLUSH,r28 /* PAL_CACHE_FLUSH */
88(p7) br.cond.sptk.few 1f 93(p7) br.cond.sptk.few 1f
89 mov r9=ar.lc 94 mov r9=ar.lc
90 movl r8=524288 /* flush 512k million cache lines (16MB) */ 95 movl r8=524288 /* flush 512k million cache lines (16MB) */
@@ -102,7 +107,7 @@ static: cmp.eq p6,p7=6,r28 /* PAL_PTCE_INFO */
102 mov ar.lc=r9 107 mov ar.lc=r9
103 mov r8=r0 108 mov r8=r0
104 ;; 109 ;;
1051: cmp.eq p6,p7=15,r28 /* PAL_PERF_MON_INFO */ 1101: cmp.eq p6,p7=PAL_PERF_MON_INFO,r28
106(p7) br.cond.sptk.few 1f 111(p7) br.cond.sptk.few 1f
107 mov r8=0 /* status = 0 */ 112 mov r8=0 /* status = 0 */
108 movl r9 =0x08122f04 /* generic=4 width=47 retired=8 cycles=18 */ 113 movl r9 =0x08122f04 /* generic=4 width=47 retired=8 cycles=18 */
@@ -138,6 +143,20 @@ static: cmp.eq p6,p7=6,r28 /* PAL_PTCE_INFO */
138 st8 [r29]=r0,16 /* clear remaining bits */ 143 st8 [r29]=r0,16 /* clear remaining bits */
139 st8 [r18]=r0,16 /* clear remaining bits */ 144 st8 [r18]=r0,16 /* clear remaining bits */
140 ;; 145 ;;
1461: cmp.eq p6,p7=PAL_VM_SUMMARY,r28
147(p7) br.cond.sptk.few 1f
148 mov r8=0 /* status = 0 */
149 movl r9=0x2044040020F1865 /* num_tc_levels=2, num_unique_tcs=4 */
150 /* max_itr_entry=64, max_dtr_entry=64 */
151 /* hash_tag_id=2, max_pkr=15 */
152 /* key_size=24, phys_add_size=50, vw=1 */
153 movl r10=0x183C /* rid_size=24, impl_va_msb=60 */
154 ;;
1551: cmp.eq p6,p7=PAL_MEM_ATTRIB,r28
156(p7) br.cond.sptk.few 1f
157 mov r8=0 /* status = 0 */
158 mov r9=0x80|0x01 /* NatPage|WB */
159 ;;
1411: br.cond.sptk.few rp 1601: br.cond.sptk.few rp
142stacked: 161stacked:
143 br.ret.sptk.few rp 162 br.ret.sptk.few rp
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 25e7c8344564..89faa603c6be 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -307,11 +307,9 @@ vm_info(char *page)
307 307
308 if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { 308 if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) {
309 printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status); 309 printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status);
310 return 0; 310 } else {
311 }
312 311
313 312 p += sprintf(p,
314 p += sprintf(p,
315 "Physical Address Space : %d bits\n" 313 "Physical Address Space : %d bits\n"
316 "Virtual Address Space : %d bits\n" 314 "Virtual Address Space : %d bits\n"
317 "Protection Key Registers(PKR) : %d\n" 315 "Protection Key Registers(PKR) : %d\n"
@@ -319,92 +317,99 @@ vm_info(char *page)
319 "Hash Tag ID : 0x%x\n" 317 "Hash Tag ID : 0x%x\n"
320 "Size of RR.rid : %d\n", 318 "Size of RR.rid : %d\n",
321 vm_info_1.pal_vm_info_1_s.phys_add_size, 319 vm_info_1.pal_vm_info_1_s.phys_add_size,
322 vm_info_2.pal_vm_info_2_s.impl_va_msb+1, vm_info_1.pal_vm_info_1_s.max_pkr+1, 320 vm_info_2.pal_vm_info_2_s.impl_va_msb+1,
323 vm_info_1.pal_vm_info_1_s.key_size, vm_info_1.pal_vm_info_1_s.hash_tag_id, 321 vm_info_1.pal_vm_info_1_s.max_pkr+1,
322 vm_info_1.pal_vm_info_1_s.key_size,
323 vm_info_1.pal_vm_info_1_s.hash_tag_id,
324 vm_info_2.pal_vm_info_2_s.rid_size); 324 vm_info_2.pal_vm_info_2_s.rid_size);
325 }
325 326
326 if (ia64_pal_mem_attrib(&attrib) != 0) 327 if (ia64_pal_mem_attrib(&attrib) == 0) {
327 return 0; 328 p += sprintf(p, "Supported memory attributes : ");
328 329 sep = "";
329 p += sprintf(p, "Supported memory attributes : "); 330 for (i = 0; i < 8; i++) {
330 sep = ""; 331 if (attrib & (1 << i)) {
331 for (i = 0; i < 8; i++) { 332 p += sprintf(p, "%s%s", sep, mem_attrib[i]);
332 if (attrib & (1 << i)) { 333 sep = ", ";
333 p += sprintf(p, "%s%s", sep, mem_attrib[i]); 334 }
334 sep = ", ";
335 } 335 }
336 p += sprintf(p, "\n");
336 } 337 }
337 p += sprintf(p, "\n");
338 338
339 if ((status = ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) { 339 if ((status = ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {
340 printk(KERN_ERR "ia64_pal_vm_page_size=%ld\n", status); 340 printk(KERN_ERR "ia64_pal_vm_page_size=%ld\n", status);
341 return 0; 341 } else {
342 }
343
344 p += sprintf(p,
345 "\nTLB walker : %simplemented\n"
346 "Number of DTR : %d\n"
347 "Number of ITR : %d\n"
348 "TLB insertable page sizes : ",
349 vm_info_1.pal_vm_info_1_s.vw ? "" : "not ",
350 vm_info_1.pal_vm_info_1_s.max_dtr_entry+1,
351 vm_info_1.pal_vm_info_1_s.max_itr_entry+1);
352 342
343 p += sprintf(p,
344 "\nTLB walker : %simplemented\n"
345 "Number of DTR : %d\n"
346 "Number of ITR : %d\n"
347 "TLB insertable page sizes : ",
348 vm_info_1.pal_vm_info_1_s.vw ? "" : "not ",
349 vm_info_1.pal_vm_info_1_s.max_dtr_entry+1,
350 vm_info_1.pal_vm_info_1_s.max_itr_entry+1);
353 351
354 p = bitvector_process(p, tr_pages);
355 352
356 p += sprintf(p, "\nTLB purgeable page sizes : "); 353 p = bitvector_process(p, tr_pages);
357 354
358 p = bitvector_process(p, vw_pages); 355 p += sprintf(p, "\nTLB purgeable page sizes : ");
359 356
357 p = bitvector_process(p, vw_pages);
358 }
360 if ((status=ia64_get_ptce(&ptce)) != 0) { 359 if ((status=ia64_get_ptce(&ptce)) != 0) {
361 printk(KERN_ERR "ia64_get_ptce=%ld\n", status); 360 printk(KERN_ERR "ia64_get_ptce=%ld\n", status);
362 return 0; 361 } else {
363 } 362 p += sprintf(p,
364
365 p += sprintf(p,
366 "\nPurge base address : 0x%016lx\n" 363 "\nPurge base address : 0x%016lx\n"
367 "Purge outer loop count : %d\n" 364 "Purge outer loop count : %d\n"
368 "Purge inner loop count : %d\n" 365 "Purge inner loop count : %d\n"
369 "Purge outer loop stride : %d\n" 366 "Purge outer loop stride : %d\n"
370 "Purge inner loop stride : %d\n", 367 "Purge inner loop stride : %d\n",
371 ptce.base, ptce.count[0], ptce.count[1], ptce.stride[0], ptce.stride[1]); 368 ptce.base, ptce.count[0], ptce.count[1],
369 ptce.stride[0], ptce.stride[1]);
372 370
373 p += sprintf(p, 371 p += sprintf(p,
374 "TC Levels : %d\n" 372 "TC Levels : %d\n"
375 "Unique TC(s) : %d\n", 373 "Unique TC(s) : %d\n",
376 vm_info_1.pal_vm_info_1_s.num_tc_levels, 374 vm_info_1.pal_vm_info_1_s.num_tc_levels,
377 vm_info_1.pal_vm_info_1_s.max_unique_tcs); 375 vm_info_1.pal_vm_info_1_s.max_unique_tcs);
378 376
379 for(i=0; i < vm_info_1.pal_vm_info_1_s.num_tc_levels; i++) { 377 for(i=0; i < vm_info_1.pal_vm_info_1_s.num_tc_levels; i++) {
380 for (j=2; j>0 ; j--) { 378 for (j=2; j>0 ; j--) {
381 tc_pages = 0; /* just in case */ 379 tc_pages = 0; /* just in case */
382 380
383 381
384 /* even without unification, some levels may not be present */ 382 /* even without unification, some levels may not be present */
385 if ((status=ia64_pal_vm_info(i,j, &tc_info, &tc_pages)) != 0) { 383 if ((status=ia64_pal_vm_info(i,j, &tc_info, &tc_pages)) != 0) {
386 continue; 384 continue;
387 } 385 }
388 386
389 p += sprintf(p, 387 p += sprintf(p,
390 "\n%s Translation Cache Level %d:\n" 388 "\n%s Translation Cache Level %d:\n"
391 "\tHash sets : %d\n" 389 "\tHash sets : %d\n"
392 "\tAssociativity : %d\n" 390 "\tAssociativity : %d\n"
393 "\tNumber of entries : %d\n" 391 "\tNumber of entries : %d\n"
394 "\tFlags : ", 392 "\tFlags : ",
395 cache_types[j+tc_info.tc_unified], i+1, tc_info.tc_num_sets, 393 cache_types[j+tc_info.tc_unified], i+1,
396 tc_info.tc_associativity, tc_info.tc_num_entries); 394 tc_info.tc_num_sets,
395 tc_info.tc_associativity,
396 tc_info.tc_num_entries);
397 397
398 if (tc_info.tc_pf) p += sprintf(p, "PreferredPageSizeOptimized "); 398 if (tc_info.tc_pf)
399 if (tc_info.tc_unified) p += sprintf(p, "Unified "); 399 p += sprintf(p, "PreferredPageSizeOptimized ");
400 if (tc_info.tc_reduce_tr) p += sprintf(p, "TCReduction"); 400 if (tc_info.tc_unified)
401 p += sprintf(p, "Unified ");
402 if (tc_info.tc_reduce_tr)
403 p += sprintf(p, "TCReduction");
401 404
402 p += sprintf(p, "\n\tSupported page sizes: "); 405 p += sprintf(p, "\n\tSupported page sizes: ");
403 406
404 p = bitvector_process(p, tc_pages); 407 p = bitvector_process(p, tc_pages);
405 408
406 /* when unified date (j=2) is enough */ 409 /* when unified date (j=2) is enough */
407 if (tc_info.tc_unified) break; 410 if (tc_info.tc_unified)
411 break;
412 }
408 } 413 }
409 } 414 }
410 p += sprintf(p, "\n"); 415 p += sprintf(p, "\n");
@@ -440,14 +445,14 @@ register_info(char *page)
440 p += sprintf(p, "\n"); 445 p += sprintf(p, "\n");
441 } 446 }
442 447
443 if (ia64_pal_rse_info(&phys_stacked, &hints) != 0) return 0; 448 if (ia64_pal_rse_info(&phys_stacked, &hints) == 0) {
444 449
445 p += sprintf(p, 450 p += sprintf(p,
446 "RSE stacked physical registers : %ld\n" 451 "RSE stacked physical registers : %ld\n"
447 "RSE load/store hints : %ld (%s)\n", 452 "RSE load/store hints : %ld (%s)\n",
448 phys_stacked, hints.ph_data, 453 phys_stacked, hints.ph_data,
449 hints.ph_data < RSE_HINTS_COUNT ? rse_hints[hints.ph_data]: "(??)"); 454 hints.ph_data < RSE_HINTS_COUNT ? rse_hints[hints.ph_data]: "(??)");
450 455 }
451 if (ia64_pal_debug_info(&iregs, &dregs)) 456 if (ia64_pal_debug_info(&iregs, &dregs))
452 return 0; 457 return 0;
453 458
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 65f9958db9f0..1281c609ee98 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -382,13 +382,22 @@ ia64_mmu_init (void *my_cpu_data)
382 382
383 if (impl_va_bits < 51 || impl_va_bits > 61) 383 if (impl_va_bits < 51 || impl_va_bits > 61)
384 panic("CPU has bogus IMPL_VA_MSB value of %lu!\n", impl_va_bits - 1); 384 panic("CPU has bogus IMPL_VA_MSB value of %lu!\n", impl_va_bits - 1);
385 /*
386 * mapped_space_bits - PAGE_SHIFT is the total number of ptes we need,
387 * which must fit into "vmlpt_bits - pte_bits" slots. Second half of
388 * the test makes sure that our mapped space doesn't overlap the
389 * unimplemented hole in the middle of the region.
390 */
391 if ((mapped_space_bits - PAGE_SHIFT > vmlpt_bits - pte_bits) ||
392 (mapped_space_bits > impl_va_bits - 1))
393 panic("Cannot build a big enough virtual-linear page table"
394 " to cover mapped address space.\n"
395 " Try using a smaller page size.\n");
396
385 397
386 /* place the VMLPT at the end of each page-table mapped region: */ 398 /* place the VMLPT at the end of each page-table mapped region: */
387 pta = POW2(61) - POW2(vmlpt_bits); 399 pta = POW2(61) - POW2(vmlpt_bits);
388 400
389 if (POW2(mapped_space_bits) >= pta)
390 panic("mm/init: overlap between virtually mapped linear page table and "
391 "mapped kernel space!");
392 /* 401 /*
393 * Set the (virtually mapped linear) page table address. Bit 402 * Set the (virtually mapped linear) page table address. Bit
394 * 8 selects between the short and long format, bits 2-7 the 403 * 8 selects between the short and long format, bits 2-7 the