Skip to content

Commit aceb04f

Browse files
committed
KVM: x86: Drop local pvclock_flags variable in kvm_guest_time_update()
Drop the local pvclock_flags in kvm_guest_time_update(), the local variable is immediately shoved into the per-vCPU "cache", i.e. the local variable serves no purpose. No functional change intended. Reviewed-by: Paul Durrant <paul@xen.org> Link: https://lore.kernel.org/r/20250201013827.680235-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 4198f38 commit aceb04f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

arch/x86/kvm/x86.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,7 +3178,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
31783178
struct kvm_arch *ka = &v->kvm->arch;
31793179
s64 kernel_ns;
31803180
u64 tsc_timestamp, host_tsc;
3181-
u8 pvclock_flags;
31823181
bool use_master_clock;
31833182
#ifdef CONFIG_KVM_XEN
31843183
/*
@@ -3261,11 +3260,9 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
32613260
vcpu->last_guest_tsc = tsc_timestamp;
32623261

32633262
/* If the host uses TSC clocksource, then it is stable */
3264-
pvclock_flags = 0;
3263+
vcpu->hv_clock.flags = 0;
32653264
if (use_master_clock)
3266-
pvclock_flags |= PVCLOCK_TSC_STABLE_BIT;
3267-
3268-
vcpu->hv_clock.flags = pvclock_flags;
3265+
vcpu->hv_clock.flags |= PVCLOCK_TSC_STABLE_BIT;
32693266

32703267
if (vcpu->pv_time.active)
32713268
kvm_setup_guest_pvclock(v, &vcpu->pv_time, 0, false);

0 commit comments

Comments
 (0)