qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC/PATCH] Add a memory barrier to guest memory access


From: David Gibson
Subject: Re: [Qemu-devel] [RFC/PATCH] Add a memory barrier to guest memory access functions
Date: Thu, 17 May 2012 13:35:20 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, May 16, 2012 at 09:28:39PM -0500, Anthony Liguori wrote:
> On 05/16/2012 07:52 PM, Benjamin Herrenschmidt wrote:
[snip]
> >@@ -2794,6 +2795,9 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
> >  {
> >      RAMBlock *block;
> >
> >+    /* We ensure ordering for all DMA transactions */
> >+    dma_mb();
> >+
> 
> I get being conservative, but I don't think this makes a lot of
> sense.  There are cases where the return of this function is cached
> (like the VGA ram area). I think it would make more sense if you
> explicitly put a barrier after write operations.

I tend to agree.  I think the barriers should be in
cpu_physical_memory_rw() and the st*_phys() functions.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson



reply via email to

[Prev in Thread] Current Thread [Next in Thread]