History

Merge tag 'drm-misc-fixes-2026-07-09' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

drm-misc-fixes for v7.2-rc3: - Fix uaf in amdxdna mmap failure path. - A lot of deadlocks, access races and return value fixes in amdxdna. - Fix analogix_dp bitshifts during link training. - Use direct label in drm_exec. - Fix absent indirect bo handling in v3d. - Sync on first active crtc in fb_dirty, rather than first crtc. - Rework try_harder in the buddy allocator. - Make imagination function static to solve compiler warning. - Fix imagination error checking.

Dave Airlie committed 4 months ago

Commit 7978a342 parents 58570ef cf385cf16 files · +307 −96Browse files

Showing the changes to include (1 of 16 files). Show all

Unified · Split

include/drm/drm_exec.h+18−16
@@ -101,17 +101,6 @@ drm_exec_obj(struct drm_exec *exec, unsigned long index) · 100 unmodified lines
101101 #define drm_exec_for_each_locked_object_reverse(exec, obj) \
102102 __drm_exec_for_each_locked_object_reverse(exec, obj, __UNIQUE_ID(drm_exec))
103103
104−/*
105− * Helper to drm_exec_until_all_locked(). Don't use directly.
106− *
107− * Since labels can't be defined local to the loop's body we use a jump pointer
108− * to make sure that the retry is only used from within the loop's body.
109− */
110−#define __drm_exec_until_all_locked(exec, _label) \
111−_label: \
112− for (void *const __maybe_unused __drm_exec_retry_ptr = &&_label; \
113− drm_exec_cleanup(exec);)
114−
115104 /**
116105 * drm_exec_until_all_locked - loop until all GEM objects are locked
117106 * @exec: drm_exec object
@@ -119,9 +108,18 @@ _label: \ · 1 unmodified line
119108 * Core functionality of the drm_exec object. Loops until all GEM objects are
120109 * locked and no more contention exists. At the beginning of the loop it is
121110 * guaranteed that no GEM object is locked.
111+ *
112+ * A global label name drm_exec_retry is used, if you need to use more than one
113+ * instance of this macro in the same function the label needs to be made local
114+ * to the block with the __label__ keyword.
122115 */
123116 #define drm_exec_until_all_locked(exec) \
124− __drm_exec_until_all_locked(exec, __UNIQUE_ID(drm_exec))
117+ for (bool const __maybe_unused __drm_exec_loop = false; \
118+ drm_exec_cleanup(exec);) \
119+ if (false) { \
120+drm_exec_retry: __maybe_unused; \
121+ continue; \
122+ } else
125123
126124 /**
127125 * drm_exec_retry_on_contention - restart the loop to grap all locks
@@ -129,12 +127,14 @@ _label: \ · 1 unmodified line
129127 *
130128 * Control flow helper to continue when a contention was detected and we need to
131129 * clean up and re-start the loop to prepare all GEM objects.
130+ * The __drm_exec_loop check exists to prevent usage outside of an
131+ * drm_exec_until_all_locked() loop.
132132 */
133133 #define drm_exec_retry_on_contention(exec) \
134134 do { \
135135 if (unlikely(drm_exec_is_contended(exec))) \
136− goto *__drm_exec_retry_ptr; \
137− } while (0)
136+ goto drm_exec_retry; \
137+ } while (__drm_exec_loop)
138138
139139 /**
140140 * drm_exec_is_contended - check for contention
@@ -154,12 +154,14 @@ static inline bool drm_exec_is_contended(struct drm_exec *exec) · 13 unmodified lines
154154 *
155155 * Unconditionally retry the loop to lock all objects. For consistency,
156156 * the exec object needs to be newly initialized.
157+ * The __drm_exec_loop check exists to prevent usage outside of an
158+ * drm_exec_until_all_locked() loop.
157159 */
158160 #define drm_exec_retry(_exec) \
159161 do { \
160162 WARN_ON((_exec)->contended != DRM_EXEC_DUMMY); \
161− goto *__drm_exec_retry_ptr; \
162− } while (0)
163+ goto drm_exec_retry; \
164+ } while (__drm_exec_loop)
163165
164166 /**
165167 * drm_exec_ticket - return the ww_acquire_ctx for this exec context

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t