OSDN Git Service

KVM: LAPIC: Keep stored TMCCT register value 0 after KVM_SET_LAPIC
authorWanpeng Li <wanpengli@tencent.com>
Wed, 9 Jun 2021 07:16:40 +0000 (00:16 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Jun 2021 18:26:11 +0000 (14:26 -0400)
commit2735886c9ef115fc7b40d27bfe73605c38e9d56b
tree99dd8cd73bfd3b5d86f8f91a395a33ea2f2b6b56
parent0dbb11230437895f7cd6fc55da61cef011e997d8
KVM: LAPIC: Keep stored TMCCT register value 0 after KVM_SET_LAPIC

KVM_GET_LAPIC stores the current value of TMCCT and KVM_SET_LAPIC's memcpy
stores it in vcpu->arch.apic->regs, KVM_SET_LAPIC could store zero in
vcpu->arch.apic->regs after it uses it, and then the stored value would
always be zero. In addition, the TMCCT is always computed on-demand and
never directly readable.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1623223000-18116-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c