Skip to content

Commit 2081a84

Browse files
Dongli Zhangsean-jc
authored andcommitted
KVM: x86: remove always-false condition in kvmclock_sync_fn
The 'kvmclock_periodic_sync' is a readonly param that cannot change after bootup. The kvm_arch_vcpu_postcreate() is not going to schedule the kvmclock_sync_work if kvmclock_periodic_sync == false. As a result, the "if (!kvmclock_periodic_sync)" can never be true if the kvmclock_sync_work = kvmclock_sync_fn() is scheduled. Link: https://lore.kernel.org/kvm/a461bf3f-c17e-9c3f-56aa-726225e8391d@oracle.com Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Link: https://lore.kernel.org/r/20231001213637.76686-1-dongli.zhang@oracle.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent d6800af commit 2081a84

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

arch/x86/kvm/x86.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,9 +3374,6 @@ static void kvmclock_sync_fn(struct work_struct *work)
33743374
kvmclock_sync_work);
33753375
struct kvm *kvm = container_of(ka, struct kvm, arch);
33763376

3377-
if (!kvmclock_periodic_sync)
3378-
return;
3379-
33803377
schedule_delayed_work(&kvm->arch.kvmclock_update_work, 0);
33813378
schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
33823379
KVMCLOCK_SYNC_PERIOD);

0 commit comments

Comments
 (0)