]> git.karo-electronics.de Git - linux-beck.git/commitdiff
arm64: KVM: Remove duplicating init code for setting VMID
authorVladimir Murzin <vladimir.murzin@arm.com>
Thu, 22 Sep 2016 08:18:01 +0000 (09:18 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 22 Sep 2016 11:30:46 +0000 (13:30 +0200)
By now both VHE and non-VHE initialisation sequences query supported
VMID size. Lets keep only single instance of this code under
init_common_resources().

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/kvm/arm.c

index 75f130ef650413036625c59f34ab864c1649052e..85a3f90cb8ec558902d28bd58ea172e3e31d1769 100644 (file)
@@ -1178,6 +1178,10 @@ static int init_common_resources(void)
                return -ENOMEM;
        }
 
+       /* set size of VMID supported by CPU */
+       kvm_vmid_bits = kvm_get_vmid_bits();
+       kvm_info("%d-bit VMID\n", kvm_vmid_bits);
+
        return 0;
 }
 
@@ -1243,10 +1247,6 @@ static void teardown_hyp_mode(void)
 
 static int init_vhe_mode(void)
 {
-       /* set size of VMID supported by CPU */
-       kvm_vmid_bits = kvm_get_vmid_bits();
-       kvm_info("%d-bit VMID\n", kvm_vmid_bits);
-
        kvm_info("VHE mode initialized successfully\n");
        return 0;
 }
@@ -1330,10 +1330,6 @@ static int init_hyp_mode(void)
                }
        }
 
-       /* set size of VMID supported by CPU */
-       kvm_vmid_bits = kvm_get_vmid_bits();
-       kvm_info("%d-bit VMID\n", kvm_vmid_bits);
-
        kvm_info("Hyp mode initialized successfully\n");
 
        return 0;