Skip to content

Commit 208243c

Browse files
AndrewScullMarc Zyngier
authored andcommitted
KVM: arm64: Move hyp-init.S to nVHE
hyp-init.S contains the identity mapped initialisation code for the non-VHE code that runs at EL2. It is only used for non-VHE. Adjust code that calls into this to use the prefixed symbol name. Signed-off-by: Andrew Scull <[email protected]> Signed-off-by: David Brazdil <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b877e98 commit 208243c

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

arch/arm64/include/asm/kvm_asm.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@
7878
struct kvm;
7979
struct kvm_vcpu;
8080

81-
extern char __kvm_hyp_init[];
82-
extern char __kvm_hyp_init_end[];
83-
81+
DECLARE_KVM_NVHE_SYM(__kvm_hyp_init);
8482
DECLARE_KVM_HYP_SYM(__kvm_hyp_vector);
83+
#define __kvm_hyp_init CHOOSE_NVHE_SYM(__kvm_hyp_init)
8584
#define __kvm_hyp_vector CHOOSE_HYP_SYM(__kvm_hyp_vector)
8685

8786
#ifdef CONFIG_KVM_INDIRECT_VECTORS

arch/arm64/kernel/image-vars.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ KVM_NVHE_ALIAS(__guest_exit);
7171
KVM_NVHE_ALIAS(abort_guest_exit_end);
7272
KVM_NVHE_ALIAS(abort_guest_exit_start);
7373

74-
/* Symbols defined in hyp-init.S (not yet compiled with nVHE build rules). */
75-
KVM_NVHE_ALIAS(__kvm_handle_stub_hvc);
76-
7774
/* Symbols defined in switch.c (not yet compiled with nVHE build rules). */
7875
KVM_NVHE_ALIAS(__kvm_vcpu_run_nvhe);
7976
KVM_NVHE_ALIAS(hyp_panic);
@@ -113,6 +110,12 @@ KVM_NVHE_ALIAS(kimage_voffset);
113110
/* Kernel symbols used to call panic() from nVHE hyp code (via ERET). */
114111
KVM_NVHE_ALIAS(panic);
115112

113+
/* Vectors installed by hyp-init on reset HVC. */
114+
KVM_NVHE_ALIAS(__hyp_stub_vectors);
115+
116+
/* IDMAP TCR_EL1.T0SZ as computed by the EL1 init code */
117+
KVM_NVHE_ALIAS(idmap_t0sz);
118+
116119
#endif /* CONFIG_KVM */
117120

118121
#endif /* __ARM64_KERNEL_IMAGE_VARS_H */

arch/arm64/kvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ obj-$(CONFIG_KVM) += hyp/
1313
kvm-y := $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o \
1414
$(KVM)/vfio.o $(KVM)/irqchip.o \
1515
arm.o mmu.o mmio.o psci.o perf.o hypercalls.o pvtime.o \
16-
inject_fault.o regmap.o va_layout.o hyp.o hyp-init.o handle_exit.o \
16+
inject_fault.o regmap.o va_layout.o hyp.o handle_exit.o \
1717
guest.o debug.o reset.o sys_regs.o sys_regs_generic_v8.o \
1818
vgic-sys-reg-v3.o fpsimd.o pmu.o \
1919
aarch32.o arch_timer.o \

arch/arm64/kvm/hyp/nvhe/Makefile

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

9-
obj-y := ../hyp-entry.o
9+
obj-y := hyp-init.o ../hyp-entry.o
1010

1111
obj-y := $(patsubst %.o,%.hyp.o,$(obj-y))
1212
extra-y := $(patsubst %.hyp.o,%.hyp.tmp.o,$(obj-y))
File renamed without changes.

0 commit comments

Comments
 (0)