qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] TLB, cpu_mmu_index() and load/store vs ifetch
@ 2015-07-14 22:50 Benjamin Herrenschmidt
  0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 2015-07-14 22:50 UTC (permalink / raw)
  To: Paolo Bonzini, Alexander Graf; +Cc: qemu-devel

Hi Paolo, Alex !

I was looking at the patches for speeding up ppc and was trying to
figure out if we could do things better, and reduce the number of modes
and flushes associated with them. While trying to understand it all, I
found something that might be a problem: How we handle the fact that we
can separately turn on/off translation on ppc for I and D side.

However, unless I missed something, qemu currently uses the same helper
to retrieve the mmu index for load/stores and instruction fetches.

Now, the TLB entry itself has different addresses for code, read and
write so it works. However that means that we have to use modes for
every combination of IR and DR in the MSR, which seems like quite a
waste. IE, ignoring PR and HV we already have 4 modes.

Would it be possible to have the target optionally provide a separate
accessor cpu_mmu_index_code() instead and use it in the few places
that actually try to fetch instructions such as get_page_addr_code() ?

That would allow us in effect to have just a single mode entry for
"real mode" (or two if we add support for HV) and simply point to
it appropriately for data or instructions separately.

Is there any reason why that wouldn't work ? I don't yet pretend to
fully understand that part of qemu/tcg :-) Anything I have overlooked ?
(Before I start hacking ...)

Cheers,
Ben.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-14 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14 22:50 [Qemu-devel] TLB, cpu_mmu_index() and load/store vs ifetch Benjamin Herrenschmidt

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