@@ -6,7 +6,7 @@
#define kvm__arch_get_kern_offset(...) 0x8000
struct kvm;
-static inline void kvm__arch_enable_mte(struct kvm *kvm) {}
+static inline void __kvm__arm_init(struct kvm *kvm) {}
#define MAX_PAGE_SIZE SZ_4K
@@ -6,7 +6,6 @@
struct kvm;
unsigned long long kvm__arch_get_kern_offset(struct kvm *kvm, int fd);
int kvm__arch_get_ipa_limit(struct kvm *kvm);
-void kvm__arch_enable_mte(struct kvm *kvm);
#define MAX_PAGE_SIZE SZ_64K
@@ -134,7 +134,7 @@ int kvm__get_vm_type(struct kvm *kvm)
return KVM_VM_TYPE_ARM_IPA_SIZE(ipa_bits);
}
-void kvm__arch_enable_mte(struct kvm *kvm)
+static void kvm__arch_enable_mte(struct kvm *kvm)
{
struct kvm_enable_cap cap = {
.cap = KVM_CAP_ARM_MTE,
@@ -160,3 +160,8 @@ void kvm__arch_enable_mte(struct kvm *kvm)
pr_debug("MTE capability enabled");
}
+
+void __kvm__arm_init(struct kvm *kvm)
+{
+ kvm__arch_enable_mte(kvm);
+}
@@ -110,4 +110,6 @@ struct kvm_arch {
cpu_set_t *vcpu_affinity_cpuset;
};
+void __kvm__arm_init(struct kvm *kvm);
+
#endif /* ARM_COMMON__KVM_ARCH_H */
@@ -93,7 +93,7 @@ void kvm__arch_init(struct kvm *kvm)
if (gic__create(kvm, kvm->cfg.arch.irqchip))
die("Failed to create virtual GIC");
- kvm__arch_enable_mte(kvm);
+ __kvm__arm_init(kvm);
}
#define FDT_ALIGN SZ_2M
The current state of MTE initialization sticks out a bit: an MTE-specific init routine is implemented for both aarch32 and aarch64. Generalize on the notion of execution state specific VM initialization in preparation for SMCCC filter creation, as the feature is only present on aarch64. Signed-off-by: Oliver Upton <oliver.upton@linux.dev> --- arm/aarch32/include/kvm/kvm-arch.h | 2 +- arm/aarch64/include/kvm/kvm-arch.h | 1 - arm/aarch64/kvm.c | 7 ++++++- arm/include/arm-common/kvm-arch.h | 2 ++ arm/kvm.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-)