qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* what are the requirements on target/ code for -icount to work correctly?
@ 2020-06-18 17:38 Peter Maydell
  2020-06-19  5:46 ` Pavel Dovgalyuk
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2020-06-18 17:38 UTC (permalink / raw)
  To: QEMU Developers
  Cc: Alex Bennée, Paolo Bonzini, Richard Henderson,
	Pavel Dovgalyuk

For -icount mode to work, there are requirements on the target/
code (notably around marking up "I/O" instructions). Unfortunately
we've never documented what these are, which makes it pretty rough
for people writing new targets or reviewing changes to existing ones.
Does anybody understand what they actually are?

Some more specific questions on the general theme:

Q1: the comment on gen_io_end() says:
/*
 * cpu->can_do_io is cleared automatically at the beginning of
 * each translation block.  The cost is minimal and only paid
 * for -icount, plus it would be very easy to forget doing it
 * in the translator.  Therefore, backends only need to call
 * gen_io_start.
 */
but in fact multiple backends *do* call gen_io_end(). When
does a backend have to call this, and when not? Or are those
all legacy useless calls we should delete? (If so, can we
just get rid of this function entirely ?)

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?
Or is it OK to generate more insns after that one? If the former,
is there somewhere we can assert() that this is done ?

Q3: why does gen_tb_start() call gen_io_end()? This is the
*start* of the TB so by definition we haven't started doing
any IO yet...

thanks
-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-06-22  7:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).