aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2013-06-10 12:31:11 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-06-19 06:25:28 -0400
commit07868fc6aaf57847b0f3a3d53086b7556eb83f4a (patch)
tree34dbdf48308f67b1820a1a4cbf156a68c00dc5ef /arch
parentf8941fbe204fa2fb51e7acd8bfd0f51225fe03b4 (diff)
x86: kvmclock: zero initialize pvclock shared memory area
kernel might hung in pvclock_clocksource_read() due to uninitialized memory might contain odd version value in following cycle: do { version = __pvclock_read_cycles(src, &ret, &flags); } while ((src->version & 1) || version != src->version); if secondary kvmclock is accessed before it's registered with kvm. Clear garbage in pvclock shared memory area right after it's allocated to avoid this issue. Ref: https://bugzilla.kernel.org/show_bug.cgi?id=59521 Signed-off-by: Igor Mammedov <imammedo@redhat.com> [See BZ for analysis. We may want a different fix for 3.11, but this is the safest for now - Paolo] Cc: <stable@vger.kernel.org> # 3.8 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/kvmclock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index d2c381280e3c..3dd37ebd591b 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -242,6 +242,7 @@ void __init kvmclock_init(void)
242 if (!mem) 242 if (!mem)
243 return; 243 return;
244 hv_clock = __va(mem); 244 hv_clock = __va(mem);
245 memset(hv_clock, 0, size);
245 246
246 if (kvm_register_clock("boot clock")) { 247 if (kvm_register_clock("boot clock")) {
247 hv_clock = NULL; 248 hv_clock = NULL;