qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Deactivate timer for target_bit above 61
@ 2013-06-10  7:52 Bharat Bhushan
  0 siblings, 0 replies; only message in thread
From: Bharat Bhushan @ 2013-06-10  7:52 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel, agraf, scottwood; +Cc: Bharat Bhushan

QEMU timer supports a maximum timer of INT64_MAX. So starting timer only for
time which is calculated using target_bit < 62 and deactivate/stop timer if
the target bit is above 61.

This patch also fix the time calculation from target_bit.
The code was doing (1 << (target_bit + 1)) while this
should be (1ULL << (target_bit + 1)).

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
 hw/ppc/ppc_booke.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/hw/ppc/ppc_booke.c b/hw/ppc/ppc_booke.c
index e41b036..f4eda15 100644
--- a/hw/ppc/ppc_booke.c
+++ b/hw/ppc/ppc_booke.c
@@ -133,9 +133,15 @@ static void booke_update_fixed_timer(CPUPPCState         *env,
     ppc_tb_t *tb_env = env->tb_env;
     uint64_t lapse;
     uint64_t tb;
-    uint64_t period = 1 << (target_bit + 1);
+    uint64_t period;
     uint64_t now;
 
+    /* Deactivate timer for target_bit > 61 */
+    if (target_bit > 61)
+        return; 
+
+    period = 1ULL << (target_bit + 1);
+
     now = qemu_get_clock_ns(vm_clock);
     tb  = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset);
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-10  7:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10  7:52 [Qemu-devel] [PATCH] Deactivate timer for target_bit above 61 Bharat Bhushan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).