Skip to content

Commit 3d4b2a4

Browse files
committed
KVM: arm64: Remove unused return value from kvm_reset_vcpu()
Get rid of the return value for kvm_reset_vcpu() as there are no longer any cases where it returns a nonzero value. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent d99fb82 commit 3d4b2a4

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extern unsigned int __ro_after_init kvm_sve_max_vl;
7878
int __init kvm_arm_init_sve(void);
7979

8080
u32 __attribute_const__ kvm_target_cpu(void);
81-
int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
81+
void kvm_reset_vcpu(struct kvm_vcpu *vcpu);
8282
void kvm_arm_vcpu_destroy(struct kvm_vcpu *vcpu);
8383

8484
struct kvm_hyp_memcache {

arch/arm64/kvm/arch_timer.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ void kvm_timer_sync_user(struct kvm_vcpu *vcpu)
943943
unmask_vtimer_irq_user(vcpu);
944944
}
945945

946-
int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu)
946+
void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu)
947947
{
948948
struct arch_timer_cpu *timer = vcpu_timer(vcpu);
949949
struct timer_map map;
@@ -987,8 +987,6 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu)
987987
soft_timer_cancel(&map.emul_vtimer->hrtimer);
988988
if (map.emul_ptimer)
989989
soft_timer_cancel(&map.emul_ptimer->hrtimer);
990-
991-
return 0;
992990
}
993991

994992
static void timer_context_init(struct kvm_vcpu *vcpu, int timerid)

arch/arm64/kvm/arm.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,15 +1282,12 @@ static int __kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
12821282
bitmap_copy(vcpu->arch.features, &features, KVM_VCPU_MAX_FEATURES);
12831283

12841284
/* Now we know what it is, we can reset it. */
1285-
ret = kvm_reset_vcpu(vcpu);
1286-
if (ret) {
1287-
bitmap_zero(vcpu->arch.features, KVM_VCPU_MAX_FEATURES);
1288-
goto out_unlock;
1289-
}
1285+
kvm_reset_vcpu(vcpu);
12901286

12911287
bitmap_copy(kvm->arch.vcpu_features, &features, KVM_VCPU_MAX_FEATURES);
12921288
set_bit(KVM_ARCH_FLAG_VCPU_FEATURES_CONFIGURED, &kvm->arch.flags);
12931289
vcpu_set_flag(vcpu, VCPU_INITIALIZED);
1290+
ret = 0;
12941291
out_unlock:
12951292
mutex_unlock(&kvm->arch.config_lock);
12961293
return ret;
@@ -1315,7 +1312,8 @@ static int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
13151312
if (kvm_vcpu_init_changed(vcpu, init))
13161313
return -EINVAL;
13171314

1318-
return kvm_reset_vcpu(vcpu);
1315+
kvm_reset_vcpu(vcpu);
1316+
return 0;
13191317
}
13201318

13211319
static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu,

arch/arm64/kvm/reset.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ static void kvm_vcpu_enable_ptrauth(struct kvm_vcpu *vcpu)
188188
* disable preemption around the vcpu reset as we would otherwise race with
189189
* preempt notifiers which also call put/load.
190190
*/
191-
int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
191+
void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
192192
{
193193
struct vcpu_reset_state reset_state;
194-
int ret;
195194
bool loaded;
196195
u32 pstate;
197196

@@ -260,12 +259,11 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
260259
}
261260

262261
/* Reset timer */
263-
ret = kvm_timer_vcpu_reset(vcpu);
262+
kvm_timer_vcpu_reset(vcpu);
264263

265264
if (loaded)
266265
kvm_arch_vcpu_load(vcpu, smp_processor_id());
267266
preempt_enable();
268-
return ret;
269267
}
270268

271269
u32 get_kvm_ipa_limit(void)

include/kvm/arm_arch_timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct arch_timer_cpu {
9494

9595
int __init kvm_timer_hyp_init(bool has_gic);
9696
int kvm_timer_enable(struct kvm_vcpu *vcpu);
97-
int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu);
97+
void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu);
9898
void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);
9999
void kvm_timer_sync_user(struct kvm_vcpu *vcpu);
100100
bool kvm_timer_should_notify_user(struct kvm_vcpu *vcpu);

0 commit comments

Comments
 (0)