xtensa: fix TLBTEMP_BASE_2 region handling in fast_second_level_miss
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 21 Jul 2014 18:01:51 +0000 (22:01 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 14 Aug 2014 07:59:19 +0000 (11:59 +0400)
commit7128039fe2dd3d59da9e4ffa036f3aaa3ba87b9f
tree4789750af1f4c4bafacd3277ca65b0b3ae79f26f
parentdec7305d9f752f6ad2ec30ec8a723182437c5aa5
xtensa: fix TLBTEMP_BASE_2 region handling in fast_second_level_miss

Current definition of TLBTEMP_BASE_2 is always 32K above the
TLBTEMP_BASE_1, whereas fast_second_level_miss handler for the TLBTEMP
region analyzes virtual address bit (PAGE_SHIFT + DCACHE_ALIAS_ORDER)
to determine TLBTEMP region where the fault happened. The size of the
TLBTEMP region is also checked incorrectly: not 64K, but twice data
cache way size (whicht may as well be less than the instruction cache
way size).

Fix TLBTEMP_BASE_2 to be TLBTEMP_BASE_1 + data cache way size.
Provide TLBTEMP_SIZE that is a greater of doubled data cache way size or
the instruction cache way size, and use it to determine if the second
level TLB miss occured in the TLBTEMP region.

Practical occurence of page faults in the TLBTEMP area is extremely
rare, this code can be tested by deletion of all w[di]tlb instructions
in the tlbtemp_mapping region.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/pgtable.h
arch/xtensa/kernel/entry.S