x86/mm: Fix overlap of i386 CPU_ENTRY_AREA with FIX_BTMAP
authorWilliam Grant <william.grant@canonical.com>
Tue, 30 Jan 2018 11:22:55 +0000 (22:22 +1100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 30 Jan 2018 14:30:35 +0000 (15:30 +0100)
commit55f49fcb879fbeebf2a8c1ac7c9e6d90df55f798
tree809736850942a87b269772a1bb1a51b14dc13f60
parent830c1e3d16b2c1733cd1ec9c8f4d47a398ae31bc
x86/mm: Fix overlap of i386 CPU_ENTRY_AREA with FIX_BTMAP

Since commit 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the
fixmap"), i386's CPU_ENTRY_AREA has been mapped to the memory area just
below FIXADDR_START. But already immediately before FIXADDR_START is the
FIX_BTMAP area, which means that early_ioremap can collide with the entry
area.

It's especially bad on PAE where FIX_BTMAP_BEGIN gets aligned to exactly
match CPU_ENTRY_AREA_BASE, so the first early_ioremap slot clobbers the
IDT and causes interrupts during early boot to reset the system.

The overlap wasn't a problem before the CPU entry area was introduced,
as the fixmap has classically been preceded by the pkmap or vmalloc
areas, neither of which is used until early_ioremap is out of the
picture.

Relocate CPU_ENTRY_AREA to below FIX_BTMAP, not just below the permanent
fixmap area.

Fixes: commit 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the fixmap")
Signed-off-by: William Grant <william.grant@canonical.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/7041d181-a019-e8b9-4e4e-48215f841e2c@canonical.com
arch/x86/include/asm/fixmap.h
arch/x86/include/asm/pgtable_32_types.h