linux-brain/arch/m68k
Greg Ungerer b9ce3ceff7 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:12:34 +02:00
..
68000 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
amiga m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
apollo char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
atari m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
bvme6000 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
coldfire m68k: set dma and coherent masks for platform FEC ethernets 2018-05-30 07:50:43 +02:00
configs m68k/defconfig: Update defconfigs for v4.9-rc1 2016-10-30 10:13:19 +01: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 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
ifpsp060 m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
include m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:12:34 +02:00
kernel m68k: add missing SOFTIRQENTRY_TEXT linker section 2018-02-25 11:05:47 +01:00
lib m68k: move exports to definitions 2016-08-07 23:47:19 -04:00
mac m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
math-emu m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
mm m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() 2018-07-03 11:23:05 +02:00
mvme16x char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
mvme147 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
q40 m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
sun3 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
sun3x char/genrtc: remove m68k support 2016-06-04 00:23:28 +02: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 m68k: move CONFIG_FPU set to per-CPU configuration 2016-09-26 12:02:58 +10:00
Kconfig.bus m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
Kconfig.cpu m68k: move CONFIG_FPU set to per-CPU configuration 2016-09-26 12:02:58 +10:00
Kconfig.debug m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10: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 m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00
Makefile m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00