[pve-devel] maybe a windows reboot hang fix

DERUMIER, Alexandre Alexandre.DERUMIER at groupe-cyllene.com
Mon Aug 15 09:00:51 CEST 2022


Hi,
I'm still trying to fix windows reboot hang after windows update (I also 
have the problem in production).


I have found a related bug in redhat bugzilla

https://bugzilla.redhat.com/show_bug.cgi?id=1975840#c151


https://access.redhat.com/solutions/6836351
Issue Microsoft Windows guests hang while rebooting, the bootscreen 
shows the Windows log and the boot circle endlessly.

Resolution There is no resolution or workaround at this time, please 
power off the Guest and power on again.

Root Cause This is Bug 1975840 - Windows guest hangs after updating and 
restarting from the guest OS

and is caused by a TSC (Time Stamp Counter) issue in Guest when it 
overflows during boot time i
f the value provided by the virtualization platform is already high. It 
tends to affect Guests with longer uptimes.


A patch has been in qemu master
https://github.com/qemu/qemu/commit/5286c3662294119dc2dd1e9296757337211451f6

It's really a small patch, it can be backported easily



"
target/i386: properly reset TSC on reset

Some versions of Windows hang on reboot if their TSC value is greater
than 2^54.  The calibration of the Hyper-V reference time overflows
and fails; as a result the processors' clock sources are out of sync.

The issue is that the TSC _should_ be reset to 0 on CPU reset and
QEMU tries to do that.  However, KVM special cases writing 0 to the
TSC and thinks that QEMU is trying to hot-plug a CPU, which is
correct the first time through but not later.  Thwart this valiant
effort and reset the TSC to 1 instead, but only if the CPU has been
run once.

For this to work, env->tsc has to be moved to the part of CPUArchState
that is not zeroed at the beginning of x86_cpu_reset.

"






More information about the pve-devel mailing list