linux/arch/nios2
Nicholas Piggin ef5cbcb6bf nios2: update_mmu_cache clear the old entry from the TLB
Fault paths like do_read_fault will install a Linux pte with the young
bit clear. The CPU will fault again because the TLB has not been
updated, this time a valid pte exists so handle_pte_fault will just
set the young bit with ptep_set_access_flags, which flushes the TLB.

The TLB is flushed so the next attempt will go to the fast TLB handler
which loads the TLB with the new Linux pte. The access then proceeds.

This design is fragile to depend on the young bit being clear after
the initial Linux fault. A proposed core mm change to immediately set
the young bit upon such a fault, results in ptep_set_access_flags not
flushing the TLB because it finds no change to the pte. The spurious
fault fix path only flushes the TLB if the access was a store. If it
was a load, then this results in an infinite loop of page faults.

This change adds a TLB flush in update_mmu_cache, which removes that
TLB entry upon the first fault. This will cause the fast TLB handler
to load the new pte and avoid the Linux page fault entirely.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2019-03-07 05:29:35 +08:00
..
boot kbuild: consolidate Devicetree dtb build rules 2018-10-02 09:23:21 -05:00
configs nios2: defconfig: Cleanup from old Kconfig options 2018-02-11 23:04:53 +08:00
include arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
kernel nios2: ksyms: Add missing symbol exports 2019-03-07 05:29:35 +08:00
lib nios2: memset: use the right constraint modifier for the %4 output operand 2016-04-27 16:35:55 +08:00
mm nios2: update_mmu_cache clear the old entry from the TLB 2019-03-07 05:29:35 +08:00
platform nios2: remove redundant 'default n' from Kconfig-s 2019-03-07 05:29:35 +08:00
Kconfig nios2: remove redundant 'default n' from Kconfig-s 2019-03-07 05:29:35 +08:00
Kconfig.debug nios2: kconfig: remove duplicate DEBUG_STACK_USAGE symbol defintions 2018-08-27 09:47:20 +08:00
Makefile kbuild: consolidate Devicetree dtb build rules 2018-10-02 09:23:21 -05:00