xtensa: fix TLB sanity checker
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 13 Nov 2019 21:18:31 +0000 (13:18 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 26 Nov 2019 19:33:39 +0000 (11:33 -0800)
commit36de10c4788efc6efe6ff9aa10d38cb7eea4c818
tree3f76669fade798bb5e57154d69c00d6a09570600
parentf5ee2567921dec4f489c16d4fe22c3a7222d0ce6
xtensa: fix TLB sanity checker

Virtual and translated addresses retrieved by the xtensa TLB sanity
checker must be consistent, i.e. correspond to the same state of the
checked TLB entry. KASAN shadow memory is mapped dynamically using
auto-refill TLB entries and thus may change TLB state between the
virtual and translated address retrieval, resulting in false TLB
insanity report.
Move read_xtlb_translation close to read_xtlb_virtual to make sure that
read values are consistent.

Cc: stable@vger.kernel.org
Fixes: a99e07ee5e88 ("xtensa: check TLB sanity on return to userspace")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/mm/tlb.c