From nobody Thu Apr 2 20:28:19 2026 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B19A3A5E82 for ; Thu, 26 Mar 2026 18:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551276; cv=none; b=GVNd3fqICWJDaYGIfYcJAg2JlSBxcBcT4TFAVd65kK7rmKwvKKjKTYC6OQpjezc3pbu4StQtPVJI1VmIFxPgf+XQ/uCa4jTzw6eJRm6vr+8O0pRacxnGBIN0+OS3P5bzhfMzMm77ePoxT4/p0F+7YYJCs9AQXpcS1s92P+qHu/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551276; c=relaxed/simple; bh=BBEPtf+MkETNuagrJrkwWSnSZr8x+EAveVod63of4Us=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hNxXY5rUS3/YPjHJmbNHFTMjcVChQrgN9ei60MI0VVmLtfuTWkO1pQXJDfJbJZCdtWXin6cPhB4vd4epKw/T1OXtSZ7UIhrKv0g9tYmj2F1hTqxF/dButiqy/DB0BDt1bT7x+1F7lNx9NYgqOgsXavh0v8oQc2ng03eC3sOJc7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pHhzUjFl; arc=none smtp.client-ip=209.85.160.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pHhzUjFl" Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-40ee9b945d5so939933fac.0 for ; Thu, 26 Mar 2026 11:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551274; x=1775156074; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OqKdylESk9B/a6b5Oi5X2s5Hl7NPYjGcR39u69Tcphw=; b=pHhzUjFlnneW3/UBSH+DFDpWdTURqfhFdYH7LcAHrbL4ZYiSBE0hLCkC5qjiL90ULR f9RsZiQzhofJqpa8Twb+0Zq86P9056/ykZS5QX4R/+GjkJv6Ne91F54eHgIsCL5ywRAN PwQ45deFivRgtkA0BKvGTkkTr3Yj28GI5D1DasdVhtnYEh2KO5tJyqrIPg95FKv5XGnB Jm0rcij1cKpYML/WdqsAwfDkcP6nuOCEIF9BO0+xbV0KQ08sEm8RWUuQz4ilxO4GX7yM nBQWwMARotOuAtxQVKCrdO+n4UD7MouPdY92Ky3OFGX56TwZ9YR7fd6vP6DvkHmvBm1n YOBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551274; x=1775156074; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OqKdylESk9B/a6b5Oi5X2s5Hl7NPYjGcR39u69Tcphw=; b=N1LoI3SG+VhQt3NqMB2vm+rQyK0qLAWOWnVH3b2LN3IQf7yxKa1LmUimdynB1qfn3O BTgVztrl26+7m5WVDd2sSYIU2MFdS4UeNCKei0KQLaT03vcImD4/Awk6wtPOWXZMqMF7 2D+ZnXH0AD/SQ1f5wMaMdXVxjjJtO9zFVL3qCz+OSfwaN1nd4kK2Gc8OcO9f6evNyc8Q BnXx3WupqmBwM3A6a6n7T1RkGjwVmorni/35IfGaTKKrEORNdoOzfWQq8J/wLcJxWIj0 Z31r6MneRpEYloDywTRC17onemjmki0ATPKTXpmNos+pJtG3Cj3X55EiZm0EdaOFPLz2 chag== X-Gm-Message-State: AOJu0YxwWkWOD2LbIsomkJQAtRcaTzMbhHLxAB6+3rg96Zzggo+nq59Y IABe/8sK7FxAzE44CqvblIeY1beK4r1bXJ38VwVcFoHLeIwnEzqRS5ddxI5HvA== X-Gm-Gg: ATEYQzwlUu7S9WI/nTVtAJ+x85KdZpCaaF6gedNjmYuXAkIApbErDD6eF1tKufNvTDN o5678esds/wihe+21YWtu4SKcgqjYJXt72oK/bKUye/DddzOHlYQBrQFvQbCW4iLfoy5Z+o11cv 1jjmLrEscLHsV7QoB+fZgYTVWcq42fZy+n0PN1XSMnIAP3TiIFp42KpXTVOXX5z+pr5SP2owj84 7xHM4JDbdwYUz8zx4vS/eNGjA9DYC07bj1py0EPJF9GuCsikMx9uP1UKvCThiHccjh8t4br6R4D J9Va4iQN9N6LHu6Za+hsIP/7AQI3vebWJEVKn0yZCjzPuSBAiK0AOKnz0Y5q+Xw0DeHm+ezTX40 chhA/Y6m+G2dQpfkqPABmZwYyDTRE4EVQHD5FlLt1ZF1+tfI2mY8ucul2m4T4VNW9MDT/n4ytqE gfinqZeCLiKPP/nQGd/wotZLsbGBzcnq8lAvF8yuTO2QnchuP2 X-Received: by 2002:a05:6871:2b0d:b0:41c:4af:7f5f with SMTP id 586e51a60fabf-41ca6fcdc85mr4146349fac.28.1774551273959; Thu, 26 Mar 2026 11:54:33 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:33 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 03/69] dyndbg.lds.S: fix lost dyndbg sections in modules Date: Thu, 26 Mar 2026 12:53:07 -0600 Message-ID: <20260326185413.1205870-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In an (unused) experimental variation of this series, I had trouble with __dyndbg* sections getting lost in drm drivers. While it didn't happen in this series, it exposed a non-obvious weakness. So fix it, by following the model demonstrated in codetag.lds.h. Introduce include/asm-generic/dyndbg.lds.h, with 2 macros: DYNDBG_SECTIONS moves the 2 BOUNDED_SECTION_BY calls from DATA_DATA in vmlinux.lds.h, which now includes the file and calls the new macro. MOD_DYNDBG_SECTIONS also has the 2 BOUNDED_SECTION_BY calls, but wraps them with output section syntax to keep them as known and separate ELF sections in the module.ko. dyndbg.lds.h includes (reuses) bounded-section.lds.h scripts/module.lds.S: now calls MOD_DYNDBG_SECTIONS right before the CODETAG macro (consistent with their placements in vmlinux.lds.h), and also includes dyndbg.lds.h This isolates vmlinux.lds.h from further __dyndbg section additions. Signed-off-by: Jim Cromie --- include/asm-generic/dyndbg.lds.h | 19 +++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 6 ++---- scripts/module.lds.S | 2 ++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 include/asm-generic/dyndbg.lds.h diff --git a/include/asm-generic/dyndbg.lds.h b/include/asm-generic/dyndbg.= lds.h new file mode 100644 index 000000000000..f95683aa16b6 --- /dev/null +++ b/include/asm-generic/dyndbg.lds.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DYNDBG_LDS_H +#define __ASM_GENERIC_DYNDBG_LDS_H + +#include +#define DYNDBG_SECTIONS() \ + . =3D ALIGN(8); \ + BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) + +#define MOD_DYNDBG_SECTIONS() \ + __dyndbg : { \ + BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + } \ + __dyndbg_classes : { \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + } + +#endif /* __ASM_GENERIC_DYNDBG_LDS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 462f124ad457..b59f343818b0 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -340,6 +340,7 @@ /* * .data section */ +#include #define DATA_DATA \ *(.xiptext) \ *(DATA_MAIN) \ @@ -353,10 +354,7 @@ *(.data..do_once) \ STRUCT_ALIGN(); \ *(__tracepoints) \ - /* implement dynamic printk debug */ \ - . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + DYNDBG_SECTIONS() \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/scripts/module.lds.S b/scripts/module.lds.S index 054ef99e8288..8a7b0741bf8d 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -10,6 +10,7 @@ #endif =20 #include +#include =20 SECTIONS { /DISCARD/ : { @@ -60,6 +61,7 @@ SECTIONS { *(.rodata..L*) } =20 + MOD_DYNDBG_SECTIONS() MOD_SEPARATE_CODETAG_SECTIONS() } =20 --=20 2.53.0