]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm: Disable kvmclock on all CPUs on shutdown
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 14 Apr 2021 12:35:42 +0000 (14:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 May 2021 10:06:10 +0000 (06:06 -0400)
commit0eb2a727d5aad034f8f957ee6de392292b68b5e1
treea10fa41fc89e96d8c4f8082631be28981e056ad7
parentd9f8c938f5b9d36c1ea0366ee8d47bbf5137406c
x86/kvm: Disable kvmclock on all CPUs on shutdown

Currenly, we disable kvmclock from machine_shutdown() hook and this
only happens for boot CPU. We need to disable it for all CPUs to
guard against memory corruption e.g. on restore from hibernate.

Note, writing '0' to kvmclock MSR doesn't clear memory location, it
just prevents hypervisor from updating the location so for the short
while after write and while CPU is still alive, the clock remains usable
and correct so we don't need to switch to some other clocksource.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210414123544.1060604-4-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_para.h
arch/x86/kernel/kvm.c
arch/x86/kernel/kvmclock.c