From patchwork Sat Mar 2 15:18:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Lal X-Patchwork-Id: 2207201 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 13A0A3FCF2 for ; Sat, 2 Mar 2013 15:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689Ab3CBPTR (ORCPT ); Sat, 2 Mar 2013 10:19:17 -0500 Received: from kymasys.com ([64.62.140.43]:56606 "HELO kymasys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752611Ab3CBPTQ (ORCPT ); Sat, 2 Mar 2013 10:19:16 -0500 Received: from agni.kymasys.com ([75.40.23.192]) by kymasys.com for ; Sat, 2 Mar 2013 07:19:14 -0800 Received: by agni.kymasys.com (Postfix, from userid 500) id 0067563004F; Sat, 2 Mar 2013 07:18:49 -0800 (PST) From: Sanjay Lal To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Aurelien Jarno , Gleb Natapov , Marcelo Tosatti , Sanjay Lal Subject: [Qemu-devel][PATCH 04/12] KVM/MIPS: Do not start the periodic timer in KVM mode. Compare/Count timer interrupts are handled in-kernel. Date: Sat, 2 Mar 2013 07:18:39 -0800 Message-Id: <1362237527-23678-6-git-send-email-sanjayl@kymasys.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1362237527-23678-1-git-send-email-sanjayl@kymasys.com> References: <1362237527-23678-1-git-send-email-sanjayl@kymasys.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org --- hw/mips_timer.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/mips_timer.c b/hw/mips_timer.c index 83c400c..0c86a3b 100644 --- a/hw/mips_timer.c +++ b/hw/mips_timer.c @@ -19,11 +19,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #include "hw.h" #include "mips_cpudevs.h" #include "qemu/timer.h" +#include "sysemu/kvm.h" + + #define TIMER_FREQ 100 * 1000 * 1000 /* XXX: do not use a global */ @@ -141,7 +143,10 @@ static void mips_timer_cb (void *opaque) void cpu_mips_clock_init (CPUMIPSState *env) { - env->timer = qemu_new_timer_ns(vm_clock, &mips_timer_cb, env); - env->CP0_Compare = 0; - cpu_mips_store_count(env, 1); + /* If we're in KVM mode, don't start the periodic timer, that is handled in kernel */ + if (!kvm_enabled()) { + env->timer = qemu_new_timer_ns(vm_clock, &mips_timer_cb, env); + env->CP0_Compare = 0; + cpu_mips_store_count(env, 1); + } }