You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/configs/targets
Maciej S. Szmigiero 3f2a05b31e 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>
1 month ago
..
aarch64-bsd-user.mak bsd-user: Add aarch64 build to tree 6 months ago
aarch64-linux-user.mak linux-user,aarch64: move to syscalltbl file 4 months ago
aarch64-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
aarch64_be-linux-user.mak config/targets: update aarch64_be-linux-user gdb XML list 3 months ago
alpha-linux-user.mak target/alpha: Remove TARGET_ALIGNED_ONLY 2 years ago
alpha-softmmu.mak target/alpha: Remove TARGET_ALIGNED_ONLY 2 years ago
arm-bsd-user.mak bsd-user: add arm target build 3 years ago
arm-linux-user.mak semihosting: Split out guestfd.c 3 years ago
arm-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
armeb-linux-user.mak semihosting: Split out guestfd.c 3 years ago
avr-softmmu.mak
hexagon-linux-user.mak linux-user,hexagon: move to syscalltbl file 4 months ago
hppa-linux-user.mak target/hppa: Remove TARGET_HPPA64 1 year ago
hppa-softmmu.mak target/hppa: Remove TARGET_ALIGNED_ONLY 2 years ago
i386-bsd-user.mak
i386-linux-user.mak target/i386/gdbstub: Expose orig_ax 3 months ago
i386-softmmu.mak target/i386: Reset TSCs of parked vCPUs too on VM reset 1 month ago
loongarch64-linux-user.mak linux-user,loongarch: move to syscalltbl file 4 months ago
loongarch64-softmmu.mak target/loongarch/gdbstub: Add vector registers support 6 months ago
m68k-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 3 years ago
m68k-softmmu.mak Replace TARGET_WORDS_BIGENDIAN 3 years ago
microblaze-linux-user.mak target/microblaze: Add gdbstub xml 2 years ago
microblaze-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
microblazeel-linux-user.mak target/microblaze: Add gdbstub xml 2 years ago
microblazeel-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
mips-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mips-softmmu.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mips64-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mips64-softmmu.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mips64el-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mips64el-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
mipsel-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mipsel-softmmu.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mipsn32-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
mipsn32el-linux-user.mak target/mips: Remove TARGET_ALIGNED_ONLY 2 years ago
or1k-linux-user.mak linux-user,openrisc: move to syscalltbl file 4 months ago
or1k-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
ppc-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 3 years ago
ppc-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
ppc64-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 3 years ago
ppc64-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
ppc64le-linux-user.mak
riscv32-linux-user.mak linux-user,riscv: move to syscalltbl file 4 months ago
riscv32-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
riscv64-bsd-user.mak bsd-user: Add RISC-V 64-bit Target Configuration and Debug XML Files 4 months ago
riscv64-linux-user.mak linux-user,riscv: move to syscalltbl file 4 months ago
riscv64-softmmu.mak target/riscv: Enable RV32 CPU support in RV64 QEMU 3 months ago
rx-softmmu.mak configs: disable emulators that require it if libfdt is not found 9 months ago
s390x-linux-user.mak s390x/gdb: Split s390-virt.xml 2 years ago
s390x-softmmu.mak kvm: use configs/ definition to conditionalize debug support 9 months ago
sh4-linux-user.mak target/sh4: Remove TARGET_ALIGNED_ONLY 2 years ago
sh4-softmmu.mak target/sh4: Remove TARGET_ALIGNED_ONLY 2 years ago
sh4eb-linux-user.mak target/sh4: Remove TARGET_ALIGNED_ONLY 2 years ago
sh4eb-softmmu.mak Revert "Remove the unused sh4eb target" 3 months ago
sparc-linux-user.mak target/sparc: Remove TARGET_ALIGNED_ONLY 2 years ago
sparc-softmmu.mak configs: Enable MTTCG for sparc, sparc64 1 year ago
sparc32plus-linux-user.mak target/sparc: Remove TARGET_ALIGNED_ONLY 2 years ago
sparc64-linux-user.mak target/sparc: Remove TARGET_ALIGNED_ONLY 2 years ago
sparc64-softmmu.mak configs: Enable MTTCG for sparc, sparc64 1 year ago
tricore-softmmu.mak
x86_64-bsd-user.mak
x86_64-linux-user.mak target/i386/gdbstub: Expose orig_ax 3 months ago
x86_64-softmmu.mak target/i386: Reset TSCs of parked vCPUs too on VM reset 1 month ago
xtensa-linux-user.mak
xtensa-softmmu.mak
xtensaeb-linux-user.mak Replace TARGET_WORDS_BIGENDIAN 3 years ago
xtensaeb-softmmu.mak Replace TARGET_WORDS_BIGENDIAN 3 years ago