From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dyndbg: fix NULL ptr on i386 due to section alignment
Date: Sat, 14 Mar 2026 07:02:58 +1000 [thread overview]
Message-ID: <review-patch1-20260313131045.2526422-2-jim.cromie@gmail.com> (raw)
In-Reply-To: <20260313131045.2526422-2-jim.cromie@gmail.com>
Patch Review
**Commit message quality:** Good. Clearly explains the root cause (28-byte `__dyndbg_classes` structs on i386 causing misalignment of following `__dyndbg` section) and the three-pronged fix.
**Review of the changes:**
1. **ALIGN(8) added to BOUNDED_SECTION macros** (lines 492, 498 of the diff):
```c
#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \
. = ALIGN(8); \
_BEGIN_##_label_ = .; \
```
This is a reasonable belt-and-suspenders approach. However, this is a **broadly impactful change** — `BOUNDED_SECTION_PRE_LABEL` and `BOUNDED_SECTION_POST_LABEL` are used by many sections beyond dyndbg (e.g., `__bug_table`, jump tables, etc.). Adding ALIGN(8) to *all* bounded sections to fix a dyndbg-specific issue is heavy-handed. It may introduce unnecessary padding in sections that have smaller natural alignment requirements. The commit message acknowledges this for ORC but doesn't discuss the impact on other users of the macro.
**Concern:** Has the impact on vmlinux size been measured across architectures? Adding ALIGN(8) padding before every bounded section could bloat the binary. The arch maintainers (especially Arnd Bergmann, who is CC'd) should weigh in.
2. **Section reordering** (lines 506-508):
```c
BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \
BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \
```
Moving `__dyndbg` before `__dyndbg_classes` so it sits directly after the existing `ALIGN(8)` is the minimal correct fix. This alone would solve the immediate problem without the broader macro change.
3. **ORC unwinder de-macroification** (lines 516-533):
```c
__start_orc_header = .; \
KEEP(*(.orc_header)) \
__stop_orc_header = .; \
```
Manually expanding the macro for ORC sections to avoid the new ALIGN(8) is correct — ORC has ALIGN(4) and ALIGN(2) requirements, and `scripts/sorttable.c` cannot tolerate extra padding. However, this creates a maintenance concern: these three sections now duplicate what `BOUNDED_SECTION_BY` would generate (minus the alignment). If `BOUNDED_SECTION_BY` changes semantics in the future, ORC won't track those changes.
**Suggestion:** Consider adding a comment near the ORC sections explaining *why* they don't use `BOUNDED_SECTION_BY`, so future developers don't "helpfully" convert them back.
**Nit:** The commit says "Closes:" with a lore link, which is good for tracking.
**Verdict:** The fix works but the approach of modifying a global macro is concerning. The section reordering alone (change #2) fixes the immediate issue. The ALIGN(8) in the macro (change #1) is defensive but has non-trivial blast radius. Would prefer an ack from the linker-script/arch maintainers before merging.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-13 21:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 13:09 [PATCH v11 00/65] Fix DRM_USE_DYNAMIC_DEBUG=y Jim Cromie
2026-03-13 13:09 ` [PATCH v11 01/65] dyndbg: fix NULL ptr on i386 due to section alignment Jim Cromie
2026-03-13 21:02 ` Claude Code Review Bot [this message]
2026-03-13 13:09 ` [PATCH v11 02/65] dyndbg: factor ddebug_match_desc out from ddebug_change Jim Cromie
2026-03-13 21:02 ` Claude review: " Claude Code Review Bot
2026-03-13 21:02 ` Claude review: Fix DRM_USE_DYNAMIC_DEBUG=y Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-13 13:19 [PATCH v11 00/65] " Jim Cromie
2026-03-13 13:19 ` [PATCH v11 01/65] dyndbg: fix NULL ptr on i386 due to section alignment Jim Cromie
2026-03-13 21:00 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-20260313131045.2526422-2-jim.cromie@gmail.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox