From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Pavel Dovgalyuk <dovgaluk@ispras.ru>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [RFC PATCH] docs/devel: add some notes on tcg-icount for developers
Date: Fri, 19 Jun 2020 16:54:37 +0100 [thread overview]
Message-ID: <878sgjuk3m.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA-KX-2zjktg9A8dPdo6RkxtafM7YnahKaP=uftCO-7=GQ@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On Fri, 19 Jun 2020 at 14:58, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> This attempts to bring together my understanding of the requirements
>> for icount behaviour into one reference document for our developer
>> notes. It currently make one piece of conjecture which I think is true
>> that we don't need gen_io_start/end statements for non-MMIO related
>> I/O operations.
>
>> +Other I/O operations
>> +--------------------
>> +
>> +MMIO isn't the only type of operation for which we might need a
>> +correct and accurate clock. IO port instructions and accesses to
>> +system registers are the common examples here. For the clock to be
>> +accurate you end a translation block on these instructions.
>> +
>> +.. warning:: (CONJECTURE) instructions that won't get trapped in the
>> + io_read/writex shouldn't need gen_io_start/end blocks
>> + around them.
>
> I think this is backwards -- instructions where icount is handled
> by io_readx/io_writex are the ones that don't need to be marked
> with gen_io_start. It's the i/o instructions that don't go through
> io_readx/io_writex that need gen_io_start.
There are two types of MMIO accesses we generate:
- normal loads/stores which if they end up accessing I/O ports
eventually trap in io_read/writex where as they haven't been marked
with can_do_io (via gen_io_start()) will trigger a recompile and
exit.
- loads and stores emitted while CF_LAST_IO && icount is in effect
(from the above recompile) where they should be the last instruction
in the block so the icount is correct when the do whatever they do.
What I've missed is the one other place where cpu->can_do_io is checked
which is when we read cpu_get_icount_raw_locked. In this case it is
effectively an assert that we have marked the instruction as potentially
accessing icount - although not that the gen_io_start/end was actually on
the last instruction of the block.
--
Alex Bennée
next prev parent reply other threads:[~2020-06-19 15:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-19 13:58 [RFC PATCH] docs/devel: add some notes on tcg-icount for developers Alex Bennée
2020-06-19 14:50 ` no-reply
2020-06-19 14:51 ` no-reply
2020-06-19 14:54 ` Peter Maydell
2020-06-19 15:44 ` Paolo Bonzini
2020-06-19 15:54 ` Alex Bennée [this message]
2020-06-19 14:55 ` no-reply
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=878sgjuk3m.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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.