]> Git Repo - linux.git/commit - include/linux/efi.h
efi/capsule-loader: Reinstate virtual capsule mapping
authorArd Biesheuvel <[email protected]>
Tue, 2 Jan 2018 17:21:10 +0000 (17:21 +0000)
committerIngo Molnar <[email protected]>
Wed, 3 Jan 2018 12:54:31 +0000 (13:54 +0100)
commitf24c4d478013d82bd1b943df566fff3561d52864
treee693a0548b056b09116f24217baaa71250672a97
parent835bcec5fdf3f9e880111b482177e7e70e3596da
efi/capsule-loader: Reinstate virtual capsule mapping

Commit:

  82c3768b8d68 ("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:

  2a457fb31df6 ("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 <[email protected]>
Tested-by: Bryan O'Donoghue <[email protected]>
Tested-by: Ge Song <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: <[email protected]>
Cc: Dave Young <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Matt Fleming <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Fixes: 82c3768b8d68 ("efi/capsule-loader: Use a cached copy of the capsule header")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/platform/efi/quirks.c
drivers/firmware/efi/capsule-loader.c
include/linux/efi.h
This page took 0.058859 seconds and 4 git commands to generate.