All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Ingo Molnar <mingo@kernel.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	Petr Pavlu <petr.pavlu@suse.com>,
	Daniel Gomez <da.gomez@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] kernel.h: move VERIFY_OCTAL_PERMISSIONS() to sysfs.h
Date: Sun, 30 Nov 2025 12:42:35 -0500	[thread overview]
Message-ID: <aSyCC7TQoGgTn2rT@yury> (raw)
In-Reply-To: <e0d34a20-7547-4788-8449-95fcd5588434@infradead.org>

On Sat, Nov 29, 2025 at 10:19:29PM -0800, Randy Dunlap wrote:
> 
> 
> On 11/29/25 12:24 PM, Andy Shevchenko wrote:
> > On Sat, Nov 29, 2025 at 02:53:01PM -0500, Yury Norov (NVIDIA) wrote:
> >> The macro is related to sysfs, but is defined in kernel.h. Move it to
> >> the proper header, and unload the generic kernel.h.
> > 
> > Tough guy :-)
> > I hope it builds well in your case.
> > 
> > FWIW,
> > https://lore.kernel.org/lkml/20220603172101.49950-1-andriy.shevchenko@linux.intel.com/
> > https://lore.kernel.org/lkml/20240212115500.2078463-1-max.kellermann@ionos.com/
> > https://lore.kernel.org/lkml/20240215093646.3265823-1-max.kellermann@ionos.com/
> > 
> > Assuming it builds in allmodconfig, allyesconfig on x86_32/64 and arm/64
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> I don't build allyesconfigs any more (final? linking takes too long).
> It builds successfully for arm64 allmodconfig, arm allmodconfig,
> i386 allmodconfig, and x86_64 allmodconfig.
> 
> And the source files that use VERIFY_OCTAL_PERMISSIONS() all build successfully
> (which means that they possibly include <linux/sysfs.h> indirectly, i.e.,
> by luck). There aren't many of them, so I checked:
> 
> arch/arc/kernel/perf_event.c:	arc_pmu->attr[j].attr.attr.mode = VERIFY_OCTAL_PERMISSIONS(0444);
> INDIRECT
> drivers/edac/thunderx_edac.c:	.mode = VERIFY_OCTAL_PERMISSIONS(_mode),		    \
> INDIRECT
> drivers/media/platform/amphion/vpu_dbg.c:		    VERIFY_OCTAL_PERMISSIONS(0644),
> INDIRECT
> drivers/soc/aspeed/aspeed-uart-routing.c:	 .mode = VERIFY_OCTAL_PERMISSIONS(0644) },	\
> INDIRECT
> fs/xfs/xfs_error.c:		 .mode = VERIFY_OCTAL_PERMISSIONS(S_IWUSR | S_IRUGO) },	\
> INDIRECT
> include/linux/moduleparam.h:	    VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
> INDIRECT
> 
> so all of them got lucky. :)
> 
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks, Randy.

This series was tested by 0-day and LKP. 0-day runs allyesconfig, as
far as I know. It only sends email in case of errors. LKP is OK, find
the report below.

All but XFS include it via linux/module.h -> linux/moduleparam.h path.
XFS has a linkage layer: xfs.h -> xfs_linux.h-> linux/module.h, so
it's pretty much the same.

I think, module.h inclusion path is OK for this macro and definitely
better than kernel.h. Notice, none of them, except for vgpu_dbg,
include kernel.h directly.

Thanks,
Yury

tree/branch: https://github.com/norov/linux stack_magic
branch HEAD: d8dffbf7bce40e2fbfe077f9c9f4a3471786666f  tracing: move tracing declarations from kernel.h to a dedicated header

elapsed time: 1669m

