All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/6] target-alpha: Add high-resolution access to wall clock and an alarm.
Date: Fri, 26 Aug 2011 17:36:19 +0100	[thread overview]
Message-ID: <CAFEAcA8XgcmK+Gn1ra6W2UiAeZqF5SV3Kc90z=yC3PuV83yrZg@mail.gmail.com> (raw)
In-Reply-To: <4E57C9AC.4040703@twiddle.net>

On 26 August 2011 17:28, Richard Henderson <rth@twiddle.net> wrote:
> On 08/25/2011 11:07 PM, Paolo Bonzini wrote:
>> On 08/26/2011 05:51 AM, Peter Maydell wrote:
>>> Don't you need some magic around helper calls that read/write
>>> the time to keep -icount working? I don't understand this but
>>> Paolo does...
>>
>> Let's say I understand the theory (how icount relies on it)
>> more than the practice (how the targets should do it). :)
>
> Heh.  Well, let's say that while I've aped the other targets in
> how icount is treated in the translator, I have no idea what it
> is really supposed to accomplish, and so have never used it.

Well, "what it's supposed to accomplish" is straightforward
enough, we want to keep a count of cycles executed (and I think
also maintain determinism, although that I'm less certain about).
Since we only update the count at the start of each basic block,
we (potentially) have to stop the basic block where we hit an
I/O operation which fiddles with the timer. For I/O via memory
accesses this is all dealt with by the generic code, but where
the CPU has some instruction which does things with timers not
via a memory access there needs to be a bit of special casing.

Look at the way target-i386 and target-mips use gen_io_start()
and gen_io_end() around x86 io insns and MIPS mtc0. I think
that what you need is (a) to bracket with gen_io_start/end
and (b) to end the translation block, but that's really just
guesswork from the existing code...

-- PMM

  reply	other threads:[~2011-08-26 16:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 21:45 [Qemu-devel] [PULL][PATCH 0/6] Alpha system emulation, v9 Richard Henderson
2011-08-25 21:45 ` [Qemu-devel] [PATCH 1/6] target-alpha: Add custom PALcode image for CLIPPER emulation Richard Henderson
2011-08-26  4:09   ` Peter Maydell
2011-08-25 21:45 ` [Qemu-devel] [PATCH 2/6] target-alpha: Add " Richard Henderson
2011-08-25 21:45 ` [Qemu-devel] [PATCH 3/6] " Richard Henderson
2011-08-25 21:45 ` [Qemu-devel] [PATCH 4/6] target-alpha: Implement WAIT IPR Richard Henderson
2011-08-25 21:45 ` [Qemu-devel] [PATCH 5/6] target-alpha: Implement HALT IPR Richard Henderson
2011-08-25 21:45 ` [Qemu-devel] [PATCH 6/6] target-alpha: Add high-resolution access to wall clock and an alarm Richard Henderson
2011-08-26  3:51   ` Peter Maydell
2011-08-26  9:07     ` Paolo Bonzini
2011-08-26 16:28       ` Richard Henderson
2011-08-26 16:36         ` Peter Maydell [this message]
2011-08-26 20:03           ` Richard Henderson
2011-08-26 20:12           ` Richard Henderson
2011-08-27 16:44           ` Edgar E. Iglesias
2011-08-25 21:59 ` [Qemu-devel] [PULL][PATCH 0/6] Alpha system emulation, v9 Richard Henderson
2011-09-22 15:30 [Qemu-devel] [PATCH 0/6] Alpha system emulation, v11 Richard Henderson
2011-09-22 15:30 ` [Qemu-devel] [PATCH 6/6] target-alpha: Add high-resolution access to wall clock and an alarm Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8XgcmK+Gn1ra6W2UiAeZqF5SV3Kc90z=yC3PuV83yrZg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.