• David Rientjes's avatar
    dma-direct: atomic allocations must come from atomic coherent pools · 76a19940
    David Rientjes authored
    When a device requires unencrypted memory and the context does not allow
    blocking, memory must be returned from the atomic coherent pools.
    
    This avoids the remap when CONFIG_DMA_DIRECT_REMAP is not enabled and the
    config only requires CONFIG_DMA_COHERENT_POOL.  This will be used for
    CONFIG_AMD_MEM_ENCRYPT in a subsequent patch.
    
    Keep all memory in these pools unencrypted.  When set_memory_decrypted()
    fails, this prohibits the memory from being added.  If adding memory to
    the genpool fails, and set_memory_encrypted() subsequently fails, there
    is no alternative other than leaking the memory.
    Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    76a19940
direct.c 14.9 KB