···307307308308 if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) {309309 printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status);310310- return 0;311311- }310310+ } else {312311313313-314314- p += sprintf(p,312312+ p += sprintf(p,315313 "Physical Address Space : %d bits\n"316314 "Virtual Address Space : %d bits\n"317315 "Protection Key Registers(PKR) : %d\n"···317319 "Hash Tag ID : 0x%x\n"318320 "Size of RR.rid : %d\n",319321 vm_info_1.pal_vm_info_1_s.phys_add_size,320320- vm_info_2.pal_vm_info_2_s.impl_va_msb+1, vm_info_1.pal_vm_info_1_s.max_pkr+1,321321- vm_info_1.pal_vm_info_1_s.key_size, vm_info_1.pal_vm_info_1_s.hash_tag_id,322322+ vm_info_2.pal_vm_info_2_s.impl_va_msb+1,323323+ vm_info_1.pal_vm_info_1_s.max_pkr+1,324324+ vm_info_1.pal_vm_info_1_s.key_size,325325+ vm_info_1.pal_vm_info_1_s.hash_tag_id,322326 vm_info_2.pal_vm_info_2_s.rid_size);323323-324324- if (ia64_pal_mem_attrib(&attrib) != 0)325325- return 0;326326-327327- p += sprintf(p, "Supported memory attributes : ");328328- sep = "";329329- for (i = 0; i < 8; i++) {330330- if (attrib & (1 << i)) {331331- p += sprintf(p, "%s%s", sep, mem_attrib[i]);332332- sep = ", ";333333- }334327 }335335- p += sprintf(p, "\n");328328+329329+ if (ia64_pal_mem_attrib(&attrib) == 0) {330330+ p += sprintf(p, "Supported memory attributes : ");331331+ sep = "";332332+ for (i = 0; i < 8; i++) {333333+ if (attrib & (1 << i)) {334334+ p += sprintf(p, "%s%s", sep, mem_attrib[i]);335335+ sep = ", ";336336+ }337337+ }338338+ p += sprintf(p, "\n");339339+ }336340337341 if ((status = ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {338342 printk(KERN_ERR "ia64_pal_vm_page_size=%ld\n", status);339339- return 0;343343+ } else {344344+345345+ p += sprintf(p,346346+ "\nTLB walker : %simplemented\n"347347+ "Number of DTR : %d\n"348348+ "Number of ITR : %d\n"349349+ "TLB insertable page sizes : ",350350+ vm_info_1.pal_vm_info_1_s.vw ? "" : "not ",351351+ vm_info_1.pal_vm_info_1_s.max_dtr_entry+1,352352+ vm_info_1.pal_vm_info_1_s.max_itr_entry+1);353353+354354+355355+ p = bitvector_process(p, tr_pages);356356+357357+ p += sprintf(p, "\nTLB purgeable page sizes : ");358358+359359+ p = bitvector_process(p, vw_pages);340360 }341341-342342- p += sprintf(p,343343- "\nTLB walker : %simplemented\n"344344- "Number of DTR : %d\n"345345- "Number of ITR : %d\n"346346- "TLB insertable page sizes : ",347347- vm_info_1.pal_vm_info_1_s.vw ? "" : "not ",348348- vm_info_1.pal_vm_info_1_s.max_dtr_entry+1,349349- vm_info_1.pal_vm_info_1_s.max_itr_entry+1);350350-351351-352352- p = bitvector_process(p, tr_pages);353353-354354- p += sprintf(p, "\nTLB purgeable page sizes : ");355355-356356- p = bitvector_process(p, vw_pages);357357-358361 if ((status=ia64_get_ptce(&ptce)) != 0) {359362 printk(KERN_ERR "ia64_get_ptce=%ld\n", status);360360- return 0;361361- }362362-363363- p += sprintf(p,363363+ } else {364364+ p += sprintf(p,364365 "\nPurge base address : 0x%016lx\n"365366 "Purge outer loop count : %d\n"366367 "Purge inner loop count : %d\n"367368 "Purge outer loop stride : %d\n"368369 "Purge inner loop stride : %d\n",369369- ptce.base, ptce.count[0], ptce.count[1], ptce.stride[0], ptce.stride[1]);370370+ ptce.base, ptce.count[0], ptce.count[1],371371+ ptce.stride[0], ptce.stride[1]);370372371371- p += sprintf(p,373373+ p += sprintf(p,372374 "TC Levels : %d\n"373375 "Unique TC(s) : %d\n",374376 vm_info_1.pal_vm_info_1_s.num_tc_levels,375377 vm_info_1.pal_vm_info_1_s.max_unique_tcs);376378377377- for(i=0; i < vm_info_1.pal_vm_info_1_s.num_tc_levels; i++) {378378- for (j=2; j>0 ; j--) {379379- tc_pages = 0; /* just in case */379379+ for(i=0; i < vm_info_1.pal_vm_info_1_s.num_tc_levels; i++) {380380+ for (j=2; j>0 ; j--) {381381+ tc_pages = 0; /* just in case */380382381383382382- /* even without unification, some levels may not be present */383383- if ((status=ia64_pal_vm_info(i,j, &tc_info, &tc_pages)) != 0) {384384- continue;385385- }384384+ /* even without unification, some levels may not be present */385385+ if ((status=ia64_pal_vm_info(i,j, &tc_info, &tc_pages)) != 0) {386386+ continue;387387+ }386388387387- p += sprintf(p,389389+ p += sprintf(p,388390 "\n%s Translation Cache Level %d:\n"389391 "\tHash sets : %d\n"390392 "\tAssociativity : %d\n"391393 "\tNumber of entries : %d\n"392394 "\tFlags : ",393393- cache_types[j+tc_info.tc_unified], i+1, tc_info.tc_num_sets,394394- tc_info.tc_associativity, tc_info.tc_num_entries);395395+ cache_types[j+tc_info.tc_unified], i+1,396396+ tc_info.tc_num_sets,397397+ tc_info.tc_associativity,398398+ tc_info.tc_num_entries);395399396396- if (tc_info.tc_pf) p += sprintf(p, "PreferredPageSizeOptimized ");397397- if (tc_info.tc_unified) p += sprintf(p, "Unified ");398398- if (tc_info.tc_reduce_tr) p += sprintf(p, "TCReduction");400400+ if (tc_info.tc_pf)401401+ p += sprintf(p, "PreferredPageSizeOptimized ");402402+ if (tc_info.tc_unified)403403+ p += sprintf(p, "Unified ");404404+ if (tc_info.tc_reduce_tr)405405+ p += sprintf(p, "TCReduction");399406400400- p += sprintf(p, "\n\tSupported page sizes: ");407407+ p += sprintf(p, "\n\tSupported page sizes: ");401408402402- p = bitvector_process(p, tc_pages);409409+ p = bitvector_process(p, tc_pages);403410404404- /* when unified date (j=2) is enough */405405- if (tc_info.tc_unified) break;411411+ /* when unified date (j=2) is enough */412412+ if (tc_info.tc_unified)413413+ break;414414+ }406415 }407416 }408417 p += sprintf(p, "\n");···445440 p += sprintf(p, "\n");446441 }447442448448- if (ia64_pal_rse_info(&phys_stacked, &hints) != 0) return 0;443443+ if (ia64_pal_rse_info(&phys_stacked, &hints) == 0) {449444450445 p += sprintf(p,451446 "RSE stacked physical registers : %ld\n"452447 "RSE load/store hints : %ld (%s)\n",453448 phys_stacked, hints.ph_data,454449 hints.ph_data < RSE_HINTS_COUNT ? rse_hints[hints.ph_data]: "(??)");455455-450450+ }456451 if (ia64_pal_debug_info(&iregs, &dregs))457452 return 0;458453
+12-3
arch/ia64/mm/init.c
···382382383383 if (impl_va_bits < 51 || impl_va_bits > 61)384384 panic("CPU has bogus IMPL_VA_MSB value of %lu!\n", impl_va_bits - 1);385385+ /*386386+ * mapped_space_bits - PAGE_SHIFT is the total number of ptes we need,387387+ * which must fit into "vmlpt_bits - pte_bits" slots. Second half of388388+ * the test makes sure that our mapped space doesn't overlap the389389+ * unimplemented hole in the middle of the region.390390+ */391391+ if ((mapped_space_bits - PAGE_SHIFT > vmlpt_bits - pte_bits) ||392392+ (mapped_space_bits > impl_va_bits - 1))393393+ panic("Cannot build a big enough virtual-linear page table"394394+ " to cover mapped address space.\n"395395+ " Try using a smaller page size.\n");396396+385397386398 /* place the VMLPT at the end of each page-table mapped region: */387399 pta = POW2(61) - POW2(vmlpt_bits);388400389389- if (POW2(mapped_space_bits) >= pta)390390- panic("mm/init: overlap between virtually mapped linear page table and "391391- "mapped kernel space!");392401 /*393402 * Set the (virtually mapped linear) page table address. Bit394403 * 8 selects between the short and long format, bits 2-7 the