[PATCH 2/2] arm64/kvm: Drop checking target CPU type on initializing module

From: Gavin Shan
Date: Tue Aug 25 2020 - 02:19:26 EST


The target CPU type is validated when KVM module is initialized.
However, we always have a valid target CPU type since commit
<bca556ac468a> ("arm64/kvm: Add generic v8 KVM target").

So it's unnecessary to validate the target CPU type at that time
and this just drops it.

Signed-off-by: Gavin Shan <gshan@xxxxxxxxxx>
---
arch/arm64/kvm/arm.c | 14 --------------
1 file changed, 14 deletions(-)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 691d21e4c717..faf4bc208a4a 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -1561,11 +1561,6 @@ static int init_hyp_mode(void)
return err;
}

-static void check_kvm_target_cpu(void *ret)
-{
- *(int *)ret = kvm_target_cpu();
-}
-
struct kvm_vcpu *kvm_mpidr_to_vcpu(struct kvm *kvm, unsigned long mpidr)
{
struct kvm_vcpu *vcpu;
@@ -1625,7 +1620,6 @@ void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *cons)
int kvm_arch_init(void *opaque)
{
int err;
- int ret, cpu;
bool in_hyp_mode;

if (!is_hyp_mode_available()) {
@@ -1640,14 +1634,6 @@ int kvm_arch_init(void *opaque)
return -ENODEV;
}

- for_each_online_cpu(cpu) {
- smp_call_function_single(cpu, check_kvm_target_cpu, &ret, 1);
- if (ret < 0) {
- kvm_err("Error, CPU %d not supported!\n", cpu);
- return -ENODEV;
- }
- }
-
err = init_common_resources();
if (err)
return err;
--
2.23.0