Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Benjamin Herrenschmidt
On Wed, 2011-09-28 at 16:20 -0500, Scott Wood wrote: > Sure, if there might be stale stuff in the icache, the guest will need > to invalidate that. But when running on real hardware, an OS does not > need to flush it out of data cache after a DMA transaction[1]. So > technically we just want a f

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Scott Wood
On 09/28/2011 04:02 PM, Benjamin Herrenschmidt wrote: > On Wed, 2011-09-28 at 12:27 -0500, Scott Wood wrote: > >> Why would it need to be synchronous? Even if it's asynchronous emulated >> DMA, we don't want it sitting around only in a data cache that >> instruction fetches won't snoop. > > Exce

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Benjamin Herrenschmidt
On Wed, 2011-09-28 at 12:27 -0500, Scott Wood wrote: > Why would it need to be synchronous? Even if it's asynchronous emulated > DMA, we don't want it sitting around only in a data cache that > instruction fetches won't snoop. Except that this is exactly what happens on real HW :-) The guest wi

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Benjamin Herrenschmidt
On Wed, 2011-09-28 at 16:26 +0200, Alexander Graf wrote: > > This makes sure that when device emulation overwrites code that is > already present in the cache of a CPU, it gets flushed from the > icache. I'm fairly sure we want that :). But let's ask Ben and David > as well. Hrm we don't need tha

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Scott Wood
On 09/28/2011 09:45 AM, Jan Kiszka wrote: > On 2011-09-28 16:26, Alexander Graf wrote: >> >> On 28.09.2011, at 16:23, Jan Kiszka wrote: >> >>> Alex, >>> >>> we have this diff in qemu-kvm: >>> >>> diff --git a/exec.c b/exec.c >>> index c1e045d..f188549 100644 >>> --- a/exec.c >>> +++ b/exec.c >>> @@

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Jan Kiszka
On 2011-09-28 16:26, Alexander Graf wrote: On 28.09.2011, at 16:23, Jan Kiszka wrote: Alex, we have this diff in qemu-kvm: diff --git a/exec.c b/exec.c index c1e045d..f188549 100644 --- a/exec.c +++ b/exec.c @@ -3950,6 +3955,11 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Alexander Graf
Am 28.09.2011 um 16:49 schrieb Jan Kiszka : > On 2011-09-28 16:45, Jan Kiszka wrote: >> On 2011-09-28 16:26, Alexander Graf wrote: >>> >>> On 28.09.2011, at 16:23, Jan Kiszka wrote: >>> Alex, we have this diff in qemu-kvm: diff --git a/exec.c b/exec.c index c1e04

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Jan Kiszka
On 2011-09-28 16:45, Jan Kiszka wrote: On 2011-09-28 16:26, Alexander Graf wrote: On 28.09.2011, at 16:23, Jan Kiszka wrote: Alex, we have this diff in qemu-kvm: diff --git a/exec.c b/exec.c index c1e045d..f188549 100644 --- a/exec.c +++ b/exec.c @@ -3950,6 +3955,11 @@ void cpu_physical_mem

Re: [Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Alexander Graf
On 28.09.2011, at 16:23, Jan Kiszka wrote: > Alex, > > we have this diff in qemu-kvm: > > diff --git a/exec.c b/exec.c > index c1e045d..f188549 100644 > --- a/exec.c > +++ b/exec.c > @@ -3950,6 +3955,11 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, > uint8_t *buf, >

[Qemu-devel] qemu-kvm: Role of flush_icache_range on PPC

2011-09-28 Thread Jan Kiszka
Alex, we have this diff in qemu-kvm: diff --git a/exec.c b/exec.c index c1e045d..f188549 100644 --- a/exec.c +++ b/exec.c @@ -3950,6 +3955,11 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, cpu_physical_memory_set_dirty_flags( a