arm64/kvm: Drop unnecessary check in kvm_vcpu_preferred_target()
PATCH 1/2 arm64/kvm: Drop unnecessary check in kvm_vcpu_preferred_target()
Since commit <bca556ac468a> ("arm64/kvm: Add generic v8 KVM target"), there is no negative number returned from kvm_target_cpu(). So it's not needed to validate its return value in kvm_vcpu_preferred_target() and this just drops the unnecessary check.
Signed-off-by Gavin Shan <[email protected]>
--- arch/arm64/kvm/guest.c | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/kvm/guest.c +0 -3
@@ -835,9 +835,6 @@ int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init) {int target =kvm_target_cpu (); -if (target <0 ) -return -ENODEV ; -memset (init,0 ,sizeof (*init));/*
Signature · 6 lines
2.23.0 _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
PATCH 2/2 arm64/kvm: Drop checking target CPU type on initializing module
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 <[email protected]>
--- arch/arm64/kvm/arm.c | 14 -------------- 1 file changed, 14 deletions(-)
arch/arm64/kvm/arm.c +0 -14
@@ -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;
Signature · 6 lines
2.23.0 _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm