mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-28 09:22:08 +00:00

In preparation for handling cache maintenance of guest pages from within the pKVM hypervisor at EL2, introduce an EL2 copy of icache_inval_pou() which will later be plumbed into the stage-2 page-table cache maintenance callbacks, ensuring that the initial contents of pages mapped as executable into the guest stage-2 page-table is visible to the instruction fetcher. Tested-by: Vincent Donnefort <vdonnefort@google.com> Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221110190259.26861-17-will@kernel.org
26 lines
634 B
ArmAsm
26 lines
634 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Code copied from arch/arm64/mm/cache.S.
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
|
#include <asm/assembler.h>
|
|
#include <asm/alternative.h>
|
|
|
|
SYM_FUNC_START(__pi_dcache_clean_inval_poc)
|
|
dcache_by_line_op civac, sy, x0, x1, x2, x3
|
|
ret
|
|
SYM_FUNC_END(__pi_dcache_clean_inval_poc)
|
|
SYM_FUNC_ALIAS(dcache_clean_inval_poc, __pi_dcache_clean_inval_poc)
|
|
|
|
SYM_FUNC_START(__pi_icache_inval_pou)
|
|
alternative_if ARM64_HAS_CACHE_DIC
|
|
isb
|
|
ret
|
|
alternative_else_nop_endif
|
|
|
|
invalidate_icache_by_line x0, x1, x2, x3
|
|
ret
|
|
SYM_FUNC_END(__pi_icache_inval_pou)
|
|
SYM_FUNC_ALIAS(icache_inval_pou, __pi_icache_inval_pou)
|