linux-stable/arch/x86/platform
Jiri Kosina bf29bddf04 x86/efi: Always map the first physical page into the EFI pagetables
Commit:

  129766708 ("x86/efi: Only map RAM into EFI page tables if in mixed-mode")

stopped creating 1:1 mappings for all RAM, when running in native 64-bit mode.

It turns out though that there are 64-bit EFI implementations in the wild
(this particular problem has been reported on a Lenovo Yoga 710-11IKB),
which still make use of the first physical page for their own private use,
even though they explicitly mark it EFI_CONVENTIONAL_MEMORY in the memory
map.

In case there is no mapping for this particular frame in the EFI pagetables,
as soon as firmware tries to make use of it, a triple fault occurs and the
system reboots (in case of the Yoga 710-11IKB this is very early during bootup).

Fix that by always mapping the first page of physical memory into the EFI
pagetables. We're free to hand this page to the BIOS, as trim_bios_range()
will reserve the first page and isolate it away from memory allocators anyway.

Note that just reverting 129766708 alone is not enough on v4.9-rc1+ to fix the
regression on affected hardware, as this commit:

   ab72a27da ("x86/efi: Consolidate region mapping logic")

later made the first physical frame not to be mapped anyway.

Reported-by: Hanka Pavlikova <hanka@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vojtech Pavlik <vojtech@ucw.cz>
Cc: Waiman Long <waiman.long@hpe.com>
Cc: linux-efi@vger.kernel.org
Cc: stable@kernel.org # v4.8+
Fixes: 129766708 ("x86/efi: Only map RAM into EFI page tables if in mixed-mode")
Link: http://lkml.kernel.org/r/20170127222552.22336-1-matt@codeblueprint.co.uk
[ Tidied up the changelog and the comment. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-28 09:18:56 +01:00
..
atom x86/cpu: Rename Merrifield2 to Moorefield 2016-09-08 08:13:08 +02:00
ce4100 x86/init: Remove i8042_detect() from platform ops 2016-12-19 11:34:15 +01:00
efi x86/efi: Always map the first physical page into the EFI pagetables 2017-01-28 09:18:56 +01:00
geode x86/platform: Make platform/geode/net5501.c explicitly non-modular 2016-02-16 09:11:09 +01:00
goldfish goldfish: platform device for x86 2013-01-21 12:09:19 -08:00
intel x86/platform/iosf_mbi: Add Intel Tangier PCI id 2015-07-16 17:48:48 +02:00
intel-mid x86/platform/intel-mid: Rename 'spidev' to 'mrfld_spidev' 2017-01-05 09:03:29 +01:00
intel-quark x86/platform/intel/quark: Add printf attribute to imr_self_test_result() 2016-12-20 09:37:24 +01:00
iris x86: platform: iris: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
olpc x86/platform/olpc: Fix resume handler build warning 2016-11-28 07:46:03 +01:00
scx200 X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
sfi x86: Cleanup irq_domain ops 2015-04-24 15:36:55 +02:00
ts5500 x86/platform: Delete extraneous MODULE_* tags fromm ts5500 2016-07-16 22:41:00 +02:00
uv clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00
Makefile platform/x86: mlx-platform: Move module from arch/x86 2016-12-16 23:30:24 +02:00