• Alex Deucher's avatar
    drm/radeon: prevent crash in the ring space allocation · b819a964
    Alex Deucher authored
    commit fd5d93a0 upstream.
    
    If the requested number of DWs on the ring is larger than
    the size of the ring itself, return an error.
    
    In testing with large VM updates, we've seen crashes when we
    try and allocate more space on the ring than the total size
    of the ring without checking.
    
    This prevents the crash but for large VM updates or bo moves
    of very large buffers, we will need to break the transaction
    down into multiple batches.  I have patches to use IBs for
    the next kernel.
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    [bwh: Backported to 3.2: use rdev->cp.ring_size instead of ring->ring_size]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    b819a964
radeon_ring.c 12.9 KB