[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 02/12] hw/mips/cputimer: Don't start periodic tim
From: |
James Hogan |
Subject: |
[Qemu-devel] [PATCH v5 02/12] hw/mips/cputimer: Don't start periodic timer in KVM mode |
Date: |
Tue, 17 Jun 2014 23:10:27 +0100 |
From: Sanjay Lal <address@hidden>
Compare/Count timer interrupts are handled in-kernel for KVM. Therefore
don't bother creating the timer at init time if KVM is enabled. This
will conveniently avoid attempts to set the timeout when
cpu_mips_store_count() is called at reset with KVM enabled, treating the
timer as stopped so that CP0_Count is modified directly.
Signed-off-by: Sanjay Lal <address@hidden>
address@hidden: Update after "target-mips: Reset CPU timer
consistently" which moves timer start to reset time]
Signed-off-by: James Hogan <address@hidden>
Cc: Aurelien Jarno <address@hidden>
Cc: Paolo Bonzini <address@hidden>
---
Changes in v5:
- Update commit message and comment in cpu_mips_clock_init() after the
patch "target-mips: Reset CPU timer consistently") (Paolo Bonzini).
Changes in v2:
- Expand commit message
- Rebase on v1.7.0
- Wrap comment
---
hw/mips/cputimer.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/mips/cputimer.c b/hw/mips/cputimer.c
index 6900a745c60c..577c9aeab877 100644
--- a/hw/mips/cputimer.c
+++ b/hw/mips/cputimer.c
@@ -23,6 +23,7 @@
#include "hw/hw.h"
#include "hw/mips/cpudevs.h"
#include "qemu/timer.h"
+#include "sysemu/kvm.h"
#define TIMER_FREQ 100 * 1000 * 1000
@@ -146,5 +147,11 @@ static void mips_timer_cb (void *opaque)
void cpu_mips_clock_init (CPUMIPSState *env)
{
- env->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &mips_timer_cb, env);
+ /*
+ * If we're in KVM mode, don't create the periodic timer, that is handled
in
+ * kernel.
+ */
+ if (!kvm_enabled()) {
+ env->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &mips_timer_cb, env);
+ }
}
--
1.9.3
- [Qemu-devel] [PATCH v5 12/12] MAINTAINERS: Add entry for MIPS KVM, (continued)
- [Qemu-devel] [PATCH v5 12/12] MAINTAINERS: Add entry for MIPS KVM, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 07/12] target-mips: kvm: Add main KVM support for MIPS, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 03/12] hw/mips: Add API to convert KVM guest KSEG0 <-> GPA, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 11/12] target-mips: Enable KVM support in build system, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 05/12] target-mips: get_physical_address: Add KVM awareness, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 06/12] kvm: Allow arch to set sigmask length, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 01/12] target-mips: Reset CPU timer consistently, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 10/12] hw/mips: malta: Add KVM support, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 09/12] hw/mips: In KVM mode, inject IRQ2 (I/O) interrupts via ioctls, James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 02/12] hw/mips/cputimer: Don't start periodic timer in KVM mode,
James Hogan <=
- [Qemu-devel] [PATCH v5 08/12] target-mips: Call kvm_mips_reset_vcpu() from mips_cpu_reset(), James Hogan, 2014/06/17
- [Qemu-devel] [PATCH v5 04/12] target-mips: get_physical_address: Add defines for segment bases, James Hogan, 2014/06/17
- Re: [Qemu-devel] [PATCH v5 00/12] KVM Support for MIPS32 Processors, Paolo Bonzini, 2014/06/18