On 9-Jul-13, at 4:59 PM, John David Anglin wrote:
On 7/9/2013 3:45 PM, Alex Ivanov wrote:
The panic on SMP kernel changed to another one:
http://pastebin.com/SfUfd0Un
This is just a guess but I don't think page is valid
if the pfn is not valid. You might try this untested change.
flush_cache_mm might have same problem (i.e., we may need to
check whether the pfn for the pte is valid).
This version compiles and boots on rp3440.
Dave
--
John David Anglin dave.anglin@xxxxxxxx
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 65fb4cb..b07720f 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -74,10 +74,13 @@ EXPORT_SYMBOL(flush_cache_all_local);
void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
- struct page *page = pte_page(*ptep);
+ struct page *page;
- if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
- test_bit(PG_dcache_dirty, &page->flags)) {
+ if (!pfn_valid(pte_pfn(*ptep)))
+ return;
+
+ page = pte_page(*ptep);
+ if (page_mapping(page) && test_bit(PG_dcache_dirty, &page->flags)) {
flush_kernel_dcache_page(page);
clear_bit(PG_dcache_dirty, &page->flags);
@@ -519,8 +522,9 @@ void flush_cache_mm(struct mm_struct *mm)
pte_t *ptep = get_ptep(pgd, addr);
if (ptep != NULL) {
pte_t pte = *ptep;
- __flush_cache_page(vma, addr,
- page_to_phys(pte_page(pte)));
+ if (pfn_valid(pte_pfn(pte)))
+ __flush_cache_page(vma, addr,
+ page_to_phys(pte_page(pte)));
}
}
}