linux/drivers/firmware
Ard Biesheuvel f24c4d4780 efi/capsule-loader: Reinstate virtual capsule mapping
Commit:

  82c3768b8d ("efi/capsule-loader: Use a cached copy of the capsule header")

... refactored the capsule loading code that maps the capsule header,
to avoid having to map it several times.

However, as it turns out, the vmap() call we ended up removing did not
just map the header, but the entire capsule image, and dropping this
virtual mapping breaks capsules that are processed by the firmware
immediately (i.e., without a reboot).

Unfortunately, that change was part of a larger refactor that allowed
a quirk to be implemented for Quark, which has a non-standard memory
layout for capsules, and we have slightly painted ourselves into a
corner by allowing quirk code to mangle the capsule header and memory
layout.

So we need to fix this without breaking Quark. Fortunately, Quark does
not appear to care about the virtual mapping, and so we can simply
do a partial revert of commit:

  2a457fb31d ("efi/capsule-loader: Use page addresses rather than struct page pointers")

... and create a vmap() mapping of the entire capsule (including header)
based on the reinstated struct page array, unless running on Quark, in
which case we pass the capsule header copy as before.

Reported-by: Ge Song <ge.song@hxt-semitech.com>
Tested-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Tested-by: Ge Song <ge.song@hxt-semitech.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: <stable@vger.kernel.org>
Cc: Dave Young <dyoung@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Fixes: 82c3768b8d ("efi/capsule-loader: Use a cached copy of the capsule header")
Link: http://lkml.kernel.org/r/20180102172110.17018-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-01-03 13:54:31 +01:00
..
broadcom
efi efi/capsule-loader: Reinstate virtual capsule mapping 2018-01-03 13:54:31 +01:00
google firmware: vpd: Fix platform driver and device registration/unregistration 2017-11-28 16:57:18 +01:00
meson
tegra ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
Kconfig firmware: qcom: scm: Expose download-mode control 2017-10-11 23:48:27 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arm_scpi.c firmware: arm_scpi: Revert updates made during v4.15 merge window 2017-12-03 19:39:22 -08:00
dcdbas.c firmware/dcdbas: Constify attribute_group structures 2017-08-21 09:43:51 +02:00
dcdbas.h
dell_rbu.c
dmi-id.c
dmi-sysfs.c x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings 2017-07-18 11:37:58 +02:00
dmi_scan.c
edd.c
iscsi_ibft.c
iscsi_ibft_find.c
memmap.c
pcdp.c x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings 2017-07-18 11:37:58 +02:00
pcdp.h
psci.c firmware: Convert to using %pOF instead of full_name 2017-08-16 17:19:50 +02:00
psci_checker.c drivers/firmware: psci: Convert timers to use timer_setup() 2017-11-21 15:46:44 -08:00
qcom_scm-32.c remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qcom_scm-64.c remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qcom_scm.c remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qcom_scm.h remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qemu_fw_cfg.c fw_cfg: fix driver remove 2017-12-01 16:55:09 +02:00
raspberrypi.c
scpi_pm_domain.c
ti_sci.c ti_sci: Use %pS printk format for direct addresses 2017-10-09 09:54:14 -07:00
ti_sci.h