Pull sim-fixes into release branch

Tony Luck c85b2a5f 49a28cc8

+103 -70
+25 -6
arch/ia64/hp/sim/boot/boot_head.S
··· 4 4 */ 5 5 6 6 #include <asm/asmmacro.h> 7 + #include <asm/pal.h> 7 8 8 9 .bss 9 10 .align 16 ··· 50 49 br.sptk.few b7 51 50 END(jmp_to_kernel) 52 51 53 - 52 + /* 53 + * r28 contains the index of the PAL function 54 + * r29--31 the args 55 + * Return values in ret0--3 (r8--11) 56 + */ 54 57 GLOBAL_ENTRY(pal_emulator_static) 55 58 mov r8=-1 56 59 mov r9=256 ··· 67 62 cmp.gtu p6,p7=r9,r28 68 63 (p6) br.cond.sptk.few stacked 69 64 ;; 70 - static: cmp.eq p6,p7=6,r28 /* PAL_PTCE_INFO */ 65 + static: cmp.eq p6,p7=PAL_PTCE_INFO,r28 71 66 (p7) br.cond.sptk.few 1f 72 67 ;; 73 68 mov r8=0 /* status = 0 */ ··· 75 70 movl r10=0x0000000200000003 /* count[0], count[1] */ 76 71 movl r11=0x1000000000002000 /* stride[0], stride[1] */ 77 72 br.cond.sptk.few rp 78 - 1: cmp.eq p6,p7=14,r28 /* PAL_FREQ_RATIOS */ 73 + 1: cmp.eq p6,p7=PAL_FREQ_RATIOS,r28 79 74 (p7) br.cond.sptk.few 1f 80 75 mov r8=0 /* status = 0 */ 81 76 movl r9 =0x100000064 /* proc_ratio (1/100) */ 82 77 movl r10=0x100000100 /* bus_ratio<<32 (1/256) */ 83 78 movl r11=0x100000064 /* itc_ratio<<32 (1/100) */ 84 79 ;; 85 - 1: cmp.eq p6,p7=19,r28 /* PAL_RSE_INFO */ 80 + 1: cmp.eq p6,p7=PAL_RSE_INFO,r28 86 81 (p7) br.cond.sptk.few 1f 87 82 mov r8=0 /* status = 0 */ 88 83 mov r9=96 /* num phys stacked */ 89 84 mov r10=0 /* hints */ 90 85 mov r11=0 91 86 br.cond.sptk.few rp 92 - 1: cmp.eq p6,p7=1,r28 /* PAL_CACHE_FLUSH */ 87 + 1: cmp.eq p6,p7=PAL_CACHE_FLUSH,r28 /* PAL_CACHE_FLUSH */ 93 88 (p7) br.cond.sptk.few 1f 94 89 mov r9=ar.lc 95 90 movl r8=524288 /* flush 512k million cache lines (16MB) */ ··· 107 102 mov ar.lc=r9 108 103 mov r8=r0 109 104 ;; 110 - 1: cmp.eq p6,p7=15,r28 /* PAL_PERF_MON_INFO */ 105 + 1: cmp.eq p6,p7=PAL_PERF_MON_INFO,r28 111 106 (p7) br.cond.sptk.few 1f 112 107 mov r8=0 /* status = 0 */ 113 108 movl r9 =0x08122f04 /* generic=4 width=47 retired=8 cycles=18 */ ··· 142 137 ;; 143 138 st8 [r29]=r0,16 /* clear remaining bits */ 144 139 st8 [r18]=r0,16 /* clear remaining bits */ 140 + ;; 141 + 1: cmp.eq p6,p7=PAL_VM_SUMMARY,r28 142 + (p7) br.cond.sptk.few 1f 143 + mov r8=0 /* status = 0 */ 144 + movl r9=0x2044040020F1865 /* num_tc_levels=2, num_unique_tcs=4 */ 145 + /* max_itr_entry=64, max_dtr_entry=64 */ 146 + /* hash_tag_id=2, max_pkr=15 */ 147 + /* key_size=24, phys_add_size=50, vw=1 */ 148 + movl r10=0x183C /* rid_size=24, impl_va_msb=60 */ 149 + ;; 150 + 1: cmp.eq p6,p7=PAL_MEM_ATTRIB,r28 151 + (p7) br.cond.sptk.few 1f 152 + mov r8=0 /* status = 0 */ 153 + mov r9=0x80|0x01 /* NatPage|WB */ 145 154 ;; 146 155 1: br.cond.sptk.few rp 147 156 stacked:
+66 -61
arch/ia64/kernel/palinfo.c
··· 307 307 308 308 if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { 309 309 printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status); 310 - return 0; 311 - } 310 + } else { 312 311 313 - 314 - p += sprintf(p, 312 + p += sprintf(p, 315 313 "Physical Address Space : %d bits\n" 316 314 "Virtual Address Space : %d bits\n" 317 315 "Protection Key Registers(PKR) : %d\n" ··· 317 319 "Hash Tag ID : 0x%x\n" 318 320 "Size of RR.rid : %d\n", 319 321 vm_info_1.pal_vm_info_1_s.phys_add_size, 320 - vm_info_2.pal_vm_info_2_s.impl_va_msb+1, vm_info_1.pal_vm_info_1_s.max_pkr+1, 321 - vm_info_1.pal_vm_info_1_s.key_size, vm_info_1.pal_vm_info_1_s.hash_tag_id, 322 + vm_info_2.pal_vm_info_2_s.impl_va_msb+1, 323 + vm_info_1.pal_vm_info_1_s.max_pkr+1, 324 + vm_info_1.pal_vm_info_1_s.key_size, 325 + vm_info_1.pal_vm_info_1_s.hash_tag_id, 322 326 vm_info_2.pal_vm_info_2_s.rid_size); 323 - 324 - if (ia64_pal_mem_attrib(&attrib) != 0) 325 - return 0; 326 - 327 - p += sprintf(p, "Supported memory attributes : "); 328 - sep = ""; 329 - for (i = 0; i < 8; i++) { 330 - if (attrib & (1 << i)) { 331 - p += sprintf(p, "%s%s", sep, mem_attrib[i]); 332 - sep = ", "; 333 - } 334 327 } 335 - p += sprintf(p, "\n"); 328 + 329 + if (ia64_pal_mem_attrib(&attrib) == 0) { 330 + p += sprintf(p, "Supported memory attributes : "); 331 + sep = ""; 332 + for (i = 0; i < 8; i++) { 333 + if (attrib & (1 << i)) { 334 + p += sprintf(p, "%s%s", sep, mem_attrib[i]); 335 + sep = ", "; 336 + } 337 + } 338 + p += sprintf(p, "\n"); 339 + } 336 340 337 341 if ((status = ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) { 338 342 printk(KERN_ERR "ia64_pal_vm_page_size=%ld\n", status); 339 - return 0; 343 + } else { 344 + 345 + p += sprintf(p, 346 + "\nTLB walker : %simplemented\n" 347 + "Number of DTR : %d\n" 348 + "Number of ITR : %d\n" 349 + "TLB insertable page sizes : ", 350 + vm_info_1.pal_vm_info_1_s.vw ? "" : "not ", 351 + vm_info_1.pal_vm_info_1_s.max_dtr_entry+1, 352 + vm_info_1.pal_vm_info_1_s.max_itr_entry+1); 353 + 354 + 355 + p = bitvector_process(p, tr_pages); 356 + 357 + p += sprintf(p, "\nTLB purgeable page sizes : "); 358 + 359 + p = bitvector_process(p, vw_pages); 340 360 } 341 - 342 - p += sprintf(p, 343 - "\nTLB walker : %simplemented\n" 344 - "Number of DTR : %d\n" 345 - "Number of ITR : %d\n" 346 - "TLB insertable page sizes : ", 347 - vm_info_1.pal_vm_info_1_s.vw ? "" : "not ", 348 - vm_info_1.pal_vm_info_1_s.max_dtr_entry+1, 349 - vm_info_1.pal_vm_info_1_s.max_itr_entry+1); 350 - 351 - 352 - p = bitvector_process(p, tr_pages); 353 - 354 - p += sprintf(p, "\nTLB purgeable page sizes : "); 355 - 356 - p = bitvector_process(p, vw_pages); 357 - 358 361 if ((status=ia64_get_ptce(&ptce)) != 0) { 359 362 printk(KERN_ERR "ia64_get_ptce=%ld\n", status); 360 - return 0; 361 - } 362 - 363 - p += sprintf(p, 363 + } else { 364 + p += sprintf(p, 364 365 "\nPurge base address : 0x%016lx\n" 365 366 "Purge outer loop count : %d\n" 366 367 "Purge inner loop count : %d\n" 367 368 "Purge outer loop stride : %d\n" 368 369 "Purge inner loop stride : %d\n", 369 - ptce.base, ptce.count[0], ptce.count[1], ptce.stride[0], ptce.stride[1]); 370 + ptce.base, ptce.count[0], ptce.count[1], 371 + ptce.stride[0], ptce.stride[1]); 370 372 371 - p += sprintf(p, 373 + p += sprintf(p, 372 374 "TC Levels : %d\n" 373 375 "Unique TC(s) : %d\n", 374 376 vm_info_1.pal_vm_info_1_s.num_tc_levels, 375 377 vm_info_1.pal_vm_info_1_s.max_unique_tcs); 376 378 377 - for(i=0; i < vm_info_1.pal_vm_info_1_s.num_tc_levels; i++) { 378 - for (j=2; j>0 ; j--) { 379 - tc_pages = 0; /* just in case */ 379 + for(i=0; i < vm_info_1.pal_vm_info_1_s.num_tc_levels; i++) { 380 + for (j=2; j>0 ; j--) { 381 + tc_pages = 0; /* just in case */ 380 382 381 383 382 - /* even without unification, some levels may not be present */ 383 - if ((status=ia64_pal_vm_info(i,j, &tc_info, &tc_pages)) != 0) { 384 - continue; 385 - } 384 + /* even without unification, some levels may not be present */ 385 + if ((status=ia64_pal_vm_info(i,j, &tc_info, &tc_pages)) != 0) { 386 + continue; 387 + } 386 388 387 - p += sprintf(p, 389 + p += sprintf(p, 388 390 "\n%s Translation Cache Level %d:\n" 389 391 "\tHash sets : %d\n" 390 392 "\tAssociativity : %d\n" 391 393 "\tNumber of entries : %d\n" 392 394 "\tFlags : ", 393 - cache_types[j+tc_info.tc_unified], i+1, tc_info.tc_num_sets, 394 - tc_info.tc_associativity, tc_info.tc_num_entries); 395 + cache_types[j+tc_info.tc_unified], i+1, 396 + tc_info.tc_num_sets, 397 + tc_info.tc_associativity, 398 + tc_info.tc_num_entries); 395 399 396 - if (tc_info.tc_pf) p += sprintf(p, "PreferredPageSizeOptimized "); 397 - if (tc_info.tc_unified) p += sprintf(p, "Unified "); 398 - if (tc_info.tc_reduce_tr) p += sprintf(p, "TCReduction"); 400 + if (tc_info.tc_pf) 401 + p += sprintf(p, "PreferredPageSizeOptimized "); 402 + if (tc_info.tc_unified) 403 + p += sprintf(p, "Unified "); 404 + if (tc_info.tc_reduce_tr) 405 + p += sprintf(p, "TCReduction"); 399 406 400 - p += sprintf(p, "\n\tSupported page sizes: "); 407 + p += sprintf(p, "\n\tSupported page sizes: "); 401 408 402 - p = bitvector_process(p, tc_pages); 409 + p = bitvector_process(p, tc_pages); 403 410 404 - /* when unified date (j=2) is enough */ 405 - if (tc_info.tc_unified) break; 411 + /* when unified date (j=2) is enough */ 412 + if (tc_info.tc_unified) 413 + break; 414 + } 406 415 } 407 416 } 408 417 p += sprintf(p, "\n"); ··· 445 440 p += sprintf(p, "\n"); 446 441 } 447 442 448 - if (ia64_pal_rse_info(&phys_stacked, &hints) != 0) return 0; 443 + if (ia64_pal_rse_info(&phys_stacked, &hints) == 0) { 449 444 450 445 p += sprintf(p, 451 446 "RSE stacked physical registers : %ld\n" 452 447 "RSE load/store hints : %ld (%s)\n", 453 448 phys_stacked, hints.ph_data, 454 449 hints.ph_data < RSE_HINTS_COUNT ? rse_hints[hints.ph_data]: "(??)"); 455 - 450 + } 456 451 if (ia64_pal_debug_info(&iregs, &dregs)) 457 452 return 0; 458 453
+12 -3
arch/ia64/mm/init.c
··· 382 382 383 383 if (impl_va_bits < 51 || impl_va_bits > 61) 384 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 398 /* place the VMLPT at the end of each page-table mapped region: */ 387 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 402 * Set the (virtually mapped linear) page table address. Bit 394 403 * 8 selects between the short and long format, bits 2-7 the