xemu/configs/targets
Maciej S. Szmigiero 2dc652961d target/i386: Reset TSCs of parked vCPUs too on VM reset
Since commit 5286c36622 ("target/i386: properly reset TSC on reset")
QEMU writes the special value of "1" to each online vCPU TSC on VM reset
to reset it.

However parked vCPUs don't get that handling and due to that their TSCs
get desynchronized when the VM gets reset.
This in turn causes KVM to turn off PVCLOCK_TSC_STABLE_BIT in its exported
PV clock.
Note that KVM has no understanding of vCPU being currently parked.

Without PVCLOCK_TSC_STABLE_BIT the sched clock is marked unstable in
the guest's kvm_sched_clock_init().
This causes a performance regressions to show in some tests.

Fix this issue by writing the special value of "1" also to TSCs of parked
vCPUs on VM reset.

Reproducing the issue:
1) Boot a VM with "-smp 2,maxcpus=3" or similar

2) device_add host-x86_64-cpu,id=vcpu,node-id=0,socket-id=0,core-id=2,thread-id=0

3) Wait a few seconds

4) device_del vcpu

5) Inside the VM run:
# echo "t" >/proc/sysrq-trigger; dmesg | grep sched_clock_stable
Observe the sched_clock_stable() value is 1.

6) Reboot the VM

7) Once the VM boots once again run inside it:
# echo "t" >/proc/sysrq-trigger; dmesg | grep sched_clock_stable
Observe the sched_clock_stable() value is now 0.

Fixes: 5286c36622 ("target/i386: properly reset TSC on reset")
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Link: https://lore.kernel.org/r/5a605a88e9a231386dc803c60f5fed9b48108139.1734014926.git.maciej.szmigiero@oracle.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3f2a05b31ee9ce2ddb6c75a9bc3f5e7f7af9a76f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-12-22 11:18:15 +03:00
..
aarch64-bsd-user.mak bsd-user: Add aarch64 build to tree 2024-07-23 10:56:30 -06:00
aarch64-linux-user.mak linux-user,aarch64: move to syscalltbl file 2024-09-22 09:30:18 +02:00
aarch64-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
aarch64_be-linux-user.mak config/targets: update aarch64_be-linux-user gdb XML list 2024-10-24 09:56:34 +01:00
alpha-linux-user.mak target/alpha: Remove TARGET_ALIGNED_ONLY 2023-05-05 17:05:58 +01:00
alpha-softmmu.mak target/alpha: Remove TARGET_ALIGNED_ONLY 2023-05-05 17:05:58 +01:00
arm-bsd-user.mak bsd-user: add arm target build 2022-01-07 22:58:51 -07:00
arm-linux-user.mak semihosting: Split out guestfd.c 2022-06-28 04:35:07 +05:30
arm-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
armeb-linux-user.mak semihosting: Split out guestfd.c 2022-06-28 04:35:07 +05:30
avr-softmmu.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
hexagon-linux-user.mak linux-user,hexagon: move to syscalltbl file 2024-09-22 09:30:18 +02:00
hppa-linux-user.mak target/hppa: Remove TARGET_HPPA64 2023-11-06 18:49:34 -08:00
hppa-softmmu.mak target/hppa: Remove TARGET_ALIGNED_ONLY 2023-05-05 17:05:58 +01:00
i386-bsd-user.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
i386-linux-user.mak target/i386/gdbstub: Expose orig_ax 2024-10-13 10:05:51 -07:00
i386-softmmu.mak target/i386: Reset TSCs of parked vCPUs too on VM reset 2024-12-22 11:18:15 +03:00
loongarch64-linux-user.mak linux-user,loongarch: move to syscalltbl file 2024-09-22 09:30:18 +02:00
loongarch64-softmmu.mak target/loongarch/gdbstub: Add vector registers support 2024-07-19 10:40:04 +08:00
m68k-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
m68k-softmmu.mak Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
microblaze-linux-user.mak target/microblaze: Add gdbstub xml 2023-02-21 08:52:17 -10:00
microblaze-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
microblazeel-linux-user.mak target/microblaze: Add gdbstub xml 2023-02-21 08:52:17 -10:00
microblazeel-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
mips-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mips-softmmu.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mips64-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mips64-softmmu.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mips64el-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mips64el-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
mipsel-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mipsel-softmmu.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mipsn32-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
mipsn32el-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
or1k-linux-user.mak linux-user,openrisc: move to syscalltbl file 2024-09-22 09:30:18 +02:00
or1k-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
ppc-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
ppc-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
ppc64-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
ppc64-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
ppc64le-linux-user.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
riscv32-linux-user.mak linux-user,riscv: move to syscalltbl file 2024-09-22 09:30:18 +02:00
riscv32-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
riscv64-bsd-user.mak bsd-user: Add RISC-V 64-bit Target Configuration and Debug XML Files 2024-10-02 15:11:52 +10:00
riscv64-linux-user.mak linux-user,riscv: move to syscalltbl file 2024-09-22 09:30:18 +02:00
riscv64-softmmu.mak target/riscv: Enable RV32 CPU support in RV64 QEMU 2024-10-30 11:22:07 +10:00
rx-softmmu.mak configs: disable emulators that require it if libfdt is not found 2024-05-10 15:45:15 +02:00
s390x-linux-user.mak s390x/gdb: Split s390-virt.xml 2023-04-28 08:05:37 +02:00
s390x-softmmu.mak kvm: use configs/ definition to conditionalize debug support 2024-04-18 11:17:27 +02:00
sh4-linux-user.mak target/sh4: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
sh4-softmmu.mak target/sh4: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
sh4eb-linux-user.mak target/sh4: Remove TARGET_ALIGNED_ONLY 2023-05-11 09:53:41 +01:00
sh4eb-softmmu.mak Revert "Remove the unused sh4eb target" 2024-11-04 14:16:11 +01:00
sparc-linux-user.mak target/sparc: Remove TARGET_ALIGNED_ONLY 2023-05-05 17:09:47 +01:00
sparc-softmmu.mak configs: Enable MTTCG for sparc, sparc64 2023-10-25 01:01:12 -07:00
sparc32plus-linux-user.mak target/sparc: Remove TARGET_ALIGNED_ONLY 2023-05-05 17:09:47 +01:00
sparc64-linux-user.mak target/sparc: Remove TARGET_ALIGNED_ONLY 2023-05-05 17:09:47 +01:00
sparc64-softmmu.mak configs: Enable MTTCG for sparc, sparc64 2023-10-25 01:01:12 -07:00
tricore-softmmu.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
x86_64-bsd-user.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
x86_64-linux-user.mak target/i386/gdbstub: Expose orig_ax 2024-10-13 10:05:51 -07:00
x86_64-softmmu.mak target/i386: Reset TSCs of parked vCPUs too on VM reset 2024-12-22 11:18:15 +03:00
xtensa-linux-user.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
xtensa-softmmu.mak configs: rename default-configs to configs and reorganise 2021-07-09 18:21:34 +02:00
xtensaeb-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
xtensaeb-softmmu.mak Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00