configs tested: 103
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alpha                   allnoconfig    gcc-15.1.0
alpha                     defconfig    gcc-15.1.0
arc                     allnoconfig    gcc-15.1.0
arc                       defconfig    gcc-15.1.0
arc         randconfig-001-20251128    gcc-8.5.0
arc         randconfig-002-20251128    gcc-15.1.0
arm                     allnoconfig    clang-22
arm           am200epdkit_defconfig    gcc-15.1.0
arm             aspeed_g5_defconfig    gcc-15.1.0
arm         randconfig-001-20251128    gcc-14.3.0
arm         randconfig-002-20251128    gcc-8.5.0
arm         randconfig-003-20251128    clang-22
arm         randconfig-004-20251128    clang-17
arm               s3c6400_defconfig    gcc-15.1.0
arm                 u8500_defconfig    gcc-15.1.0
arm64                   allnoconfig    gcc-15.1.0
arm64       randconfig-001-20251129    clang-22
arm64       randconfig-002-20251129    clang-22
arm64       randconfig-003-20251129    gcc-8.5.0
arm64       randconfig-004-20251129    clang-22
csky                    allnoconfig    gcc-15.1.0
csky        randconfig-001-20251129    gcc-15.1.0
csky        randconfig-002-20251129    gcc-15.1.0
hexagon                 allnoconfig    clang-22
hexagon     randconfig-001-20251129    clang-22
hexagon     randconfig-002-20251129    clang-22
i386                    allnoconfig    gcc-14
i386        randconfig-001-20251129    gcc-14
i386        randconfig-002-20251129    gcc-12
i386        randconfig-003-20251129    clang-20
i386        randconfig-004-20251129    gcc-14
i386        randconfig-005-20251129    clang-20
i386        randconfig-006-20251129    clang-20
i386        randconfig-007-20251129    gcc-14
i386        randconfig-011-20251129    clang-20
i386        randconfig-012-20251129    gcc-13
i386        randconfig-013-20251129    clang-20
i386        randconfig-014-20251129    clang-20
i386        randconfig-015-20251129    gcc-14
loongarch               allnoconfig    clang-22
loongarch                 defconfig    clang-19
loongarch   randconfig-001-20251129    gcc-15.1.0
loongarch   randconfig-002-20251129    gcc-14.3.0
m68k                    allnoconfig    gcc-15.1.0
m68k                      defconfig    gcc-15.1.0
microblaze              allnoconfig    gcc-15.1.0
microblaze                defconfig    gcc-15.1.0
mips                    allnoconfig    gcc-15.1.0
nios2                   allnoconfig    gcc-11.5.0
nios2                     defconfig    gcc-11.5.0
nios2       randconfig-001-20251129    gcc-11.5.0
nios2       randconfig-002-20251129    gcc-11.5.0
openrisc                allnoconfig    gcc-15.1.0
openrisc                  defconfig    gcc-15.1.0
parisc                  allnoconfig    gcc-15.1.0
parisc                    defconfig    gcc-15.1.0
parisc      generic-64bit_defconfig    gcc-15.1.0
parisc      randconfig-001-20251128    gcc-14.3.0
parisc      randconfig-002-20251128    gcc-15.1.0
parisc64                  defconfig    gcc-15.1.0
powerpc                 allnoconfig    gcc-15.1.0
powerpc            pcm030_defconfig    clang-22
powerpc     randconfig-001-20251128    gcc-11.5.0
powerpc     randconfig-002-20251128    clang-22
powerpc64   randconfig-001-20251128    clang-22
powerpc64   randconfig-002-20251128    gcc-8.5.0
riscv                   allnoconfig    gcc-15.1.0
riscv                     defconfig    clang-22
s390                    allnoconfig    clang-22
s390                      defconfig    clang-22
sh                      allnoconfig    gcc-15.1.0
sh                        defconfig    gcc-15.1.0
sparc                   allnoconfig    gcc-15.1.0
sparc                     defconfig    gcc-15.1.0
sparc       randconfig-001-20251129    gcc-8.5.0
sparc       randconfig-002-20251129    gcc-8.5.0
sparc64                   defconfig    clang-20
sparc64     randconfig-001-20251129    gcc-8.5.0
sparc64     randconfig-002-20251129    gcc-14.3.0
um                      allnoconfig    clang-22
um                        defconfig    clang-22
um                   i386_defconfig    gcc-14
um          randconfig-001-20251129    clang-22
um          randconfig-002-20251129    gcc-14
um                 x86_64_defconfig    clang-22
x86_64                  allnoconfig    clang-20
x86_64                    defconfig    gcc-14
x86_64      randconfig-011-20251129    gcc-14
x86_64      randconfig-012-20251129    gcc-14
x86_64      randconfig-013-20251129    gcc-14
x86_64      randconfig-014-20251129    clang-20
x86_64      randconfig-015-20251129    gcc-12
x86_64      randconfig-016-20251129    clang-20
x86_64      randconfig-071-20251129    gcc-14
x86_64      randconfig-072-20251129    clang-20
x86_64      randconfig-073-20251129    gcc-14
x86_64      randconfig-074-20251129    gcc-12
x86_64      randconfig-075-20251129    gcc-14
x86_64      randconfig-076-20251129    gcc-14
xtensa                  allnoconfig    gcc-15.1.0
xtensa      randconfig-001-20251129    gcc-10.5.0
xtensa      randconfig-002-20251129    gcc-14.3.0
xtensa          xip_kc705_defconfig    gcc-15.1.0

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2025-11-30 17:42 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-29 19:52 [PATCH 0/3] Unload linux/kernel.h Yury Norov (NVIDIA)
2025-11-29 19:53 ` [PATCH 1/3] kernel.h: drop STACK_MAGIC macro Yury Norov (NVIDIA)
2025-11-29 20:32   ` Andy Shevchenko
2025-11-29 23:40     ` Randy Dunlap
2025-12-01  7:46   ` Jani Nikula
2025-12-02 20:58     ` Andi Shyti
2025-12-02 21:18       ` Yury Norov
2025-12-03  7:40         ` Jani Nikula
2025-12-01  9:38   ` Christophe Leroy (CS GROUP)
2025-12-02  2:50     ` Yury Norov
2025-12-02  7:37       ` Andy Shevchenko
2025-11-29 19:53 ` [PATCH 2/3] kernel.h: move VERIFY_OCTAL_PERMISSIONS() to sysfs.h Yury Norov (NVIDIA)
2025-11-29 20:24   ` Andy Shevchenko
2025-11-29 20:33     ` Andy Shevchenko
2025-11-29 20:35       ` Andy Shevchenko
2025-11-30 17:56         ` Yury Norov
2025-11-30 19:35           ` Andy Shevchenko
2025-11-30  6:19     ` Randy Dunlap
2025-11-30 17:42       ` Yury Norov [this message]
2025-11-30 19:38         ` Andy Shevchenko
2025-12-01 19:51           ` Randy Dunlap
2025-12-01 20:00             ` Andy Shevchenko
2025-11-30 18:27     ` Yury Norov
2025-11-30 19:42       ` Andy Shevchenko
2025-12-01 19:01   ` Petr Pavlu
2025-12-01 19:20     ` Andy Shevchenko
2025-11-29 19:53 ` [PATCH 3/3] tracing: move tracing declarations from kernel.h to a dedicated header Yury Norov (NVIDIA)
2025-11-29 20:30   ` Andy Shevchenko
2025-11-30 18:16     ` Yury Norov
2025-11-30 19:44       ` Andy Shevchenko
2025-11-30 20:36         ` Steven Rostedt
2025-11-30 23:09         ` david laight
2025-12-01  2:50           ` Andy Shevchenko
2025-12-01 10:16             ` david laight
2025-12-01 15:37               ` Andy Shevchenko
2025-11-30 20:34   ` Steven Rostedt
2025-11-29 20:02 ` ✗ LGCI.VerificationFailed: failure for Unload linux/kernel.h Patchwork
2025-11-30 18:01 ` ✗ LGCI.VerificationFailed: failure for Unload linux/kernel.h (rev2) Patchwork

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=aSyCC7TQoGgTn2rT@yury \
    --to=yury.norov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=da.gomez@kernel.org \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tursulin@ursulin.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.