]> Pileus Git - ~andy/linux/commit
parisc: Fix cache routines to ignore vma's with an invalid pfn
authorJohn David Anglin <dave.anglin@bell.net>
Tue, 23 Jul 2013 16:27:52 +0000 (12:27 -0400)
committerHelge Deller <deller@gmx.de>
Wed, 31 Jul 2013 21:41:47 +0000 (23:41 +0200)
commit50861f5a02dbf939c27d35a26c472885e2844188
treea039ce8beb259f6d205493c7f6380f2b52dbca1a
parent06693f305e60202d2795a10bee7fb7da23bc2acc
parisc: Fix cache routines to ignore vma's with an invalid pfn

The parisc architecture does not have a pte special bit. As a result,
special mappings are handled with the VM_PFNMAP and VM_MIXEDMAP flags.
VM_MIXEDMAP mappings may or may not have a "struct page" backing. When
pfn_valid() is false, there is no "struct page" backing. Otherwise, they
are treated as normal pages.

The FireGL driver uses the VM_MIXEDMAP without a backing "struct page".
This treatment caused a panic due to a TLB data miss in
update_mmu_cache. This appeared to be in the code generated for
page_address(). We were in fact using a very circular bit of code to
determine the physical address of the PFN in various cache routines.
This wasn't valid when there was no "struct page" backing.  The needed
address can in fact be determined simply from the PFN itself without
using the "struct page".

The attached patch updates update_mmu_cache(), flush_cache_mm(),
flush_cache_range() and flush_cache_page() to check pfn_valid() and to
directly compute the PFN physical and virtual addresses.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: <stable@vger.kernel.org> # 3.10
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/cache.c