lkml.org 
[lkml]   [2021]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 13/14] dt-bindings: of: Add restricted DMA pool
    Date
    Introduce the new compatible string, restricted-dma-pool, for restricted
    DMA. One can specify the address and length of the restricted DMA memory
    region by restricted-dma-pool in the reserved-memory node.

    Signed-off-by: Claire Chang <tientzu@chromium.org>
    ---
    .../reserved-memory/reserved-memory.txt | 24 +++++++++++++++++++
    1 file changed, 24 insertions(+)

    diff --git a/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
    index e8d3096d922c..fc9a12c2f679 100644
    --- a/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
    +++ b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
    @@ -51,6 +51,20 @@ compatible (optional) - standard definition
    used as a shared pool of DMA buffers for a set of devices. It can
    be used by an operating system to instantiate the necessary pool
    management subsystem if necessary.
    + - restricted-dma-pool: This indicates a region of memory meant to be
    + used as a pool of restricted DMA buffers for a set of devices. The
    + memory region would be the only region accessible to those devices.
    + When using this, the no-map and reusable properties must not be set,
    + so the operating system can create a virtual mapping that will be used
    + for synchronization. The main purpose for restricted DMA is to
    + mitigate the lack of DMA access control on systems without an IOMMU,
    + which could result in the DMA accessing the system memory at
    + unexpected times and/or unexpected addresses, possibly leading to data
    + leakage or corruption. The feature on its own provides a basic level
    + of protection against the DMA overwriting buffer contents at
    + unexpected times. However, to protect against general data leakage and
    + system memory corruption, the system needs to provide way to lock down
    + the memory access, e.g., MPU.
    - vendor specific string in the form <vendor>,[<device>-]<usage>
    no-map (optional) - empty property
    - Indicates the operating system must not create a virtual mapping
    @@ -120,6 +134,11 @@ one for multimedia processing (named multimedia-memory@77000000, 64MiB).
    compatible = "acme,multimedia-memory";
    reg = <0x77000000 0x4000000>;
    };
    +
    + restricted_dma_mem_reserved: restricted_dma_mem_reserved {
    + compatible = "restricted-dma-pool";
    + reg = <0x50000000 0x400000>;
    + };
    };

    /* ... */
    @@ -138,4 +157,9 @@ one for multimedia processing (named multimedia-memory@77000000, 64MiB).
    memory-region = <&multimedia_reserved>;
    /* ... */
    };
    +
    + pcie_device: pcie_device@0,0 {
    + memory-region = <&restricted_dma_mem_reserved>;
    + /* ... */
    + };
    };
    --
    2.30.0.478.g8a0d178c01-goog
    \
     
     \ /
      Last update: 2021-02-09 07:30    [W:4.025 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site