Skip to content
  • Rob Herring's avatar
    drm/panfrost: Add a no execute flag for BO allocations · 203270c0
    Rob Herring authored
    
    
    Executable buffers have an alignment restriction that they can't cross
    16MB boundary as the GPU program counter is 24-bits. This restriction is
    currently not handled and we just get lucky. As current userspace
    assumes all BOs are executable, that has to remain the default. So add a
    new PANFROST_BO_NOEXEC flag to allow userspace to indicate which BOs are
    not executable.
    
    There is also a restriction that executable buffers cannot start or end
    on a 4GB boundary. This is mostly avoided as there is only 4GB of space
    currently and the beginning is already blocked out for NULL ptr
    detection. Add support to handle this restriction fully regardless of
    the current constraints.
    
    For existing userspace, all created BOs remain executable, but the GPU
    VA alignment will be increased to the size of the BO. This shouldn't
    matter as there is plenty of GPU VA space.
    
    Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
    Cc: Boris Brezillon <boris.brezillon@collabora.com>
    Cc: Robin Murphy <robin.murphy@arm.com>
    Reviewed-by: default avatarSteven Price <steven.price@arm.com>
    Acked-by: default avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
    Signed-off-by: default avatarRob Herring <robh@kernel.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190808222200.13176-6-robh@kernel.org
    203270c0