]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: Avoid flush_icache_range() in alternatives patching code
authorWill Deacon <will.deacon@arm.com>
Fri, 22 Jun 2018 08:31:15 +0000 (09:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:06:52 +0000 (13:06 +0200)
commit01157286b84d818429c3da984e04bb07f71ca6c5
tree33b7a85b1ca9580d24b85ba1bc757f3859706449
parentee5f9222e7475150a8208f992d5fa2b6f6d87612
arm64: Avoid flush_icache_range() in alternatives patching code

[ Upstream commit 429388682dc266e7a693f9c27e3aabd341d55343 ]

The implementation of flush_icache_range() includes instruction sequences
which are themselves patched at runtime, so it is not safe to call from
the patching framework.

This patch reworks the alternatives cache-flushing code so that it rolls
its own internal D-cache maintenance using DC CIVAC before invalidating
the entire I-cache after all alternatives have been applied at boot.
Modules don't cause any issues, since flush_icache_range() is safe to
call by the time they are loaded.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: Rohit Khanna <rokhanna@nvidia.com>
Cc: Alexander Van Brunt <avanbrunt@nvidia.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/alternative.h
arch/arm64/kernel/alternative.c
arch/arm64/kernel/module.c