From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (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 5F26A242D89 for ; Wed, 8 Apr 2026 20:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775678539; cv=none; b=qB6a+8oXNUNNhxvc0CKKZhRMARWfk2FbP6XNmTlnXBUCzzBvLdV6lnN1LC0tE/GqH7DDoa4xIkYgedOkjFujEKCZHLdlyEVewaqtZTE+93QV8M4NSMArZdug5XSRS1hFuVArdSZTHXmi2V8gCCXuk4Q7TLKChdwa2aUiqQQZ+Fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775678539; c=relaxed/simple; bh=aUUpyLWsmosxz7+XufeZW94ZtVFGdezehO6+FZ/lqds=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=bQszRKbWzrP+JufnoMLsjwo1wHIlg7RB4Fget3k2q3rjrz+Sdovi7FWl8T7EVqvHEGfz611uOdofeypsX3iro2pMBvvv9JP+XhS+kXxDid6YtFSjHFXmXbvc8nViaJ+ydEPfndGcnLjbFkXGiBPbvJYc8XEzRnZorg0HFYG0y60= 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=UjP3n95V; arc=none smtp.client-ip=209.85.161.45 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="UjP3n95V" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-662f30d3f1fso84690eaf.1 for ; Wed, 08 Apr 2026 13:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775678537; x=1776283337; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7YCa6qyon9vQny9Ddi5Tfr93w1T71zjmLsObQE2ityk=; b=UjP3n95V9pE4pe7EROboaYmInQJkYXLogQdpJIWAgHRVd/GM3fe4zZhpE2Fd5fASZc MGe6mAUy7cuEbIqvV7yFRTNqpFRYfzkYOVRv3KWziiaRahjAFFiDSZPI+8ST0LNo/cKx CSZO+p92vEKMmi+Gka+AIj86xdDrMszDddSlqUStsmF3JMOjI4AkrB59AmNHdIH0R234 LeZC+INyngJqGL2ZCsw6eM4UVDaJS1lu+FNBo74mHTxW2QTktOzEburQ7r/DDfiNf6Pt DaNlGAo9izYxkiNMSOfhEOobIeW7V7SBXs9ub98Duue9G8QgsIMLlEYTpHNL0GAriVn3 id1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775678537; x=1776283337; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7YCa6qyon9vQny9Ddi5Tfr93w1T71zjmLsObQE2ityk=; b=pAKj8GUeaskNmFEamd2ddsFMu91be0Y1iXADd4gzXQGSNepoEMUJ9tNEGZck0mYrsk 0CL9Nzth8Z98qH4CyzRJeEIlTUXtjBdkKYAqneD3F6qORkkmgVesalHDhZRreuFtsZY6 qJf8z2IDogH+N72yrEZsgoKFkMWQpsYttzUXkYBr5jj3B0n4MqbqXQevwFJeJjMdV7tU fv44SZy8A1KmkXdzhP5bx0BV8fc6FeN7sOdLprAMUqbS6zwoy0onaFapC3YTgrIcQZ9T jac/p5w6EsRH11gljzjBC5ytu/4xcm3ZlMNbf2SOcCjbAEicN8TWhU2e0pEJ6gjxqBAJ xJbA== X-Gm-Message-State: AOJu0YwAm7D92mIQlLgCuud8L+Y8s2Wu1bThfHgv1f2Bzx8XAMxFtmZp gV+BbqNm9ClDJm4JHp/fAdvy9OXmc7q+i+OVBu3a9MbIHfLPdwZUS8eluRSdqg== X-Gm-Gg: AeBDievzWHQPwWEnK4u1OJ7brKXWhqabepsVjp61Vf4TOwz7+7Q9Xsla9MOZnM0cmlp Ptfs5w4SyeQr9SIGg0MNjV5Fl4Ox6JCgA/Sf3L5x1pkWG6qnttAjwR+bOFk1G784Qxlroi51V4u Rxl2ELDsk0jfhQMQLHMQhGXMxQ3GiXvDJtYNDLOY+j4NDnsrS5VORWZ8GqcLVwmgIo6M4ME9YAx URr4izRoMIR54s380h09yNcH5Hmi1ad0qs66vi4QH0lyMcvVeSErA0685k4LMWYWn2pujj87oeC wpWpE18NrbMfOWrj3X99sBtO4Rvm8y3O4jU9E1fqSQNgW69/vALYmQGr6q5UUOYlUBVauEMfhyd HlpQDahM2DGHIk7+PbQfXPc2cOwrPpGSQvmh5RFR3xhYeAC0tgh0xpsIXLKUC+6UQhJmG2TPhVq LQmgtYQiQnQ1V2oKp1KwGbTItqtuRTop0W5X/y0MCmmJFhjoAbk64vaxFSK2zX4fvKgXNh9aSGB Z0= X-Received: by 2002:a4a:e90a:0:b0:67c:28d6:430e with SMTP id 006d021491bc7-68a6bb1c3acmr402313eaf.28.1775678536870; Wed, 08 Apr 2026 13:02:16 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 006d021491bc7-680a63c7fd1sm12254208eaf.8.2026.04.08.13.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 13:02:16 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, jbaron@akamai.com, louis.chauvet@bootlin.com, Jim Cromie Subject: [PATCH v13 00/36] fix dynamic-debug classmaps regression for DRM Date: Wed, 8 Apr 2026 14:01:35 -0600 Message-ID: <20260408200211.43821-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dynamic-debug classmaps in master is BROKEN for DRM, due to a design error in DECLARE_DYNAMIC_DEBUG_ClASSMAP; its use in both drm-core and drivers made multiple/redundant definitions of the classmap. This led to a regression enabling drm.debug at boot, on builtin drivers. This patchset retires the macro, and replaces it with DYNAMIC_DEBUG_ClASSMAP_DEFINE and DYNAMIC_DEBUG_ClASSMAP_USE. 1st is invoked in drm-core, and defines the classmap, 2nd refers to that exported definition, and is used in drivers and drm-helpers. -v13 is a basically a -v12-resend, but: 1. Drops DRM's use of the new API; it can adopt them on its schedule. IOW it omits the 1-liner calls to DYNAMIC_DEBUG_CLASSMAP_USE(). and a few other patches. 2. rewords 2 macro-invokes to verify validations on bad API uses. changed to better explain what is being tested and prevented. these are inactive unless compiled with -DDD_MACRO_ARGCHECK 3. includes patch from Philip Hahn to fix pr_fmt with 2+ terms this was also in v12. -v12 https://lore.kernel.org/lkml/20260326185413.1205870-1-jim.cromie@gmail.com/ had: vmlinux.lds.h is refactored: - BOUNDED_SECTION* macros are pulled into bounded_section.lds.h - dynamic-debug sections are factored into dyndbg.lds.h, which reuses bounded_section.lds.h - scripts/module.lds.S gets proper output sections for dyndbg this fixes lost sections seen in some setups - based upon codetag.lds.h DYNAMIC_DEBUG_CLASSMAP_USE*() is refined: - previous had static class-map decl and unique names - now have extern'd - names, matching 1-per-module model - now with compile-time offset check - _USE/_USE_ together allows more squashing better modprobe-time classmap definition error detection: - test descriptors for unknown class-names - more complete class-map/user conflict detection rebased onto -rc5 - applies cleanly to drm-misc-fixes - passes a few more tests on DRM-CI include patch from Philipp Hahn clean subsystem chunks - dyndbg 1st - drm - fixes for DRM-CI, adapt,use new API, un-BROKEN - drm/accel - least mature, I have no HW -v11 is here https://lore.kernel.org/lkml/20260313132103.2529746-1-jim.cromie@gmail.com/ Jim Cromie (35): dyndbg: fix NULL ptr on i386 due to section mis-alignment vmlinux.lds.h: move BOUNDED_SECTION_* macros to reuse later dyndbg.lds.S: fix lost dyndbg sections in modules vmlinux.lds.h: drop unused HEADERED_SECTION* macros dyndbg: factor ddebug_match_desc out from ddebug_change dyndbg: add stub macro for DECLARE_DYNDBG_CLASSMAP docs/dyndbg: update examples \012 to \n docs/dyndbg: explain flags parse 1st test-dyndbg: fixup CLASSMAP usage error dyndbg: reword "class unknown," to "class:_UNKNOWN_" dyndbg: make ddebug_class_param union members same size dyndbg: drop NUM_TYPE_ARRAY dyndbg: tweak pr_fmt to avoid expansion conflicts dyndbg: reduce verbose/debug clutter dyndbg: refactor param_set_dyndbg_classes and below dyndbg: tighten fn-sig of ddebug_apply_class_bitmap dyndbg: replace classmap list with a vector dyndbg: macrofy a 2-index for-loop pattern dyndbg,module: make proper substructs in _ddebug_info dyndbg: move mod_name down from struct ddebug_table to _ddebug_info dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code selftests-dyndbg: add a dynamic_debug run_tests target dyndbg: change __dynamic_func_call_cls* macros into expressions dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP dyndbg: detect class_id reservation conflicts dyndbg: check DYNAMIC_DEBUG_CLASSMAP_{DEFINE,USE_} args at compile-time dyndbg-test: change do_prints testpoint to accept a loopct dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API dyndbg: treat comma as a token separator dyndbg: split multi-query strings with % selftests-dyndbg: add test_mod_submod dyndbg: resolve "protection" of class'd pr_debug dyndbg: harden classmap and descriptor validation docs/dyndbg: add classmap info to howto Philipp Hahn (1): dyndbg: Ignore additional arguments from pr_fmt .../admin-guide/dynamic-debug-howto.rst | 184 +++- MAINTAINERS | 3 +- include/asm-generic/bounded_sections.lds.h | 21 + include/asm-generic/dyndbg.lds.h | 26 + include/asm-generic/vmlinux.lds.h | 48 +- include/linux/dynamic_debug.h | 309 +++++-- kernel/module/main.c | 15 +- lib/Kconfig.debug | 24 +- lib/Makefile | 5 + lib/dynamic_debug.c | 831 ++++++++++++------ lib/test_dynamic_debug.c | 211 +++-- lib/test_dynamic_debug_submod.c | 21 + scripts/module.lds.S | 2 + tools/testing/selftests/Makefile | 1 + .../testing/selftests/dynamic_debug/Makefile | 9 + tools/testing/selftests/dynamic_debug/config | 7 + .../dynamic_debug/dyndbg_selftest.sh | 373 ++++++++ 17 files changed, 1595 insertions(+), 495 deletions(-) create mode 100644 include/asm-generic/bounded_sections.lds.h create mode 100644 include/asm-generic/dyndbg.lds.h create mode 100644 lib/test_dynamic_debug_submod.c create mode 100644 tools/testing/selftests/dynamic_debug/Makefile create mode 100644 tools/testing/selftests/dynamic_debug/config create mode 100755 tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh -- 2.53.0