Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-04 Thread Benjamin Herrenschmidt
Not doing it sometimes invokes crash penalties for us. :-) We could add some way to skip the invalidation if we know the host is an implementation that doesn't need it, possibly depending on the context (is it just DMA he wants to avoid doing this on[1], or do their chips have a fully

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-04 Thread Paolo Bonzini
On 10/04/2011 07:55 AM, Stefan Weil wrote: I learned now that ppc will need flush_icache_range() for kvm, too. So it won't be possible to implement a uniform handling of flush_icache_range() for all host architectures. x86 and IIRC s390 flush_icache_range is a no-op, so it is possible to call

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-04 Thread Peter Maydell
On 4 October 2011 07:29, Paolo Bonzini pbonz...@redhat.com wrote: On 10/04/2011 07:55 AM, Stefan Weil wrote: I learned now that ppc will need flush_icache_range() for kvm, too. So it won't be possible to implement a uniform handling of flush_icache_range() for all host architectures. x86 and

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-04 Thread Scott Wood
On 10/04/2011 12:55 AM, Stefan Weil wrote: Am 03.10.2011 23:40, schrieb Scott Wood: The interface isn't powerpc-specific. It just happens to be the only arch so far that qemu supports that needs the implementation to do something (or possibly just the only one where that need has been

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Scott Wood
On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to initialize the cache before flush_icache_range() is called. This patch moves the code to tcg/ppc and tcg/ppc64. Initialisation is called from tcg_target_init() there.

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Stefan Weil
Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to initialize the cache before flush_icache_range() is called. This patch moves the code to tcg/ppc and tcg/ppc64. Initialisation is called from

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Alexander Graf
On 03.10.2011, at 23:10, Stefan Weil wrote: Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to initialize the cache before flush_icache_range() is called. This patch moves the code to

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Scott Wood
On 10/03/2011 04:10 PM, Stefan Weil wrote: Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to initialize the cache before flush_icache_range() is called. This patch moves the code to tcg/ppc

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Alexander Graf
On 03.10.2011, at 23:40, Scott Wood wrote: On 10/03/2011 04:10 PM, Stefan Weil wrote: Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to initialize the cache before flush_icache_range() is

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Scott Wood
On 10/03/2011 04:36 PM, Alexander Graf wrote: With TCG, we're never executing guest code directly, but always go through TCG to emulate it. So the only case where we actually need to flush the icache is in TCG code generation, never outside, right? Right. For KVM, I agree. We need some

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Scott Wood
On 10/03/2011 04:43 PM, Alexander Graf wrote: On 03.10.2011, at 23:40, Scott Wood wrote: On 10/03/2011 04:10 PM, Stefan Weil wrote: Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Alexander Graf
On 03.10.2011, at 23:51, Scott Wood wrote: On 10/03/2011 04:43 PM, Alexander Graf wrote: On 03.10.2011, at 23:40, Scott Wood wrote: On 10/03/2011 04:10 PM, Stefan Weil wrote: Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Alexander Graf
On 04.10.2011, at 00:07, Scott Wood wrote: On 10/03/2011 05:06 PM, Alexander Graf wrote: On 03.10.2011, at 23:50, Scott Wood wrote: On 10/03/2011 04:36 PM, Alexander Graf wrote: With TCG, we're never executing guest code directly, but always go through TCG to emulate it. So the only

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Scott Wood
On 10/03/2011 05:06 PM, Alexander Graf wrote: On 03.10.2011, at 23:50, Scott Wood wrote: On 10/03/2011 04:36 PM, Alexander Graf wrote: With TCG, we're never executing guest code directly, but always go through TCG to emulate it. So the only case where we actually need to flush the icache

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Alexander Graf
On 03.10.2011, at 23:50, Scott Wood wrote: On 10/03/2011 04:36 PM, Alexander Graf wrote: With TCG, we're never executing guest code directly, but always go through TCG to emulate it. So the only case where we actually need to flush the icache is in TCG code generation, never outside, right?

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] tcg/ppc*: Move cache initialization to ppc specific code

2011-10-03 Thread Stefan Weil
Am 03.10.2011 23:40, schrieb Scott Wood: On 10/03/2011 04:10 PM, Stefan Weil wrote: Am 03.10.2011 22:52, schrieb Scott Wood: On 10/03/2011 03:43 PM, Stefan Weil wrote: qemu_cache_utils_init() is only used by ppc / ppc64 tcg targets to initialize the cache before flush_icache_range() is