From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Pavel Dovgalyuk" <dovgaluk@ispras.ru>,
"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: what are the requirements on target/ code for -icount to work correctly?
Date: Fri, 19 Jun 2020 14:37:53 +0200 [thread overview]
Message-ID: <1364f7e8-3283-8ca2-76f8-75e3eb74af7b@redhat.com> (raw)
In-Reply-To: <CAFEAcA-=igrJfoiga7b7rcwZDj46nTNMiT2VEj11DKO7OiJpNA@mail.gmail.com>
On 19/06/20 14:18, Peter Maydell wrote:
> On Fri, 19 Jun 2020 at 12:16, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 19/06/20 07:46, Pavel Dovgalyuk wrote:
>>> I think, that we need some efforts from target maintainers to remove all such calls.
>>
>> I'll take care of target/i386 (which does need one of the three
>> gen_io_end calls that are left).
>
> So why does it need it ? Why can't it just rely on "TB going to
> end anyway which will clear the can_do_io flag" ?
Because the TB is not always going to end in that case that is left.
>>>> Q2: is it a requirement that after an insn which is a "known
>>>> to be an I/O insn" one (like x86 in/out) and which is marked
>>>> up with gen_io_start()/gen_io_end() that we also end the TB?
>>>
>>> It is a requirement for instructions that access virtual clock/icount
>>> value (directly or not).
>>>
>>> There is also an assertion that can_do_io is enabled while generating an
>>> interrupt. I believe, that it doesn't affect RR, but is useful for
>>> deterministic icount mode.
>>
>> As I understand it, the definition of "I/O insn" is anything that can
>> either:
>>
>> - affect the icount deadline (e.g. by setting or removing a
>> QEMU_CLOCK_VIRTUAL timer)
>>
>> - interrupt the current translation block with cpu_loop_exit,
>> cpu_restore_state or similar.
>
> Right, but really what I'm interested in is what the
> requirements are on translate.c code that emits one of these
> insns.
I would be interested in a precise definition of that as well (I've not
really done any icount work on the translation side).
Paolo
> The exact definition of what an I/O insn seems
> more straightforward (and you can always err on the safe side).
>
> thanks
> -- PMM
>
next prev parent reply other threads:[~2020-06-19 12:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 17:38 what are the requirements on target/ code for -icount to work correctly? Peter Maydell
2020-06-19 5:46 ` Pavel Dovgalyuk
2020-06-19 11:16 ` Paolo Bonzini
2020-06-19 12:18 ` Peter Maydell
2020-06-19 12:37 ` Paolo Bonzini [this message]
2020-06-19 12:39 ` Peter Maydell
2020-06-19 12:55 ` Paolo Bonzini
2020-06-19 13:12 ` Peter Maydell
2020-06-19 12:58 ` Alex Bennée
2020-06-19 17:04 ` Peter Maydell
2020-06-22 5:24 ` Max Filippov
2020-06-22 7:50 ` Pavel Dovgalyuk
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=1364f7e8-3283-8ca2-76f8-75e3eb74af7b@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=dovgaluk@ispras.ru \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).