]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
x86/kvm: Disable kvmclock on all CPUs on shutdown
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 26 May 2021 05:19:00 +0000 (07:19 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 28 May 2021 10:39:07 +0000 (12:39 +0200)
commit6021a5ca7e8d33bbfc09148c6fa2e60b68a042a6
treef6f6cb31c6b191327b6d6da65e3d60d2d875bb9d
parente0f64c378b40e65f5723b01d426279a18019841e
x86/kvm: Disable kvmclock on all CPUs on shutdown

BugLink: https://bugs.launchpad.net/bugs/1920944
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>
(cherry picked from commit c02027b5742b5aa804ef08a4a9db433295533046)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/include/asm/kvm_para.h
arch/x86/kernel/kvm.c
arch/x86/kernel/kvmclock.c