X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fparisc%2Fkernel%2Fcache.c;h=9fc0614401223e72cc94726b92f654b51d85d29b;hb=2cf7311f007833d5818fc9241c09a372c0325a4a;hp=eadc88c5a3d8a7e931b9d950b685f75df296eaca;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index eadc88c5a..9fc061440 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -69,7 +69,7 @@ update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) { struct page *page = pte_page(pte); - if (pfn_valid(page_to_pfn(page)) && page_mapping(page) && + if (VALID_PAGE(page) && page_mapping(page) && test_bit(PG_dcache_dirty, &page->flags)) { flush_kernel_dcache_page(page_address(page)); @@ -82,11 +82,10 @@ show_cache_info(struct seq_file *m) { seq_printf(m, "I-cache\t\t: %ld KB\n", cache_info.ic_size/1024 ); - seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %d-way associative)\n", + seq_printf(m, "D-cache\t\t: %ld KB (%s)%s\n", cache_info.dc_size/1024, (cache_info.dc_conf.cc_wt ? "WT":"WB"), - (cache_info.dc_conf.cc_sh ? ", shared I/D":""), - (cache_info.dc_conf.cc_assoc) + (cache_info.dc_conf.cc_sh ? " - shared I/D":"") ); seq_printf(m, "ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n", @@ -124,60 +123,51 @@ parisc_cache_init(void) panic("parisc_cache_init: pdc_cache_info failed"); #if 0 - printk("ic_size %lx dc_size %lx it_size %lx\n", - cache_info.ic_size, - cache_info.dc_size, - cache_info.it_size); - - printk("DC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n", - cache_info.dc_base, - cache_info.dc_stride, - cache_info.dc_count, - cache_info.dc_loop); - - printk("dc_conf = 0x%lx alias %d blk %d line %d shift %d\n", - *(unsigned long *) (&cache_info.dc_conf), - cache_info.dc_conf.cc_alias, - cache_info.dc_conf.cc_block, - cache_info.dc_conf.cc_line, - cache_info.dc_conf.cc_shift); - printk(" wt %d sh %d cst %d assoc %d\n", - cache_info.dc_conf.cc_wt, - cache_info.dc_conf.cc_sh, - cache_info.dc_conf.cc_cst, - cache_info.dc_conf.cc_assoc); - - printk("IC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n", - cache_info.ic_base, - cache_info.ic_stride, - cache_info.ic_count, - cache_info.ic_loop); - - printk("ic_conf = 0x%lx alias %d blk %d line %d shift %d\n", - *(unsigned long *) (&cache_info.ic_conf), - cache_info.ic_conf.cc_alias, - cache_info.ic_conf.cc_block, - cache_info.ic_conf.cc_line, - cache_info.ic_conf.cc_shift); - printk(" wt %d sh %d cst %d assoc %d\n", - cache_info.ic_conf.cc_wt, - cache_info.ic_conf.cc_sh, - cache_info.ic_conf.cc_cst, - cache_info.ic_conf.cc_assoc); - - printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n", - cache_info.dt_conf.tc_sh, - cache_info.dt_conf.tc_page, - cache_info.dt_conf.tc_cst, - cache_info.dt_conf.tc_aid, - cache_info.dt_conf.tc_pad1); - - printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n", - cache_info.it_conf.tc_sh, - cache_info.it_conf.tc_page, - cache_info.it_conf.tc_cst, - cache_info.it_conf.tc_aid, - cache_info.it_conf.tc_pad1); + printk(KERN_DEBUG "ic_size %lx dc_size %lx it_size %lx pdc_cache_info %d*long pdc_cache_cf %d\n", + cache_info.ic_size, + cache_info.dc_size, + cache_info.it_size, + sizeof (struct pdc_cache_info) / sizeof (long), + sizeof (struct pdc_cache_cf) + ); + + printk(KERN_DEBUG "dc base %x dc stride %x dc count %x dc loop %d\n", + cache_info.dc_base, + cache_info.dc_stride, + cache_info.dc_count, + cache_info.dc_loop); + + printk(KERN_DEBUG "dc conf: alias %d block %d line %d wt %d sh %d cst %d assoc %d\n", + cache_info.dc_conf.cc_alias, + cache_info.dc_conf.cc_block, + cache_info.dc_conf.cc_line, + cache_info.dc_conf.cc_wt, + cache_info.dc_conf.cc_sh, + cache_info.dc_conf.cc_cst, + cache_info.dc_conf.cc_assoc); + + printk(KERN_DEBUG "ic conf: alias %d block %d line %d wt %d sh %d cst %d assoc %d\n", + cache_info.ic_conf.cc_alias, + cache_info.ic_conf.cc_block, + cache_info.ic_conf.cc_line, + cache_info.ic_conf.cc_wt, + cache_info.ic_conf.cc_sh, + cache_info.ic_conf.cc_cst, + cache_info.ic_conf.cc_assoc); + + printk(KERN_DEBUG "dt conf: sh %d page %d cst %d aid %d pad1 %d \n", + cache_info.dt_conf.tc_sh, + cache_info.dt_conf.tc_page, + cache_info.dt_conf.tc_cst, + cache_info.dt_conf.tc_aid, + cache_info.dt_conf.tc_pad1); + + printk(KERN_DEBUG "it conf: sh %d page %d cst %d aid %d pad1 %d \n", + cache_info.it_conf.tc_sh, + cache_info.it_conf.tc_page, + cache_info.it_conf.tc_cst, + cache_info.it_conf.tc_aid, + cache_info.it_conf.tc_pad1); #endif split_tlb = 0; @@ -189,14 +179,10 @@ parisc_cache_init(void) split_tlb = 1; } - /* "New and Improved" version from Jim Hull - * (1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift)) - */ -#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift)) - dcache_stride = CAFL_STRIDE(cache_info.dc_conf); - icache_stride = CAFL_STRIDE(cache_info.ic_conf); -#undef CAFL_STRIDE - + dcache_stride = (1 << (cache_info.dc_conf.cc_block + 3)) * + cache_info.dc_conf.cc_line; + icache_stride = (1 << (cache_info.ic_conf.cc_block + 3)) * + cache_info.ic_conf.cc_line; #ifndef CONFIG_PA20 if (pdc_btlb_info(&btlb_info) < 0) { memset(&btlb_info, 0, sizeof btlb_info); @@ -205,8 +191,8 @@ parisc_cache_init(void) if ((boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) == PDC_MODEL_NVA_UNSUPPORTED) { - printk(KERN_WARNING "parisc_cache_init: Only equivalent aliasing supported!\n"); -#if 0 + printk(KERN_WARNING "Only equivalent aliasing supported\n"); +#ifndef CONFIG_SMP panic("SMP kernel required to avoid non-equivalent aliasing"); #endif } @@ -242,7 +228,7 @@ void disable_sr_hashing(void) disable_sr_hashing_asm(srhash_type); } -void flush_dcache_page(struct page *page) +void __flush_dcache_page(struct page *page) { struct address_space *mapping = page_mapping(page); struct vm_area_struct *mpnt = NULL; @@ -250,14 +236,6 @@ void flush_dcache_page(struct page *page) unsigned long offset; unsigned long addr; pgoff_t pgoff; - pte_t *pte; - unsigned long pfn = page_to_pfn(page); - - - if (mapping && !mapping_mapped(mapping)) { - set_bit(PG_dcache_dirty, &page->flags); - return; - } flush_kernel_dcache_page(page_address(page)); @@ -284,23 +262,16 @@ void flush_dcache_page(struct page *page) * isn't there, there's no point exciting the * nadtlb handler into a nullification frenzy */ - - if(!(pte = translation_exists(mpnt, addr))) + if (!translation_exists(mpnt, addr)) continue; - /* make sure we really have this page: the private - * mappings may cover this area but have COW'd this - * particular page */ - if(pte_pfn(*pte) != pfn) - continue; - __flush_cache_page(mpnt, addr); break; } flush_dcache_mmap_unlock(mapping); } -EXPORT_SYMBOL(flush_dcache_page); +EXPORT_SYMBOL(__flush_dcache_page); /* Defined in arch/parisc/kernel/pacache.S */ EXPORT_SYMBOL(flush_kernel_dcache_range_asm);