From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (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 27655279346 for ; Sun, 30 Nov 2025 17:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764524558; cv=none; b=ZinqLAB/MUcTt6WyuCHzCcs19alEq/es2nL+Y5rJXWsOyNLfyjpjY0nBWIm6wHqWwXi37ypSgx4MbNsqdjD8q5/AL/+5TrAZHz485rsh60VrK+5zz2Zw5/PZOZxQfXhFEoyN9uBydJuvjnQBRgj/brlNKeDDuQ7/rae7HqthQuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764524558; c=relaxed/simple; bh=ww9ikFIpiXUdPQTUCZmroUB8VKRsFlgdLdW8JGR5FzA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YcwsK6t2MrsLD0DSyegDlP8zv2SBCPlLZVIU2//OlUmehku/CMzc0Ypb6s9Jd6i+1PqDNwcEDMgPwLWPQnJLe01Y9EmD+HD5l2mbwUCSMET/0xXH91q3iIHqWC8528CDyVwaRKe3Cr5lWC77o/FCU0EcWUqFTYiWnzkFIxvpSPQ= 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=BYpHH8Hq; arc=none smtp.client-ip=209.85.128.175 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="BYpHH8Hq" Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-787c9f90eccso34148047b3.3 for ; Sun, 30 Nov 2025 09:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764524556; x=1765129356; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=haLVYkWZOmKHtpHDbk/b7m3f6L/rKnHvLY96AT2R3kQ=; b=BYpHH8HqQRIphPXDuJ89DZwpZVzI0KLYP2udfHlr9LMIqU58Yef2B4HOMTtF8HuArD zgYXU3A5uFzWnzfB5qM37fQxI698LxSlWVxxl3Xlpu0nkSYM0EWWPvGxKsVhVHE29xeA 5vxkOaj68ub9yqfdDMLcY8ynjMGEtP6zC7uB3MqqZjD2xWRUiNcVke+sNuQO27rpp8Tw Zy89U9rejoBjhxTF/KN1XTSXYX0EiAfYUhzHL7aWDubsGSTcbLlVJcPm9B7hOnD9kFhG 3NBuSHUayXMJ5LZU4wLUwfF5E3hZALfr4GWdPQdrMUQyomTtEJJfPcMcdiFYT76/PF/J f1lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764524556; x=1765129356; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=haLVYkWZOmKHtpHDbk/b7m3f6L/rKnHvLY96AT2R3kQ=; b=bVRDGoe4gNmn7qDZSCjBsGl0A6qftTl/lVWfRhJuf0m7HgC5CqNOYJDQWnNdx5F8bs 3pR/5hkgHYw1rq0tzNwVbSimJ5ePiZdKWORW18Zro0yxIqx0bZvaU8WIHtd/vL+GeCHe sqVM0H0bjKkhe6387E11VTewmmqFJEgyS19oV9zvcjZDZd1mvs81JT5i4CyvKYIO9sZU YdPhoB69CwQcr8Sf00hnFCFD1iAwZdeBYiVwyNqfTQlu7HdD/hxPSLwFDgAd0Fhu+5sF Kf3yWUPLF6I8jKkh/d7pE6BADzXkWgM6n6LXbCJ8Lv5QhaxNgqH0D1S7J+JhE209LATl 7ImQ== X-Forwarded-Encrypted: i=1; AJvYcCWUyWTj4DxNqLF3x8PF84ShKsuROjNw4PdUaUkOQesj+BKaINI32XOmW3Uk8/GmYIMoEC0Q4miUjYnmEtw=@vger.kernel.org X-Gm-Message-State: AOJu0YxmM58zHVqFsElLx/m5UlBFDiNM+WmXUQB198HGz9OjsnpaKNt9 99KaZ00KbqcisMzHEU5HMvIao+M5o8PgxPdI55YaaZ2ygcSxzsKHBWGa X-Gm-Gg: ASbGnctFYRYh/kbFNtjw3tw/M2aX19WFDpYDokwRO4LPS/90sfW+z22A2F1pbIxh9sw 3J7rMBD7/jdZ1xK4ocy1NQw8r6ERXnhfX0HYHvJaY+dWLsQm1MJhnaFyYQbBpTl6Hpj0Bu2rwEh x+iy0lu/npIne2M1oFrK/E0glYbcq19yocJTjfzi7jMfhl1zmKu/Upw+REXmlEw4KShTXmwYhSG +YKiaR/8d2rZGCErF+KBo8H7Kiu0cBf21Dh2pdAkeNnszFK+zskC4PVCUFsSZ/GGC/xD38bauKF p59zmFAr9EcxpLpCGc0wZ2Xi+rU2k7Gpzn3yMDYO20Uuhnj3NSkjjTPt9JPgYr4h4R/7/SgMfeq BNFq/aSCBJgArYrFYUMS1VT3sjYIqio9GFqEaOt9amdgbj7qS977HNa9OzTd3Gtn2pVG/qL2qdz A7g5BAZoU= X-Google-Smtp-Source: AGHT+IGF0tX2hZjw3AGlknQ4v+/l0LWFo5zB2gFptAlJjQKMRQgk4Vh85OcdRysXZbzgzlA3JZDqcQ== X-Received: by 2002:a05:690e:14c4:b0:63f:b2ca:80e1 with SMTP id 956f58d0204a3-6432913f51dmr15585557d50.0.1764524555929; Sun, 30 Nov 2025 09:42:35 -0800 (PST) Received: from localhost ([2601:346:0:79bd:b42b:4ad9:10af:cabc]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-6433c443ce5sm3870009d50.12.2025.11.30.09.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Nov 2025 09:42:35 -0800 (PST) Date: Sun, 30 Nov 2025 12:42:35 -0500 From: Yury Norov To: Randy Dunlap Cc: Andy Shevchenko , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Ingo Molnar , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Petr Pavlu , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Andrew Morton , 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 Message-ID: References: <20251129195304.204082-1-yury.norov@gmail.com> <20251129195304.204082-3-yury.norov@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: 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 > > 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 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 > Tested-by: Randy Dunlap 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