qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Qemu memory management
@ 2007-03-29  9:58 Michael Neubauer
  2007-03-29 13:59 ` Stuart Brady
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Neubauer @ 2007-03-29  9:58 UTC (permalink / raw)
  To: qemu-devel

Hello,

I'm trying to learn a bit more about the Qemu SoftMMU. The following
quotation is taken from section 2.10 of the "Qemu Internals" documentation.

"To avoid flushing the translated code each time the MMU mappings change,
QEMU uses a physically indexed translation cache. It means that each TB is
indexed with its physical address." 

Why does a cache like that prevent the translated code from being flushed?
If a translated code is relocated in physical memory (e. g. after a paging
swap operation) that would render the cache useless in my opinion. Maybe I'm
just mixing too many things up here since I don't really have a lot of
experience in the whole operating systems stuff. I would really appreciate
it if someone could give me a hint.

I'm sorry if that's the wrong place to ask questions like the one above.
Please let me know if there's any other  comprehensive resource of
information available.

-- Michael 

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

* Re: [Qemu-devel] Qemu memory management
  2007-03-29  9:58 [Qemu-devel] Qemu memory management Michael Neubauer
@ 2007-03-29 13:59 ` Stuart Brady
  0 siblings, 0 replies; 2+ messages in thread
From: Stuart Brady @ 2007-03-29 13:59 UTC (permalink / raw)
  To: qemu-devel

On Thu, Mar 29, 2007 at 11:58:33AM +0200, Michael Neubauer wrote:

> "To avoid flushing the translated code each time the MMU mappings change,
> QEMU uses a physically indexed translation cache. It means that each TB is
> indexed with its physical address."
> 
> Why does a cache like that prevent the translated code from being flushed?
> If a translated code is relocated in physical memory (e. g. after a paging
> swap operation) that would render the cache useless in my opinion.

My impression is that "each time the MMU mappings change" basically
means "when there's a context switch" and not "when swapping occurs".

If code is swapped out, then yes, it would have to be translated again.
If you wanted to avoid that, you'd need a virtually indexed cache, and I
believe that would require co-operation from the OS, as it would be very
difficult for QEMU to keep track of processes/threads and paging itself.
You'd also have to deal with cache aliases to avoid translating code
for each process or thread that uses it.
-- 
Stuart Brady

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

end of thread, other threads:[~2007-03-29 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-29  9:58 [Qemu-devel] Qemu memory management Michael Neubauer
2007-03-29 13:59 ` Stuart Brady

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