FROMLIST: KVM: arm64: Provide __flush_dcache_area at EL2
We will need to do cache maintenance at EL2 soon, so compile a copy of __flush_dcache_area at EL2, and provide a copy of arm64_ftr_reg_ctrel0 as it is needed by the read_ctr macro. Signed-off-by: Quentin Perret <qperret@google.com> Link: https://lore.kernel.org/r/20210315143536.214621-15-qperret@google.com Bug: 178098380 Change-Id: Icdf042dc83a4486b615514a9bd6e27af0859ce75
This commit is contained in:
@@ -13,3 +13,5 @@
|
|||||||
#define KVM_HYP_CPU_FTR_REG(name) extern struct arm64_ftr_reg kvm_nvhe_sym(name)
|
#define KVM_HYP_CPU_FTR_REG(name) extern struct arm64_ftr_reg kvm_nvhe_sym(name)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
KVM_HYP_CPU_FTR_REG(arm64_ftr_reg_ctrel0);
|
||||||
|
@@ -13,7 +13,8 @@ lib-objs := clear_page.o copy_page.o memcpy.o memset.o
|
|||||||
lib-objs := $(addprefix ../../../lib/, $(lib-objs))
|
lib-objs := $(addprefix ../../../lib/, $(lib-objs))
|
||||||
|
|
||||||
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o host.o \
|
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o host.o \
|
||||||
hyp-main.o hyp-smp.o psci-relay.o early_alloc.o stub.o page_alloc.o
|
hyp-main.o hyp-smp.o psci-relay.o early_alloc.o stub.o page_alloc.o \
|
||||||
|
cache.o
|
||||||
obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
|
obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
|
||||||
../fpsimd.o ../hyp-entry.o ../exception.o
|
../fpsimd.o ../hyp-entry.o ../exception.o
|
||||||
obj-y += $(lib-objs)
|
obj-y += $(lib-objs)
|
||||||
|
13
arch/arm64/kvm/hyp/nvhe/cache.S
Normal file
13
arch/arm64/kvm/hyp/nvhe/cache.S
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/* 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(__flush_dcache_area)
|
||||||
|
dcache_by_line_op civac, sy, x0, x1, x2, x3
|
||||||
|
ret
|
||||||
|
SYM_FUNC_END_PI(__flush_dcache_area)
|
@@ -2783,6 +2783,7 @@ struct __ftr_reg_copy_entry {
|
|||||||
u32 sys_id;
|
u32 sys_id;
|
||||||
struct arm64_ftr_reg *dst;
|
struct arm64_ftr_reg *dst;
|
||||||
} hyp_ftr_regs[] __initdata = {
|
} hyp_ftr_regs[] __initdata = {
|
||||||
|
CPU_FTR_REG_HYP_COPY(SYS_CTR_EL0, arm64_ftr_reg_ctrel0),
|
||||||
};
|
};
|
||||||
|
|
||||||
void __init setup_kvm_el2_caps(void)
|
void __init setup_kvm_el2_caps(void)
|
||||||
|
Reference in New Issue
Block a user