]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Migrate the PIT only if vcpu0 is migrated, not any BSP
authorSean Christopherson <seanjc@google.com>
Tue, 13 Jul 2021 16:32:51 +0000 (09:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Aug 2021 15:01:51 +0000 (11:01 -0400)
commit656095f98ed61465bc125393fc233f85db9d305c
tree0a8df41a8cdec5fb4c807f252feab46445cd77d4
parent85670bbe6a51701c2a5cd6c6197890a890ed0d48
KVM: x86: Migrate the PIT only if vcpu0 is migrated, not any BSP

Make vcpu0 the arbitrary owner of the PIT, as was intended when PIT
migration was added by commit b34a0c866276 ("KVM: migrate PIT timer").
The PIT was unintentionally turned into being owned by the BSP by commit
8a3d0e8ac35d ("KVM: Introduce kvm_vcpu_is_bsp() function."), and was then
unintentionally converted to a shared ownership model when
kvm_vcpu_is_bsp() was modified to check the APIC base MSR instead of
hardcoding vcpu0 as the BSP.

Functionally, this just means the PIT's hrtimer is migrated less often.
The real motivation is to remove the usage of kvm_vcpu_is_bsp(), so that
more legacy/broken crud can be removed in a future patch.

Fixes: 9813837479a4 ("KVM: x86: BSP in MSR_IA32_APICBASE is writable")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210713163324.627647-14-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/i8254.c