• Vitaly Kuznetsov's avatar
    x86/kvm: Disable kvmclock on all CPUs on shutdown · c02027b5
    Vitaly Kuznetsov authored
    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: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Message-Id: <20210414123544.1060604-4-vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    c02027b5
kvm.c 23.4 KB