All of lore.kernel.org
 help / color / mirror / Atom feed
* The real function of calling cpu_io_recompile in non-icount mode
@ 2023-06-17 14:52 GanDalf LeBron
  2023-06-19  9:39 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: GanDalf LeBron @ 2023-06-17 14:52 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

As said in the comment, instructions doing device I/Os must be at the end
of the TB in deterministic execution mode, icount mode or replay mode in
other words.

But cpu_io_recompile is still got called when I disable icount opt. The
corresponding MemoryRegion is apic-msi with the access address fee000b0.
Why is the cpu_io_recompile called in non-icount mode?

I checked a lot of historical commit messages about cpu_io_recompile. It
was brought into QEMU because of the use of icount.
/*
commit 2e70f6efa8b960d3b5401373ad6fa98747bb9578
Add instruction counter.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4799
c046a42c-6fe2-441c-8c8c-71466251a162
2e70f6ef pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> on 2008/6/29
at 09:03
*/

The commit below explained that TB would be recompiled if MMIO touching
address is located in the middle of TB.
/*
commit afd46fcad2dceffda35c0586f5723c127b6e09d8
icount: fix cpu_restore_state_from_tb for non-tb-exit cases  In icount
mode, instructions that access io memory spaces in the middle of the
translation block invoke TB recompilation.
*/

Anyway, there is no evidence to prove that cpu_io_recompile would be used
in non-icount mode?

Is it correctly? Or I just encountered some EXTREME BUG?

[-- Attachment #2: Type: text/html, Size: 1677 bytes --]

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

* Re: The real function of calling cpu_io_recompile in non-icount mode
  2023-06-17 14:52 The real function of calling cpu_io_recompile in non-icount mode GanDalf LeBron
@ 2023-06-19  9:39 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2023-06-19  9:39 UTC (permalink / raw)
  To: GanDalf LeBron; +Cc: qemu-devel

On Sat, 17 Jun 2023 at 15:53, GanDalf LeBron <lebrongandalf@gmail.com> wrote:
> As said in the comment, instructions doing device I/Os must be at the end of the TB in deterministic execution mode, icount mode or replay mode in other words.
>
> But cpu_io_recompile is still got called when I disable icount opt. The corresponding MemoryRegion is apic-msi with the access address fee000b0. Why is the cpu_io_recompile called in non-icount mode?

cpu_io_recompile() is only ever called if the CPU can_do_io
flag is false. This flag should only ever get set to 0 if
we are in icount mode. So if you are not using icount and
you end up in that function then there's a bug somewhere.

thanks
-- PMM


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

end of thread, other threads:[~2023-06-19  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-17 14:52 The real function of calling cpu_io_recompile in non-icount mode GanDalf LeBron
2023-06-19  9:39 ` Peter Maydell

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.