qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/2] PPC: BookE: Make FIT/WDT timers at best microse


From: Alexander Graf
Subject: [Qemu-devel] [PATCH 2/2] PPC: BookE: Make FIT/WDT timers at best microsecond grained
Date: Sat, 23 Nov 2013 04:53:41 +0100

The default granularity for the FIT timer on 440 is on every 0x1000th
transition of TB from 0 to 1. Translated that means 48828 times a second.

Since interrupts are quite expensive for 440 and we don't really care
about the accuracy of the FIT to that significance, let's force FIT and
WDT to at best microsecond granularity.

This basically restores behavior as it was in QEMU 1.6, where timers
could only deal with microsecond granularities at all.

This patch greatly improves performance with the 440 target and restores
roughly the same performance level that QEMU 1.6 had for me.

Signed-off-by: Alexander Graf <address@hidden>
---
 hw/ppc/ppc_booke.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/ppc/ppc_booke.c b/hw/ppc/ppc_booke.c
index 28cf9fd..3038acc 100644
--- a/hw/ppc/ppc_booke.c
+++ b/hw/ppc/ppc_booke.c
@@ -174,6 +174,12 @@ static void booke_update_fixed_timer(CPUPPCState         
*env,
 
     if (*next == now) {
         (*next)++;
+    } else {
+        /*
+         * There's no point to fake any granularity that's more fine grained
+         * than microseconds. Anything beyond that just overloads the system.
+         */
+        *next = MAX(*next, now + SCALE_MS);
     }
 
     /* Fire the next timer */
-- 
1.7.12.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]