]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
kvm: x86: Disable KVM_HC_CLOCK_PAIRING if tsc is in always catchup mode
authorAnton Romanov <romanton@google.com>
Wed, 16 Feb 2022 18:26:54 +0000 (18:26 +0000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 23 Mar 2022 10:49:03 +0000 (11:49 +0100)
commitefd6dd8ddd68e2b9c651aa0ed5c06846a383a0ed
treebb96dff5412cf62510a87b77a642e5ab475ac07b
parentd90515191473fff2de61afd866618eee9eaa64cb
kvm: x86: Disable KVM_HC_CLOCK_PAIRING if tsc is in always catchup mode

BugLink: https://bugs.launchpad.net/bugs/1966056
[ Upstream commit 3a55f729240a686aa8af00af436306c0cd532522 ]

If vcpu has tsc_always_catchup set each request updates pvclock data.
KVM_HC_CLOCK_PAIRING consumers such as ptp_kvm_x86 rely on tsc read on
host's side and do hypercall inside pvclock_read_retry loop leading to
infinite loop in such situation.

v3:
    Removed warn
    Changed return code to KVM_EFAULT
v2:
    Added warn

Signed-off-by: Anton Romanov <romanton@google.com>
Message-Id: <20220216182653.506850-1-romanton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/kvm/x86.c