OSDN Git Service

efi/arm: Clean EFI stub exit code from cache instead of avoiding it
authorArd Biesheuvel <ardb@kernel.org>
Fri, 28 Feb 2020 12:14:06 +0000 (13:14 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 29 Feb 2020 09:16:57 +0000 (10:16 +0100)
commit0698fac4ac2ae84ecec2a826cc97803af564aa95
treeadf7c7d1ba7306f1fcfb7171ed9b0c78c67d34ae
parent98649365e59da18221850e137620d18b50ec99e5
efi/arm: Clean EFI stub exit code from cache instead of avoiding it

The following commit:

  c7225494b ("efi/arm: Work around missing cache maintenance in decompressor handover")

modified the EFI handover code written in assembler to work around the
missing cache maintenance of the piece of code that is executed after the
MMU and caches are turned off.

Due to the fact that this sequence incorporates a subroutine call, cleaning
that code from the cache is not a matter of simply passing the start and end of
the currently running subroutine into cache_clean_flush(), which is why
instead, the code jumps across into the cleaned copy of the image.

However, this assumes that this copy is executable, and this means we
expect EFI_LOADER_DATA regions to be executable as well, which is not
a reasonable assumption to make, even if this is true for most UEFI
implementations today.

So change this back, and add a cache_clean_flush() call to cover the
remaining code in the subroutine, and any code it may execute in the
context of cache_off().

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: linux-efi@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20200228121408.9075-5-ardb@kernel.org
arch/arm/boot/compressed/head.S