Skip to content
  • Benjamin Herrenschmidt's avatar
    Add a memory barrier to DMA functions · 7a0bac4d
    Benjamin Herrenschmidt authored
    
    
    The emulated devices can run simultaneously with the guest, so
    we need to be careful with ordering of load and stores done by
    them to the guest system memory, which need to be observed in
    the right order by the guest operating system.
    
    This adds a barrier call to the basic DMA read/write ops which
    is currently implemented as a smp_mb(), but could be later
    improved for more fine grained control of barriers.
    
    Additionally, a _relaxed() variant of the accessors is provided
    to easily convert devices who would be performance sensitive
    and negatively impacted by the change.
    
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    7a0bac4d