linux-brain/arch/m68k
Greg Ungerer 8f2f46791e m68k: fix "bad page state" oops on ColdFire boot
[ Upstream commit ecd60532e0 ]

Booting a ColdFire m68k core with MMU enabled causes a "bad page state"
oops since commit 1d40a5ea01 ("mm: mark pages in use for page tables"):

 BUG: Bad page state in process sh  pfn:01ce2
 page:004fefc8 count:0 mapcount:-1024 mapping:00000000 index:0x0
 flags: 0x0()
 raw: 00000000 00000000 00000000 fffffbff 00000000 00000100 00000200 00000000
 raw: 039c4000
 page dumped because: nonzero mapcount
 Modules linked in:
 CPU: 0 PID: 22 Comm: sh Not tainted 4.17.0-07461-g1d40a5ea01d5 #13

Fix by calling pgtable_page_dtor() in our __pte_free_tlb() code path,
so that the PG_table flag is cleared before we free the pte page.

Note that I had to change the type of pte_free() to be static from
extern. Otherwise you get a lot of warnings like this:

./arch/m68k/include/asm/mcf_pgalloc.h:80:2: warning: ‘pgtable_page_dtor’ is static but used in inline function ‘pte_free’ which is not static
  pgtable_page_dtor(page);
  ^

And making it static is consistent with our use of this in the other
m68k pgalloc definitions of pte_free().

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
CC: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:26:57 +02:00
..
68000 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
68360 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
amiga genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
apollo m68k/apollo: Convert printk to pr_foo() 2014-05-28 10:11:55 +02:00
atari m68k/atari: Remove obsolete IRQ_TYPE_* 2015-01-15 13:44:51 +01:00
bvme6000 m68k/UAPI: Use proper types (endianness/size) in <asm/bootinfo*.h> 2013-11-26 11:09:21 +01:00
coldfire m68k: set dma and coherent masks for platform FEC ethernets 2018-05-30 07:49:09 +02:00
configs m68k/defconfig: Update defconfigs for v4.3-rc1 2015-09-28 10:01:09 +02:00
emu block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
fpsp040 Fix common misspellings 2011-03-31 11:26:23 -03:00
hp300 m68k/hp300: Convert printk to pr_foo() 2014-05-28 10:11:55 +02:00
ifpsp060 Fix common misspellings 2011-03-31 11:26:23 -03:00
include m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:26:57 +02:00
kernel m68k: Wire up mlock2 2015-11-22 11:35:26 +01:00
lib m68k: Remove FSF address 2015-03-15 10:23:30 +01:00
mac m68k/mac: Export Peripheral System Controller (PSC) base address to modules 2015-09-29 21:11:13 -07:00
math-emu m68k/math-emu: unsigned issue, 'unsigned long' will never be less than zero 2013-06-24 19:44:19 +02:00
mm m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() 2018-07-03 11:21:26 +02:00
mvme16x m68k/mvme16x: rtc - Don't use module_init in non-modular code 2015-01-11 11:38:41 +01:00
mvme147 m68k/mvme147: config.c - Remove unused functions 2015-01-11 11:38:45 +01:00
q40 m68k: Mark functions only called from setup_arch() __init 2013-11-26 11:08:54 +01:00
sun3 m68k/mm: sun3 - Add missing initialization of max_pfn and {min,max}_low_pfn 2015-11-22 11:35:25 +01:00
sun3x m68k: Remove superfluous inclusions of <asm/bootinfo.h> 2013-11-26 11:09:22 +01:00
tools/amiga Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
Kconfig kexec: split kexec_load syscall from kexec core code 2015-09-10 13:29:01 -07:00
Kconfig.bus m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
Kconfig.cpu m68knommu: make ColdFire SoC selection a choice 2015-07-13 09:34:39 +10:00
Kconfig.debug m68k: Multi-platform EARLY_PRINTK 2014-05-28 10:10:04 +02:00
Kconfig.devices Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2014-10-08 05:40:17 -04:00
Kconfig.machine m68k: remove 16 unused boards in Kconfig.machine 2013-08-26 16:51:14 +10:00
Makefile m68k: move non-mmu 68360 platform code 2014-09-29 09:18:35 +10:00