linux_dsm_epyc7002/arch/mips/include/asm
David Daney ac53c4fca4 MIPS: Avoid mcheck by flushing page range in huge_ptep_set_access_flags()
Problem:

1) Huge page mapping of anonymous memory is initially invalid.  Will be
   faulted in by copy-on-write mechanism.

2) Userspace attempts store at the end of the huge mapping.

3) TLB Refill exception handler fill TLB with a normal (4K sized)
   invalid page at the end of the huge mapping virtual address range.

4) Userspace restarted, and re-attempts the store at the end of the
   huge mapping.

5) Page from #3 is invalid, we get a fault and go to the hugepage
   fault handler.  This tries to map a huge page and calls
   huge_ptep_set_access_flags() to install the mapping.

6) We just call the generic ptep_set_access_flags() to set up the page
   tables, but the flush there assumes a normal (4K sized) page and
   only tries to flush the first part of the huge page virtual address
   out of the TLB, since the existing entry from step #3 doesn't
   conflict, nothing is flushed.

7) We attempt to load the mapping into the TLB, but because it
   conflicts with the entry from step #3, we get a Machine Check
   exception.

The fix: Flush the entire rage covered by the huge page in
huge_ptep_set_access_flags(), and remove the optimization in
local_flush_tlb_range() so that the flush actually does the correct
thing.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Hillf Danton <dhillf@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/4661/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
(cherry picked from commit dd617f258cc39d36be26afee9912624a2d23112c)
2012-12-04 16:57:54 +01:00
..
dec
emma
fw
ip32
lasat
mach-ar7
mach-ath79 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-au1x00 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-bcm47xx
mach-bcm63xx MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-cavium-octeon MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-cobalt MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-db1x00 MIPS: Alchemy: Merge PB1100/1500 support into DB1000 code. 2012-10-11 11:11:20 +02:00
mach-dec
mach-emma2rh
mach-generic
mach-ip22 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-ip27 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-ip28 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-ip32 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-jazz
mach-jz4740 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-lantiq
mach-lasat
mach-loongson MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-loongson1
mach-malta
mach-netlogic MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-pnx833x
mach-pnx8550
mach-powertv MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-rc32434 MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-rm MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-sead3
mach-sibyte MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-tx39xx
mach-tx49xx MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mach-vr41xx
mach-wrppmc
mach-yosemite MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
mips-boards
netlogic
octeon Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-10-09 16:08:04 +09:00
pci
pmc-sierra/msp71xx MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required. 2012-10-11 11:10:43 +02:00
sgi
sibyte
sn
txx9
vr41xx
xtalk
abi.h
addrspace.h
amon.h
arch_hweight.h
asm-offsets.h
asm.h
asmmacro-32.h
asmmacro-64.h
asmmacro.h
atomic.h Improve atomic.h robustness 2012-10-11 11:02:36 +02:00
barrier.h
bcache.h
bitops.h MIPS: Remove irqflags.h dependency from bitops.h 2012-11-09 10:59:10 +01:00
bmips.h
bootinfo.h
branch.h
break.h
bug.h
bugs.h
cache.h
cacheflush.h
cacheops.h
cevt-r4k.h
checksum.h
clkdev.h
clock.h
cmp.h
cmpxchg.h
compat-signal.h compat: move compat_siginfo_t definition to asm/compat.h 2012-10-06 03:05:16 +09:00
compat.h MIPS: compat: Implement is_compat_task() by testing for 32-bit address space. 2012-11-09 10:58:29 +01:00
compiler.h
cop2.h
cpu-features.h MIPS: Add detection of DSP ASE Revision 2. 2012-10-11 11:05:03 +02:00
cpu-info.h
cpu.h MIPS: Add detection of DSP ASE Revision 2. 2012-10-11 11:05:03 +02:00
cputime.h
current.h
debug.h
delay.h MIPS: Make __{,n,u}delay declarations match definitions and generic delay.h 2012-10-16 22:20:03 +02:00
device.h
div64.h
dma-mapping.h
dma.h
ds1287.h
dsp.h
edac.h
elf.h
emergency-restart.h
errno.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
exec.h
fb.h
fixmap.h
floppy.h
fpregdef.h
fpu_emulator.h
fpu.h
ftrace.h
futex.h
gcmpregs.h
gic.h
gio_device.h
gpio.h
gt64120.h
hardirq.h
hazards.h
highmem.h
hugetlb.h MIPS: Avoid mcheck by flushing page range in huge_ptep_set_access_flags() 2012-12-04 16:57:54 +01:00
hw_irq.h
i8259.h
ide.h
inst.h
io.h MIPS: Remove irqflags.h dependency from bitops.h 2012-11-09 10:59:10 +01:00
irq_cpu.h
irq_gt641xx.h
irq_regs.h
irq.h
irqflags.h MIPS: Make irqflags.h functions preempt-safe for non-mipsr2 cpus 2012-11-09 10:59:21 +01:00
isadep.h
jazz.h
jazzdma.h
jump_label.h
Kbuild UAPI: Place comments in empty arch Kbuilds to make them non-empty 2012-10-17 12:31:16 +01:00
kdebug.h
kexec.h
kgdb.h
kmap_types.h
kprobes.h
kspd.h MIPS: MT: Remove kspd. 2012-10-11 11:14:12 +02:00
linkage.h
local64.h
local.h
m48t37.h
mc146818-time.h
mc146818rtc.h
mips_machine.h
mips_mt.h
mipsmtregs.h
mipsprom.h
mipsregs.h MIPS: Add detection of DSP ASE Revision 2. 2012-10-11 11:05:03 +02:00
mmu_context.h
mmu.h
mmzone.h
module.h
msc01_ic.h
mutex.h
nile4.h
paccess.h
page.h
parport.h
pci.h
percpu.h
perf_event.h
pgalloc.h
pgtable-32.h
pgtable-64.h MIPS: Hugetlbfs: Handle huge pages correctly in pmd_bad() 2012-10-17 01:01:12 +02:00
pgtable-bits.h
pgtable.h
pmon.h
prefetch.h
processor.h
prom.h
ptrace.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
r4k-timer.h
r4kcache.h
reboot.h
reg.h
regdef.h
rm9k-ocd.h
rtlx.h
scatterlist.h
seccomp.h
sections.h
segment.h
serial.h
setup.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
sgialib.h
sgiarcs.h
shmparam.h
sigcontext.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
siginfo.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
signal.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
sim.h
smp-ops.h
smp.h
smtc_ipi.h
smtc_proc.h
smtc.h
smvp.h
sni.h
socket.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
sparsemem.h
spinlock_types.h
spinlock.h
spram.h
stackframe.h
stacktrace.h
string.h
suspend.h
switch_to.h
termios.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
thread_info.h MIPS: compat: Delete now unused TIF_32BIT. 2012-11-09 10:58:36 +01:00
time.h
timex.h
titan_dep.h
tlb.h
tlbdebug.h
tlbflush.h
tlbmisc.h
topology.h
traps.h
txx9irq.h
txx9pio.h
txx9tmr.h
types.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
uaccess.h
uasm.h
ucontext.h
unaligned.h
unistd.h UAPI: (Scripted) Disintegrate arch/mips/include/asm 2012-10-09 09:47:14 +01:00
user.h
vdso.h
vga.h
vpe.h
war.h
watch.h
wbflush.h
xor.h