Go to file
Zelin Deng 6e96999bf6 KVM: x86: Update vCPU's hv_clock before back to guest when tsc_offset is adjusted
commit d9130a2dfdd4b21736c91b818f87dbc0ccd1e757 upstream.

When MSR_IA32_TSC_ADJUST is written by guest due to TSC ADJUST feature
especially there's a big tsc warp (like a new vCPU is hot-added into VM
which has been up for a long time), tsc_offset is added by a large value
then go back to guest. This causes system time jump as tsc_timestamp is
not adjusted in the meantime and pvclock monotonic character.
To fix this, just notify kvm to update vCPU's guest time before back to
guest.

Cc: stable@vger.kernel.org
Signed-off-by: Zelin Deng <zelin.deng@linux.alibaba.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1619576521-81399-2-git-send-email-zelin.deng@linux.alibaba.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-05 19:13:47 +02:00
arch KVM: x86: Update vCPU's hv_clock before back to guest when tsc_offset is adjusted 2024-07-05 19:13:47 +02:00
block bio: fix page leak bio_add_hw_page failure 2024-07-05 19:13:40 +02:00
certs certs: Trigger creation of RSA module signing key if it's not an RSA key 2024-07-05 19:10:21 +02:00
crypto init: add dsm gpl source 2024-07-05 18:00:04 +02:00
Documentation lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ 2024-07-05 19:12:05 +02:00
drivers tty: Fix data race between tiocsti() and flush_to_ldisc() 2024-07-05 19:13:40 +02:00
fs io_uring: IORING_OP_WRITE needs hash_reg_file set 2024-07-05 19:13:40 +02:00
include time: Handle negative seconds correctly in timespec64_to_ns() 2024-07-05 19:13:39 +02:00
init init: add dsm gpl source 2024-07-05 18:00:04 +02:00
ipc ipc/mqueue, msg, sem: avoid relying on a stack reference past its expiry 2021-05-26 12:06:54 +02:00
kernel bpf: Fix possible out of bound write in narrow load handling 2024-07-05 19:12:23 +02:00
lib lib/mpi: use kcalloc in mpi_resize 2024-07-05 19:10:07 +02:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm mm/page_alloc: speed up the iteration of max_order 2024-07-05 19:06:11 +02:00
net ipv4: fix endianness issue in inet_rtm_getroute_build_skb() 2024-07-05 19:13:33 +02:00
samples samples: pktgen: add missing IPv6 option to pktgen scripts 2024-07-05 19:11:56 +02:00
scripts scripts/tracing: fix the bug that can't parse raw_trace_func 2024-07-05 18:52:27 +02:00
security bpf: Add lockdown check for probe_write_user helper 2024-07-05 18:53:10 +02:00
sound ASoC: rt5682: Remove unused variable in rt5682_i2c_remove() 2024-07-05 19:13:39 +02:00
SynoBuildConf init: add dsm gpl source 2024-07-05 18:00:04 +02:00
synology init: add dsm gpl source 2024-07-05 18:00:04 +02:00
tools libbpf: Re-build libbpf.so when libbpf.map changes 2024-07-05 19:11:56 +02:00
usr Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
virt KVM: Do not leak memory for duplicate debugfs directories 2024-07-05 18:52:31 +02:00
.clang-format init: add dsm gpl source 2024-07-05 18:00:04 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS init: add dsm gpl source 2024-07-05 18:00:04 +02:00
Makefile init: add dsm gpl source 2024-07-05 18:00:04 +02:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.