KVM: arm/arm64: Rename kvm_arm_config_vm to kvm_arm_setup_stage2
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Oct 2018 12:40:36 +0000 (13:40 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 3 Oct 2018 10:45:29 +0000 (11:45 +0100)
VM tends to be a very overloaded term in KVM, so let's keep it
to describe the virtual machine. For the virtual memory setup,
let's use the "stage2" suffix.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_arm.h
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/reset.c
virt/kvm/arm/arm.c

index 72d46418e1ef32fcc156de86e8ca498bdcb95714..b45af481ccf7f6baf219bf202ecf21e91865abd1 100644 (file)
@@ -354,8 +354,12 @@ static inline void kvm_vcpu_put_sysregs(struct kvm_vcpu *vcpu) {}
 struct kvm *kvm_arch_alloc_vm(void);
 void kvm_arch_free_vm(struct kvm *kvm);
 
-static inline int kvm_arm_config_vm(struct kvm *kvm, unsigned long type)
+static inline int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type)
 {
+       /*
+        * On 32bit ARM, VMs get a static 40bit IPA stage2 setup,
+        * so any non-zero value used as type is illegal.
+        */
        if (type)
                return -EINVAL;
        return 0;
index f1330284720d577c66a150ae558b9498de466202..6e324d1f12316600e0d433191162b745e42ba448 100644 (file)
  * 40 bits wide (T0SZ = 24).  Systems with a PARange smaller than 40 bits are
  * not known to exist and will break with this configuration.
  *
- * The VTCR_EL2 is configured per VM and is initialised in kvm_arm_config_vm().
+ * The VTCR_EL2 is configured per VM and is initialised in kvm_arm_setup_stage2().
  *
  * Note that when using 4K pages, we concatenate two first level page tables
  * together. With 16K pages, we concatenate 16 first level page tables.
index f008f8866b2a10897a50e1b67f99c75dbdb38d7e..376a5b69546728a3263b0346cf06c31bd343798a 100644 (file)
@@ -511,6 +511,6 @@ void kvm_set_ipa_limit(void);
 struct kvm *kvm_arch_alloc_vm(void);
 void kvm_arch_free_vm(struct kvm *kvm);
 
-int kvm_arm_config_vm(struct kvm *kvm, unsigned long type);
+int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type);
 
 #endif /* __ARM64_KVM_HOST_H__ */
index 95f28d5950e0ace9e609e593023643e5349e9d1e..aa806d5825528a48900524de8a7fe859e06be7a9 100644 (file)
@@ -189,7 +189,7 @@ void kvm_set_ipa_limit(void)
  * all CPUs, as it is safe to run with or without the feature and
  * the bit is RES0 on CPUs that don't support it.
  */
-int kvm_arm_config_vm(struct kvm *kvm, unsigned long type)
+int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type)
 {
        u64 vtcr = VTCR_EL2_FLAGS;
        u32 parange, phys_shift;
index 631f9a3ad99a000f35ca71da8e6d7e63d01707b8..91c464c9cd214f4a7af6143af9119534dc53b52d 100644 (file)
@@ -120,7 +120,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 {
        int ret, cpu;
 
-       ret = kvm_arm_config_vm(kvm, type);
+       ret = kvm_arm_setup_stage2(kvm, type);
        if (ret)
                return ret;