Skip to content
  • Michael S. Tsirkin's avatar
    barriers: convert a control to a data dependency · 0139f6a7
    Michael S. Tsirkin authored
    
    
    It's not uncommon to have two access two unrelated memory locations in a
    specific order.  At the moment one has to use a memory barrier for this.
    
    However, if the first access was a read and the second used an address
    depending on the first one we would have a data dependency and no
    barrier would be necessary.
    
    This adds a new interface: dependent_ptr_mb which does exactly this: it
    returns a pointer with a data dependency on the supplied value.
    
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    0139f6a7