From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@bugzilla.kernel.org Subject: [Bug 59521] KVM linux guest reads uninitialized pvclock values before executing rdmsr MSR_KVM_WALL_CLOCK Date: Mon, 17 Jun 2013 21:29:09 +0000 (UTC) Message-ID: <20130617212909.371EC11FB35@bugzilla.kernel.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" To: kvm@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.19.201]:60407 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930Ab3FQV3M (ORCPT ); Mon, 17 Jun 2013 17:29:12 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A96BD2052A for ; Mon, 17 Jun 2013 21:29:10 +0000 (UTC) Received: from bugzilla.kernel.org (bugzilla.kernel.org [198.145.19.217]) by mail.kernel.org (Postfix) with ESMTP id E5A5820523 for ; Mon, 17 Jun 2013 21:29:09 +0000 (UTC) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: https://bugzilla.kernel.org/show_bug.cgi?id=59521 --- Comment #4 from Eugene Batalov 2013-06-17 21:29:08 --- (In reply to comment #3) > Reply-To: pbonzini@redhat.com > > Il 15/06/2013 19:17, bugzilla-daemon@bugzilla.kernel.org ha scritto: > > The problem is in cpu_init() which is called earlier. > > cpu_init() calls printk and possibly other stuff which can use timestamps. > > printk calls local_clock() to obtain a timestamp of a log message. On KVM > > guests call sequence usually ends up in kvm_clock_read but needed rdmsr is > > executed only in x86_cpuinit.early_percpu_clock_init(). > > > > I consider two approaches to fix the problem: > > 1. Swap cpu_init(); and x86_cpuinit.early_percpu_clock_init(); > > + Simple > > - We will get excessive restrictions on operations which allowed to be > > performed in early_percpu_clock_init() because percpu specific data is > > initialized only in cpu_init(). > > Considering how simple kvm_register_clock is, I think this is > preferrable if it works. Ironically, commit 7069ed6 (x86: kvmclock: > allocate pvclock shared memory area, 2012-11-27), which introduced the > regression, is what should make this simpler fix possible. > > Paolo Understood your point. I'll test this fix and report the results. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.