Skip to content

Commit c04dd45

Browse files
David BrazdilMarc Zyngier
authored andcommitted
KVM: arm64: Compile remaining hyp/ files for both VHE/nVHE
The following files in hyp/ contain only code shared by VHE/nVHE: vgic-v3-sr.c, aarch32.c, vgic-v2-cpuif-proxy.c, entry.S, fpsimd.S Compile them under both configurations. Deletions in image-vars.h reflect eliminated dependencies of nVHE code on the rest of the kernel. Signed-off-by: David Brazdil <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9aebdea commit c04dd45

File tree

4 files changed

+7
-44
lines changed

4 files changed

+7
-44
lines changed

arch/arm64/kernel/image-vars.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,35 +63,6 @@ __efistub__ctype = _ctype;
6363

6464
#define KVM_NVHE_ALIAS(sym) __kvm_nvhe_##sym = sym;
6565

66-
/* Symbols defined in aarch32.c (not yet compiled with nVHE build rules). */
67-
KVM_NVHE_ALIAS(kvm_skip_instr32);
68-
69-
/* Symbols defined in entry.S (not yet compiled with nVHE build rules). */
70-
KVM_NVHE_ALIAS(__guest_enter);
71-
KVM_NVHE_ALIAS(__guest_exit);
72-
KVM_NVHE_ALIAS(abort_guest_exit_end);
73-
KVM_NVHE_ALIAS(abort_guest_exit_start);
74-
75-
/* Symbols defined in fpsimd.S (not yet compiled with nVHE build rules). */
76-
KVM_NVHE_ALIAS(__fpsimd_restore_state);
77-
KVM_NVHE_ALIAS(__fpsimd_save_state);
78-
79-
/* Symbols defined in vgic-v2-cpuif-proxy.c (not yet compiled with nVHE build rules). */
80-
KVM_NVHE_ALIAS(__vgic_v2_perform_cpuif_access);
81-
82-
/* Symbols defined in vgic-v3-sr.c (not yet compiled with nVHE build rules). */
83-
KVM_NVHE_ALIAS(__vgic_v3_activate_traps);
84-
KVM_NVHE_ALIAS(__vgic_v3_deactivate_traps);
85-
KVM_NVHE_ALIAS(__vgic_v3_get_ich_vtr_el2);
86-
KVM_NVHE_ALIAS(__vgic_v3_init_lrs);
87-
KVM_NVHE_ALIAS(__vgic_v3_perform_cpuif_access);
88-
KVM_NVHE_ALIAS(__vgic_v3_read_vmcr);
89-
KVM_NVHE_ALIAS(__vgic_v3_restore_aprs);
90-
KVM_NVHE_ALIAS(__vgic_v3_restore_state);
91-
KVM_NVHE_ALIAS(__vgic_v3_save_aprs);
92-
KVM_NVHE_ALIAS(__vgic_v3_save_state);
93-
KVM_NVHE_ALIAS(__vgic_v3_write_vmcr);
94-
9566
/* Alternative callbacks for init-time patching of nVHE hyp code. */
9667
KVM_NVHE_ALIAS(arm64_enable_wa2_handling);
9768
KVM_NVHE_ALIAS(kvm_patch_vector_branch);

arch/arm64/kvm/hyp/Makefile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,5 @@ subdir-ccflags-y := -I$(incdir) \
1010
-DDISABLE_BRANCH_PROFILING \
1111
$(DISABLE_STACKLEAK_PLUGIN)
1212

13-
obj-$(CONFIG_KVM) += hyp.o vhe/ nvhe/
13+
obj-$(CONFIG_KVM) += vhe/ nvhe/
1414
obj-$(CONFIG_KVM_INDIRECT_VECTORS) += smccc_wa.o
15-
16-
hyp-y := vgic-v3-sr.o aarch32.o vgic-v2-cpuif-proxy.o entry.o \
17-
fpsimd.o
18-
19-
# KVM code is run at a different exception code with a different map, so
20-
# compiler instrumentation that inserts callbacks or checks into the code may
21-
# cause crashes. Just disable it.
22-
GCOV_PROFILE := n
23-
KASAN_SANITIZE := n
24-
UBSAN_SANITIZE := n
25-
KCOV_INSTRUMENT := n

arch/arm64/kvm/hyp/nvhe/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
asflags-y := -D__KVM_NVHE_HYPERVISOR__
77
ccflags-y := -D__KVM_NVHE_HYPERVISOR__
88

9-
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o \
10-
../hyp-entry.o
9+
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o
10+
obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
11+
../fpsimd.o ../hyp-entry.o
1112

1213
obj-y := $(patsubst %.o,%.hyp.o,$(obj-y))
1314
extra-y := $(patsubst %.hyp.o,%.hyp.tmp.o,$(obj-y))

arch/arm64/kvm/hyp/vhe/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
asflags-y := -D__KVM_VHE_HYPERVISOR__
77
ccflags-y := -D__KVM_VHE_HYPERVISOR__
88

9-
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o ../hyp-entry.o
9+
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o
10+
obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
11+
../fpsimd.o ../hyp-entry.o
1012

1113
# KVM code is run at a different exception code with a different map, so
1214
# compiler instrumentation that inserts callbacks or checks into the code may

0 commit comments

Comments
 (0)