[Top][All Lists]

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

[Qemu-devel] [PATCH v13 0/8] PTimer fixes/features and ARM MPTimer conve

From: Dmitry Osipenko
Subject: [Qemu-devel] [PATCH v13 0/8] PTimer fixes/features and ARM MPTimer conversion
Date: Fri, 27 May 2016 20:03:28 +0300


Current QEMU ARM MPTimer device model provides only a certain subset of the
emulation behavior, so this patch series is supposed to add missing parts by
converting the MPTimer to use generic ptimer helper. It fixes some important
ptimer bugs and provides new features that are required for the ARM MPTimer.

Emulation behavior is verified against the real HW by running specially
crafted MPTimer tests in both icount and non-icount modes:


Changelog for the ARM MPTimer QEMUTimer to ptimer conversion:

    V2: Fixed changing periodic timer counter value "on the fly". I added a
        test to the gist to cover that issue.

    V3: Fixed starting the timer with load = 0 and counter != 0, added tests
        to the gist for this issue. Changed vmstate version for all VMSD's,
        since loadvm doesn't check version of nested VMSD.

    V4: Fixed spurious IT bit set for the timer starting in the periodic mode
        with counter = 0. Test added.

    V5: Code cleanup, now depends on ptimer_set_limit() fix.

    V6: No code change, added test to check ptimer_get_count() with corrected
        .limit value.

    V7: No change.

    V8: No change.

    V9: No change.

    V10: Correctly handle cases when counter = load = 0 and prescaler != 0,
         i.e. triggering interrupt in that case. Call ptimer_* only when
         certain MPTimer state was changed, like prescaler change. Factor out
         timerblock_set_count from timerblock_run and inline both.
         Tests updated.

    V11: Fixed missed periodic timer stopping on setting counter => 0 with
         load = 0 and prescaler = 0.

    v12: Timer isn't doing uninterruptible IRQ, but ticks continuously.
         On setting counter/load to 0 with prescaler != 0, timer would trigger
         IRQ after one period. Verified on real HW, tests updated.

    v13: Rebased on recent master, use new ptimer policy feature.

Patches for ptimer are introduced since V5 of "ARM MPTimer conversion".

Changelog for the ptimer patches:

    V5: Only fixed ptimer_set_limit() for the disabled timer.

    V6: As was pointed by Peter Maydell, there are other issues beyond
        ptimer_set_limit(), so V6 supposed to cover all those issues.

    V7: Added accidentally removed !use_icount check.
        Added missed "else" statement.

    V8: Adjust period instead of the limit and do it for periodic timer only
        (.limit adjusting bug). Added patch/fix for freq/period change and
        ptimer_get_count() improvement.

    V9: Don't do wrap around if counter == 0, otherwise polled periodic
        timer won't ever return counter = 0.

    V10: Addressed V8/9 review comments.
         Adjust timer period based on delta instead of limit.
         Don't wrap around when in icount mode.
         New patches: "on the fly" mode switch, silence error msg when
                      delta = load = 0, introduce ptimer_get_limit.

    V11: Dropped timer tick from "Perform tick and counter wrap around if
         timer already expired" patch since it would cause bogus tick after
         QEMU been reset if ptimer was stopped and it's QEMUtimer expired
         during reset.
         Patch "Legalize running with delta = load = 0" now explicitly
         forbids period = 0.

    v12: Fixed missed abort on setting freq > 1000000000.
         New patches:
            "Fix counter - 1 returned by ptimer_get_count for the active timer"
            "Perform delayed tick instead of immediate if delta = 0"

    v13: Squashed the following two patches from v12:

        hw/ptimer: Legalize running with delta = load = 0 and abort on period = 0
        hw/ptimer: Perform delayed tick instead of immediate if delta = 0


        hw/ptimer: Support running with counter = 0 by introducing new policy 

        The second patch has no r-b, I omitted Peter's Crosthwaite r-b from the
        first patch. I think it's not valid now, otherwise please let me know.

Dmitry Osipenko (8):
  hw/ptimer: Fix issues caused by the adjusted timer limit value
  hw/ptimer: Perform counter wrap around if timer already expired
  hw/ptimer: Update .delta on period/freq change
  hw/ptimer: Support "on the fly" timer mode switch
  hw/ptimer: Introduce ptimer_get_limit
  hw/ptimer: Support running with counter = 0 by introducing new policy
  hw/ptimer: Fix counter - 1 returned by ptimer_get_count for the active
  arm_mptimer: Convert to use ptimer

 hw/core/ptimer.c               | 131 ++++++++++++++++++++++++---------------
 hw/timer/arm_mptimer.c         | 135 ++++++++++++++++++++++-------------------
 include/hw/ptimer.h            |   7 +++
 include/hw/timer/arm_mptimer.h |   5 +-
 4 files changed, 162 insertions(+), 116 deletions(-)


reply via email to

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