Skip to contentSkip to conversation

KVM: x86: disable stealtime on reboot to avoid mem corruption

PATCH Applied Florian Westphal 2 participants 2 messages Aug 15, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 KVM: x86: disable stealtime on reboot to avoid mem corruption

else, host continues to update stealtime after reboot, which can corrupt e.g. initramfs area.
found when tracking down initramfs unpack error on initial reboot (with qemu-kvm -smp 2, no problem with single-core).

---
 arch/x86/kernel/kvm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Changes since v1:
- leave arch/x86/kernel/kvmclock.c as-is (requested by Marcelo)

arch/x86/kernel/kvm.c +1 -0
index c1d61ee..1596cc8 100644
@@ -354,6 +354,7 @@ static void kvm_pv_guest_cpu_reboot(void *unused)
 	if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
 		wrmsrl(MSR_KVM_PV_EOI_EN, 0);
 	kvm_pv_disable_apf();
+	kvm_disable_steal_time();
 }
 
 static int kvm_pv_reboot_notify(struct notifier_block *nb,
Signature · 1 line
1.7.8.6
#1 lore raw
Quoted 6 lines · Florian Westphal

else, host continues to update stealtime after reboot, which can corrupt e.g. initramfs area.
found when tracking down initramfs unpack error on initial reboot (with qemu-kvm -smp 2, no problem with single-core).

Applied, thanks.