KVM: arm/arm64: Add hook for arch-specific KVM initialisation
authorDave Martin <Dave.Martin@arm.com>
Thu, 28 Feb 2019 18:33:00 +0000 (18:33 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 29 Mar 2019 14:41:54 +0000 (14:41 +0000)
This patch adds a kvm_arm_init_arch_resources() hook to perform
subarch-specific initialisation when starting up KVM.

This will be used in a subsequent patch for global SVE-related
setup on arm64.

No functional change.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Tested-by: zhang.lei <zhang.lei@jp.fujitsu.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_host.h
virt/kvm/arm/arm.c

index 770d73257ad936d6dea09f11d05b9639bd00b051..a49ee01242ff0fe7615a41fa162cd349b5834928 100644 (file)
@@ -53,6 +53,8 @@
 
 DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
 
+static inline int kvm_arm_init_arch_resources(void) { return 0; }
+
 u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode);
 int __attribute_const__ kvm_target_cpu(void);
 int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
index 205438a108f6c75a62bbd22b3002b5d1161a0a43..3e895094259102deed5880b05a7feb69be86c6ba 100644 (file)
@@ -58,6 +58,8 @@
 
 DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
 
+static inline int kvm_arm_init_arch_resources(void) { return 0; }
+
 int __attribute_const__ kvm_target_cpu(void);
 int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
 int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext);
index 99c37384ba7bd3766db4fb863d6baea908210c75..c69e1370a5dc478bfec02ee405ecbb44095f846e 100644 (file)
@@ -1664,6 +1664,10 @@ int kvm_arch_init(void *opaque)
        if (err)
                return err;
 
+       err = kvm_arm_init_arch_resources();
+       if (err)
+               return err;
+
        if (!in_hyp_mode) {
                err = init_hyp_mode();
                if (err)