[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] implementing architectural timers using QEMU timers
From: |
Pavel Dovgalyuk |
Subject: |
Re: [Qemu-devel] implementing architectural timers using QEMU timers |
Date: |
Thu, 12 Jan 2017 14:28:03 +0300 |
> From: Max Filippov [mailto:address@hidden
> On Tue, Jan 10, 2017 at 12:31 AM, Pavel Dovgalyuk <address@hidden> wrote:
> >> From: Max Filippov [mailto:address@hidden
> >
> >> I'm trying to reimplement xtensa CCOUNT (cycle counter) and
> >> CCOMPARE (CCOUNT-based timer interrupts) using QEMU
> >> timers. That is CCOUNT value is derived from the
> >> QEMU_CLOCK_VIRTUAL clock and CCOMPARE interrupts are
> >> generated from the QEMU_CLOCK_VIRTUAL timer callbacks.
> >> The code is here:
> >> https://github.com/OSLL/qemu-xtensa/commits/xtensa-ccount
> >>
> >> I've got the following issues doing that:
> >>
> >> - I thought that could be improved in -icount mode, so I tried that.
> >> It is better with -icount, but it's still not 100% accurate. That is
> >> I was able to observe guest reading QEMU clock value that is
> >> past QEMU timer deadline before that timer callback was
> >> invoked.
> >
> > icount is meant to be 100% accurate.
> > tcg_get_icount_limit function calculates the deadline before the soonest
> > virtual timer and executes number of instructions that will fit this
> > timeout.
>
> Ok, looks like what happens in my case is that instruction that
> sets CCOMPARE and thus changes remaining icount does not
> cause exit from the cpu_exec. So merely ending TB on
> QEMU_CLOCK_VIRTUAL timer update is not enough, I need to
> throw an exception of some kind? Or does the timer code need
> to take care of that?
Yes, it seems that you should end the block with an exception,
to allow icount loop recalculate the timeouts.
Pavel Dovgalyuk
- [Qemu-devel] implementing architectural timers using QEMU timers, Max Filippov, 2017/01/09
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Alex Bligh, 2017/01/09
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Pavel Dovgalyuk, 2017/01/10
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Max Filippov, 2017/01/10
- Re: [Qemu-devel] implementing architectural timers using QEMU timers,
Pavel Dovgalyuk <=
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Peter Maydell, 2017/01/12
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Pavel Dovgalyuk, 2017/01/12
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Paolo Bonzini, 2017/01/16
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Pavel Dovgalyuk, 2017/01/17
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Max Filippov, 2017/01/17
- Re: [Qemu-devel] implementing architectural timers using QEMU timers, Max Filippov, 2017/01/15
Re: [Qemu-devel] implementing architectural timers using QEMU timers, Frederic Konrad, 2017/01/10