From Dave.Martin at arm.com Tue Jul 1 06:55:53 2025 From: Dave.Martin at arm.com (Dave Martin) Date: Tue, 1 Jul 2025 14:55:53 +0100 Subject: [PATCH 00/23] binfmt_elf,arch/*: Use elf.h for coredump note names Message-ID: <20250701135616.29630-1-Dave.Martin@arm.com> This series aims to clean up an aspect of coredump generation: ELF coredumps contain a set of notes describing the state of machine registers and other information about the dumped process. Notes are identified by a numeric identifier n_type and a "name" string, although this terminology is somewhat misleading. Officially, the "name" of a note is really an "originator" or namespace identifier that indicates how to interpret n_type [1], although in practice it is often used more loosely. Either way, each kind of note needs _both_ a specific "name" string and a specific n_type to identify it robustly. To centralise this knowledge in one place and avoid the need for ad-hoc code to guess the correct name for a given note, commit 7da8e4ad4df0 ("elf: Define note name macros") [2] added an explicit NN_ #define in elf.h to give the name corresponding to each named note type NT_. Now that the note name for each note is specified explicitly, the remaining guesswork for determining the note name for common and arch-specific regsets in ELF core dumps can be eliminated. This series aims to do just that: * Patch 2 adds a user_regset field to specify the note name, and a helper macro to populate it correctly alongside the note type. * Patch 3 ports away the ad-hoc note names in the common coredump code. * Patches 4-22 make the arch-specific changes. (This is pretty mechanical for most arches.) * The final patch adds a WARN() when no note name is specified, and simplifies the fallback guess. This should only be applied when all arches have ported across. See the individual patches for details. Testing: * x86, arm64: Booted in a VM and triggered a core dump with no WARN(), and verified that the dumped notes are the same. * arm: Build-tested only (for now). * Other arches: not tested yet Any help with testing is appreciated. If the following generates the same notes (as dumped by readelf -n core) and doesn't trigger a WARN, then we are probably good. $ sleep 60 & $ kill -QUIT $! (Register content might differ between runs, but it should be safe to ignore that -- this series only deals with the note names and types.) Cheers ---Dave [1] System V Application Binary Interface, Edition 4.1, Section 5 (Program Loading and Dynamic Linking) -> "Note Section" https://refspecs.linuxfoundation.org/elf/gabi41.pdf [2] elf: Define note name macros https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/uapi/linux/elf.h?id=7da8e4ad4df0dd12f37357af62ce1b63e75ae2e6 Dave Martin (23): regset: Fix kerneldoc for struct regset_get() in user_regset regset: Add explicit core note name in struct user_regset binfmt_elf: Dump non-arch notes with strictly matching name and type ARC: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names ARM: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names arm64: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names csky: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names hexagon: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names LoongArch: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names m68k: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names MIPS: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names nios2: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names openrisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names parisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names powerpc/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names riscv: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names s390/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names sh: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names sparc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names x86/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names um: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names xtensa: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names binfmt_elf: Warn on missing or suspicious regset note names arch/arc/kernel/ptrace.c | 4 +- arch/arm/kernel/ptrace.c | 6 +- arch/arm64/kernel/ptrace.c | 52 ++++++++--------- arch/csky/kernel/ptrace.c | 4 +- arch/hexagon/kernel/ptrace.c | 2 +- arch/loongarch/kernel/ptrace.c | 16 ++--- arch/m68k/kernel/ptrace.c | 4 +- arch/mips/kernel/ptrace.c | 20 +++---- arch/nios2/kernel/ptrace.c | 2 +- arch/openrisc/kernel/ptrace.c | 4 +- arch/parisc/kernel/ptrace.c | 8 +-- arch/powerpc/kernel/ptrace/ptrace-view.c | 74 ++++++++++++------------ arch/riscv/kernel/ptrace.c | 12 ++-- arch/s390/kernel/ptrace.c | 42 +++++++------- arch/sh/kernel/ptrace_32.c | 4 +- arch/sparc/kernel/ptrace_32.c | 4 +- arch/sparc/kernel/ptrace_64.c | 8 +-- arch/x86/kernel/ptrace.c | 22 +++---- arch/x86/um/ptrace.c | 10 ++-- arch/xtensa/kernel/ptrace.c | 4 +- fs/binfmt_elf.c | 36 +++++++----- fs/binfmt_elf_fdpic.c | 17 +++--- include/linux/regset.h | 12 +++- 23 files changed, 194 insertions(+), 173 deletions(-) base-commit: 86731a2a651e58953fc949573895f2fa6d456841 -- 2.34.1 From Dave.Martin at arm.com Tue Jul 1 06:55:57 2025 From: Dave.Martin at arm.com (Dave Martin) Date: Tue, 1 Jul 2025 14:55:57 +0100 Subject: [PATCH 04/23] ARC: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names In-Reply-To: <20250701135616.29630-1-Dave.Martin@arm.com> References: <20250701135616.29630-1-Dave.Martin@arm.com> Message-ID: <20250701135616.29630-5-Dave.Martin@arm.com> Instead of having the core code guess the note name for each regset, use USER_REGSET_NOTE_TYPE() to pick the correct name from elf.h. Signed-off-by: Dave Martin Cc: Vineet Gupta Cc: Oleg Nesterov Cc: Kees Cook Cc: Akihiko Odaki Cc: linux-snps-arc at lists.infradead.org --- arch/arc/kernel/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arc/kernel/ptrace.c b/arch/arc/kernel/ptrace.c index e0c233c178b1..cad5367b7c37 100644 --- a/arch/arc/kernel/ptrace.c +++ b/arch/arc/kernel/ptrace.c @@ -284,7 +284,7 @@ enum arc_getset { static const struct user_regset arc_regsets[] = { [REGSET_CMN] = { - .core_note_type = NT_PRSTATUS, + USER_REGSET_NOTE_TYPE(PRSTATUS), .n = ELF_NGREG, .size = sizeof(unsigned long), .align = sizeof(unsigned long), @@ -293,7 +293,7 @@ static const struct user_regset arc_regsets[] = { }, #ifdef CONFIG_ISA_ARCV2 [REGSET_ARCV2] = { - .core_note_type = NT_ARC_V2, + USER_REGSET_NOTE_TYPE(ARC_V2), .n = ELF_ARCV2REG, .size = sizeof(unsigned long), .align = sizeof(unsigned long), -- 2.34.1 From adam.drzewiecki at successa.pl Wed Jul 2 01:16:09 2025 From: adam.drzewiecki at successa.pl (Adam Drzewiecki) Date: Wed, 2 Jul 2025 08:16:09 GMT Subject: =?UTF-8?Q?Pytanie_o_samoch=C3=B3d_?= Message-ID: <20250702084501-0.1.j4.20n8o.0.pad2z17vp3@successa.pl> Dzie? dobry, Czy interesuje Pa?stwa rozwi?zanie umo?liwiaj?ce monitorowanie samochod?w firmowych oraz optymalizacj? koszt?w ich utrzymania? Pozdrawiam Adam Drzewiecki From braker.noob.kernel at gmail.com Sat Jul 5 00:30:44 2025 From: braker.noob.kernel at gmail.com (Rujra Bhatt) Date: Sat, 5 Jul 2025 13:00:44 +0530 Subject: [PATCH] arc:kernel:perf_event.c : replaced sprintf with sysfs_emit() Message-ID: Replaced sprintf() with sysfs_emit() in sysfs*_show() function in perf_event.c file to follow the kernel's guidlines from documentation/filesystems/sysfs.rst This will improve consistency, safety, and makes it easier to maintain and update in future. Signed-off-by: Rujra Bhatt --- arch/arc/kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index ed6d4f0cd621..424ec072c441 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c @@ -648,7 +648,7 @@ static ssize_t arc_pmu_events_sysfs_show(struct device *dev, struct perf_pmu_events_attr *pmu_attr; pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); - return sprintf(page, "event=0x%04llx\n", pmu_attr->id); + return sysfs_emit(page, "event=0x%04llx\n", pmu_attr->id); } /* -- 2.43.0 From marek.kucharski at fundixo.pl Tue Jul 8 00:45:42 2025 From: marek.kucharski at fundixo.pl (Marek Kucharski) Date: Tue, 8 Jul 2025 07:45:42 GMT Subject: =?UTF-8?Q?Prosz=C4=99_o_kontakt?= Message-ID: <20250708084500-0.1.gb.3chkv.0.rkpq0zac7y@CyberCitadel.pl> Dzie? dobry, Czy jest mo?liwo?? nawi?zania wsp??pracy z Pa?stwem? Z ch?ci? porozmawiam z osob? zajmuj?c? si? dzia?aniami zwi?zanymi ze sprzeda??. Pomagamy skutecznie pozyskiwa? nowych klient?w. Zapraszam do kontaktu. Pozdrawiam Marek Kucharski From odaki at rsg.ci.i.u-tokyo.ac.jp Tue Jul 8 22:05:53 2025 From: odaki at rsg.ci.i.u-tokyo.ac.jp (Akihiko Odaki) Date: Wed, 9 Jul 2025 14:05:53 +0900 Subject: [PATCH 00/23] binfmt_elf,arch/*: Use elf.h for coredump note names In-Reply-To: <20250701135616.29630-1-Dave.Martin@arm.com> References: <20250701135616.29630-1-Dave.Martin@arm.com> Message-ID: <36c0213c-6b14-4ad2-969e-3d8e356bb680@rsg.ci.i.u-tokyo.ac.jp> On 2025/07/01 22:55, Dave Martin wrote: > This series aims to clean up an aspect of coredump generation: > > ELF coredumps contain a set of notes describing the state of machine > registers and other information about the dumped process. > > Notes are identified by a numeric identifier n_type and a "name" > string, although this terminology is somewhat misleading. Officially, > the "name" of a note is really an "originator" or namespace identifier > that indicates how to interpret n_type [1], although in practice it is > often used more loosely. > > Either way, each kind of note needs _both_ a specific "name" string and > a specific n_type to identify it robustly. > > To centralise this knowledge in one place and avoid the need for ad-hoc > code to guess the correct name for a given note, commit 7da8e4ad4df0 > ("elf: Define note name macros") [2] added an explicit NN_ #define > in elf.h to give the name corresponding to each named note type > NT_. > > Now that the note name for each note is specified explicitly, the > remaining guesswork for determining the note name for common and > arch-specific regsets in ELF core dumps can be eliminated. > > This series aims to do just that: > > * Patch 2 adds a user_regset field to specify the note name, and a > helper macro to populate it correctly alongside the note type. > > * Patch 3 ports away the ad-hoc note names in the common coredump > code. > > * Patches 4-22 make the arch-specific changes. (This is pretty > mechanical for most arches.) > > * The final patch adds a WARN() when no note name is specified, > and simplifies the fallback guess. This should only be applied > when all arches have ported across. > > See the individual patches for details. > > > Testing: > > * x86, arm64: Booted in a VM and triggered a core dump with no WARN(), > and verified that the dumped notes are the same. > > * arm: Build-tested only (for now). > > * Other arches: not tested yet > > Any help with testing is appreciated. If the following generates the > same notes (as dumped by readelf -n core) and doesn't trigger a WARN, > then we are probably good. > > $ sleep 60 & > $ kill -QUIT $! > > (Register content might differ between runs, but it should be safe to > ignore that -- this series only deals with the note names and types.) > > Cheers > ---Dave > > > [1] System V Application Binary Interface, Edition 4.1, > Section 5 (Program Loading and Dynamic Linking) -> "Note Section" > > https://refspecs.linuxfoundation.org/elf/gabi41.pdf > > [2] elf: Define note name macros > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/uapi/linux/elf.h?id=7da8e4ad4df0dd12f37357af62ce1b63e75ae2e6 > > > Dave Martin (23): > regset: Fix kerneldoc for struct regset_get() in user_regset > regset: Add explicit core note name in struct user_regset > binfmt_elf: Dump non-arch notes with strictly matching name and type > ARC: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > ARM: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > arm64: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > csky: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > hexagon: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > LoongArch: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > m68k: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > MIPS: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > nios2: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > openrisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > parisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > powerpc/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > riscv: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > s390/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > sh: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > sparc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > x86/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > um: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names > xtensa: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note > names > binfmt_elf: Warn on missing or suspicious regset note names > > arch/arc/kernel/ptrace.c | 4 +- > arch/arm/kernel/ptrace.c | 6 +- > arch/arm64/kernel/ptrace.c | 52 ++++++++--------- > arch/csky/kernel/ptrace.c | 4 +- > arch/hexagon/kernel/ptrace.c | 2 +- > arch/loongarch/kernel/ptrace.c | 16 ++--- > arch/m68k/kernel/ptrace.c | 4 +- > arch/mips/kernel/ptrace.c | 20 +++---- > arch/nios2/kernel/ptrace.c | 2 +- > arch/openrisc/kernel/ptrace.c | 4 +- > arch/parisc/kernel/ptrace.c | 8 +-- > arch/powerpc/kernel/ptrace/ptrace-view.c | 74 ++++++++++++------------ > arch/riscv/kernel/ptrace.c | 12 ++-- > arch/s390/kernel/ptrace.c | 42 +++++++------- > arch/sh/kernel/ptrace_32.c | 4 +- > arch/sparc/kernel/ptrace_32.c | 4 +- > arch/sparc/kernel/ptrace_64.c | 8 +-- > arch/x86/kernel/ptrace.c | 22 +++---- > arch/x86/um/ptrace.c | 10 ++-- > arch/xtensa/kernel/ptrace.c | 4 +- > fs/binfmt_elf.c | 36 +++++++----- > fs/binfmt_elf_fdpic.c | 17 +++--- > include/linux/regset.h | 12 +++- > 23 files changed, 194 insertions(+), 173 deletions(-) > > > base-commit: 86731a2a651e58953fc949573895f2fa6d456841 For the whole series: Reviewed-by: Akihiko Odaki Regards, Akihiko Odaki From wiktoria.bielaszka at bizovo.pl Wed Jul 9 00:31:04 2025 From: wiktoria.bielaszka at bizovo.pl (Wiktoria Bielaszka) Date: Wed, 9 Jul 2025 07:31:04 GMT Subject: =?UTF-8?Q?Zamro=C5=BCenie_ceny_energii?= Message-ID: <20250709084500-0.1.8v.19dga.0.7qu4bfj5fl@bizovo.pl> Dzie? dobry, czy planuj? Pa?stwo optymalizacj? koszt?w energii elektrycznej w swojej firmie? Chcieliby?my przedstawi? nasz? ofert? XPOT, kt?ra mo?e przynie?? znacz?ce oszcz?dno?ci. Ju? od teraz, mog? Pa?stwo uzyska? cen? ni?sz? o 40,9% w stosunku do obecnej ceny ustawowej. Nasza propozycja obejmuje lata 2025 i 2026, a start wsp??pracy jest mo?liwy od zaraz. Gwarantujemy elastyczne warunki umowy (3-6-9-12 miesi?cy), zapewniaj?c minimum formalno?ci. Jeste?my pionierem w sprzeda?y energii w cenach RDN wed?ug TGE dla ka?dej grupy taryfowej. Przez ca?y okres trwania umowy zapewniamy Pa?stwu dedykowanego opiekuna, a ca?y proces Zmiany Sprzedawcy i wszelkie formalno?ci realizujemy za Klient?w. Ch?tnie porozmawiam o tym, jak mo?emy wsp?lnie zrealizowa? Pa?stwa cele energetyczne. Prosz? o wiadomo?? w przypadku zainteresowania. Z pozdrowieniami Wiktoria Bielaszka From kees at kernel.org Mon Jul 14 22:37:11 2025 From: kees at kernel.org (Kees Cook) Date: Mon, 14 Jul 2025 22:37:11 -0700 Subject: [PATCH 00/23] binfmt_elf,arch/*: Use elf.h for coredump note names In-Reply-To: <20250701135616.29630-1-Dave.Martin@arm.com> References: <20250701135616.29630-1-Dave.Martin@arm.com> Message-ID: <175255782864.3413694.2008555655056311560.b4-ty@kernel.org> On Tue, 01 Jul 2025 14:55:53 +0100, Dave Martin wrote: > This series aims to clean up an aspect of coredump generation: > > ELF coredumps contain a set of notes describing the state of machine > registers and other information about the dumped process. > > Notes are identified by a numeric identifier n_type and a "name" > string, although this terminology is somewhat misleading. Officially, > the "name" of a note is really an "originator" or namespace identifier > that indicates how to interpret n_type [1], although in practice it is > often used more loosely. > > [...] Applied to for-next/execve, thanks! [01/23] regset: Fix kerneldoc for struct regset_get() in user_regset https://git.kernel.org/kees/c/6fd9e1aa0784 [02/23] regset: Add explicit core note name in struct user_regset https://git.kernel.org/kees/c/85a7f9cbf8a8 [03/23] binfmt_elf: Dump non-arch notes with strictly matching name and type https://git.kernel.org/kees/c/9674a1be4dd5 [04/23] ARC: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/237dc8d79627 [05/23] ARM: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/49b849d11cd1 [06/23] arm64: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/87b0d081dc98 [07/23] csky: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/2c2fb861fc59 [08/23] hexagon: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/55821111b1b3 [09/23] LoongArch: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/1260e3b13584 [10/23] m68k: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/e572168e8d2a [11/23] MIPS: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/18bd88faa246 [12/23] nios2: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/8368cd0e4636 [13/23] openrisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/10cd957a895f [14/23] parisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/92acdd819b5d [15/23] powerpc/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/307035acefbd [16/23] riscv: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/c9502cc7bef5 [17/23] s390/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/d6a883cb40fc [18/23] sh: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/afe74eecd88f [19/23] sparc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/c9d4cb25e94e [20/23] x86/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/3de0414dec7b [21/23] um: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/40d3a88594b5 [22/23] xtensa: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names https://git.kernel.org/kees/c/cb32fb722f4b [23/23] binfmt_elf: Warn on missing or suspicious regset note names https://git.kernel.org/kees/c/a55128d392e8 Take care, -- Kees Cook From Dave.Martin at arm.com Tue Jul 15 03:32:47 2025 From: Dave.Martin at arm.com (Dave Martin) Date: Tue, 15 Jul 2025 11:32:47 +0100 Subject: [PATCH 00/23] binfmt_elf,arch/*: Use elf.h for coredump note names In-Reply-To: <175255782864.3413694.2008555655056311560.b4-ty@kernel.org> References: <20250701135616.29630-1-Dave.Martin@arm.com> <175255782864.3413694.2008555655056311560.b4-ty@kernel.org> Message-ID: On Mon, Jul 14, 2025 at 10:37:11PM -0700, Kees Cook wrote: > On Tue, 01 Jul 2025 14:55:53 +0100, Dave Martin wrote: > > This series aims to clean up an aspect of coredump generation: > > > > ELF coredumps contain a set of notes describing the state of machine > > registers and other information about the dumped process. > > > > Notes are identified by a numeric identifier n_type and a "name" > > string, although this terminology is somewhat misleading. Officially, > > the "name" of a note is really an "originator" or namespace identifier > > that indicates how to interpret n_type [1], although in practice it is > > often used more loosely. > > > > [...] > > Applied to for-next/execve, thanks! > > [01/23] regset: Fix kerneldoc for struct regset_get() in user_regset > https://git.kernel.org/kees/c/6fd9e1aa0784 [...] > [23/23] binfmt_elf: Warn on missing or suspicious regset note names > https://git.kernel.org/kees/c/a55128d392e8 > > Take care, > > -- > Kees Cook Thanks! Assuming nobody screams about things going wrong in next, I'll plan to water down the paranoid check in binfmt_elf.c:fill_thread_core_info(). Anyone copy-pasting a new arch after this is in mainline shouldn't fall foul of this. Cheers ---Dave From marek.kucharski at fundixo.pl Wed Jul 16 00:45:44 2025 From: marek.kucharski at fundixo.pl (Marek Kucharski) Date: Wed, 16 Jul 2025 07:45:44 GMT Subject: =?UTF-8?Q?Prosz=C4=99_o_kontakt?= Message-ID: <20250716084500-0.1.gh.3ffvd.0.n029m6ufrr@CyberCitadel.pl> Dzie? dobry, Czy jest mo?liwo?? nawi?zania wsp??pracy z Pa?stwem? Z ch?ci? porozmawiam z osob? zajmuj?c? si? dzia?aniami zwi?zanymi ze sprzeda??. Pomagamy skutecznie pozyskiwa? nowych klient?w. Zapraszam do kontaktu. Pozdrawiam Marek Kucharski From hpa at zytor.com Wed Jul 16 09:47:32 2025 From: hpa at zytor.com (H. Peter Anvin) Date: Wed, 16 Jul 2025 09:47:32 -0700 Subject: [PATCH 1/1] uapi/termios: remove struct ktermios from uapi headers Message-ID: <20250716164735.170713-1-hpa@zytor.com> struct ktermios is not, nor has it ever been, a UAPI. Remove it from the UAPI headers. Normally we have shadowed kernel-only headers that include the uapi ones; in this case this would be , however, I was unable to find a way by which *some* paths would still somehow pick up the UAPI header only (presumably due to the mix of arch-specific and asm-generic headers), so I separated out the kernel-specific parts into a new header . now has a kernel version, which only differs by including . Signed-off-by: H. Peter Anvin --- arch/alpha/include/asm/ktermios.h | 2 ++ arch/alpha/include/uapi/asm/termbits.h | 17 ++-------------- arch/arc/include/asm/ktermios.h | 1 + arch/arm/include/asm/ktermios.h | 1 + arch/arm64/include/asm/ktermios.h | 1 + arch/csky/include/asm/ktermios.h | 1 + arch/hexagon/include/asm/ktermios.h | 1 + arch/loongarch/include/asm/ktermios.h | 1 + arch/m68k/include/asm/ktermios.h | 1 + arch/microblaze/include/asm/ktermios.h | 1 + arch/mips/include/asm/ktermios.h | 1 + arch/mips/include/uapi/asm/termbits.h | 15 ++------------ arch/nios2/include/asm/ktermios.h | 1 + arch/openrisc/include/asm/ktermios.h | 1 + arch/parisc/include/asm/ktermios.h | 1 + arch/parisc/include/uapi/asm/termbits.h | 15 ++------------ arch/powerpc/include/asm/ktermios.h | 2 ++ arch/powerpc/include/uapi/asm/termbits.h | 13 ------------ arch/riscv/include/asm/ktermios.h | 1 + arch/s390/include/asm/ktermios.h | 1 + arch/sh/include/asm/ktermios.h | 1 + arch/sparc/include/asm/ktermios.h | 11 ++++++++++ arch/sparc/include/asm/termbits.h | 9 -------- arch/um/include/asm/ktermios.h | 1 + arch/x86/include/asm/ktermios.h | 1 + arch/xtensa/include/asm/ktermios.h | 1 + include/asm-generic/ktermios.h | 26 ++++++++++++++++++++++++ include/linux/termios.h | 7 +++++++ include/uapi/asm-generic/termbits.h | 15 ++------------ include/uapi/linux/termios.h | 4 ++-- 30 files changed, 76 insertions(+), 78 deletions(-) create mode 100644 arch/alpha/include/asm/ktermios.h create mode 100644 arch/arc/include/asm/ktermios.h create mode 100644 arch/arm/include/asm/ktermios.h create mode 100644 arch/arm64/include/asm/ktermios.h create mode 100644 arch/csky/include/asm/ktermios.h create mode 100644 arch/hexagon/include/asm/ktermios.h create mode 100644 arch/loongarch/include/asm/ktermios.h create mode 100644 arch/m68k/include/asm/ktermios.h create mode 100644 arch/microblaze/include/asm/ktermios.h create mode 100644 arch/mips/include/asm/ktermios.h create mode 100644 arch/nios2/include/asm/ktermios.h create mode 100644 arch/openrisc/include/asm/ktermios.h create mode 100644 arch/parisc/include/asm/ktermios.h create mode 100644 arch/powerpc/include/asm/ktermios.h create mode 100644 arch/riscv/include/asm/ktermios.h create mode 100644 arch/s390/include/asm/ktermios.h create mode 100644 arch/sh/include/asm/ktermios.h create mode 100644 arch/sparc/include/asm/ktermios.h delete mode 100644 arch/sparc/include/asm/termbits.h create mode 100644 arch/um/include/asm/ktermios.h create mode 100644 arch/x86/include/asm/ktermios.h create mode 100644 arch/xtensa/include/asm/ktermios.h create mode 100644 include/asm-generic/ktermios.h create mode 100644 include/linux/termios.h diff --git a/arch/alpha/include/asm/ktermios.h b/arch/alpha/include/asm/ktermios.h new file mode 100644 index 000000000000..f1e3d24b8e61 --- /dev/null +++ b/arch/alpha/include/asm/ktermios.h @@ -0,0 +1,2 @@ +#define KTERMIOS_C_CC_BEFORE_C_LINE 1 +#include diff --git a/arch/alpha/include/uapi/asm/termbits.h b/arch/alpha/include/uapi/asm/termbits.h index f1290b22072b..50a1b468b81c 100644 --- a/arch/alpha/include/uapi/asm/termbits.h +++ b/arch/alpha/include/uapi/asm/termbits.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_TERMBITS_H -#define _ALPHA_TERMBITS_H +#ifndef _UAPI_ALPHA_TERMBITS_H +#define _UAPI_ALPHA_TERMBITS_H #include @@ -37,19 +37,6 @@ struct termios2 { speed_t c_ospeed; /* output speed */ }; -/* Alpha has matching termios and ktermios */ - -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[NCCS]; /* control characters */ - cc_t c_line; /* line discipline (== c_cc[19]) */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - /* c_cc characters */ #define VEOF 0 #define VEOL 1 diff --git a/arch/arc/include/asm/ktermios.h b/arch/arc/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/arc/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/arm/include/asm/ktermios.h b/arch/arm/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/arm/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/arm64/include/asm/ktermios.h b/arch/arm64/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/arm64/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/csky/include/asm/ktermios.h b/arch/csky/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/csky/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/hexagon/include/asm/ktermios.h b/arch/hexagon/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/hexagon/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/loongarch/include/asm/ktermios.h b/arch/loongarch/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/loongarch/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/m68k/include/asm/ktermios.h b/arch/m68k/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/m68k/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/microblaze/include/asm/ktermios.h b/arch/microblaze/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/microblaze/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/mips/include/asm/ktermios.h b/arch/mips/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/mips/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/mips/include/uapi/asm/termbits.h b/arch/mips/include/uapi/asm/termbits.h index 1eb60903d6f0..dacefee984d6 100644 --- a/arch/mips/include/uapi/asm/termbits.h +++ b/arch/mips/include/uapi/asm/termbits.h @@ -8,8 +8,8 @@ * Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ -#ifndef _ASM_TERMBITS_H -#define _ASM_TERMBITS_H +#ifndef _UAPI_ASM_TERMBITS_H +#define _UAPI_ASM_TERMBITS_H #include @@ -40,17 +40,6 @@ struct termios2 { speed_t c_ospeed; /* output speed */ }; -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - /* c_cc characters */ #define VINTR 0 /* Interrupt character [ISIG] */ #define VQUIT 1 /* Quit character [ISIG] */ diff --git a/arch/nios2/include/asm/ktermios.h b/arch/nios2/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/nios2/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/openrisc/include/asm/ktermios.h b/arch/openrisc/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/openrisc/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/parisc/include/asm/ktermios.h b/arch/parisc/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/parisc/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/parisc/include/uapi/asm/termbits.h b/arch/parisc/include/uapi/asm/termbits.h index 3a8938d26fb4..d8818b887680 100644 --- a/arch/parisc/include/uapi/asm/termbits.h +++ b/arch/parisc/include/uapi/asm/termbits.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef __ARCH_PARISC_TERMBITS_H__ -#define __ARCH_PARISC_TERMBITS_H__ +#ifndef _UAPI_PARISC_TERMBITS_H +#define _UAPI_PARISC_TERMBITS_H #include @@ -27,17 +27,6 @@ struct termios2 { speed_t c_ospeed; /* output speed */ }; -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - /* c_cc characters */ #define VINTR 0 #define VQUIT 1 diff --git a/arch/powerpc/include/asm/ktermios.h b/arch/powerpc/include/asm/ktermios.h new file mode 100644 index 000000000000..f1e3d24b8e61 --- /dev/null +++ b/arch/powerpc/include/asm/ktermios.h @@ -0,0 +1,2 @@ +#define KTERMIOS_C_CC_BEFORE_C_LINE 1 +#include diff --git a/arch/powerpc/include/uapi/asm/termbits.h b/arch/powerpc/include/uapi/asm/termbits.h index 21dc86dcb2f1..f4e4d8270c8e 100644 --- a/arch/powerpc/include/uapi/asm/termbits.h +++ b/arch/powerpc/include/uapi/asm/termbits.h @@ -31,19 +31,6 @@ struct termios { speed_t c_ospeed; /* output speed */ }; -/* For PowerPC the termios and ktermios are the same */ - -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[NCCS]; /* control characters */ - cc_t c_line; /* line discipline (== c_cc[19]) */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - /* c_cc characters */ #define VINTR 0 #define VQUIT 1 diff --git a/arch/riscv/include/asm/ktermios.h b/arch/riscv/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/riscv/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/s390/include/asm/ktermios.h b/arch/s390/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/s390/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/sh/include/asm/ktermios.h b/arch/sh/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/sh/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/sparc/include/asm/ktermios.h b/arch/sparc/include/asm/ktermios.h new file mode 100644 index 000000000000..bdd3682eecef --- /dev/null +++ b/arch/sparc/include/asm/ktermios.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _SPARC_KTERMIOS_H +#define _SPARC_KTERMIOS_H + +#define VMIN 16 +#define VTIME 17 +#define KNCCS (NCCS+2) + +#include + +#endif /* !(_SPARC_KTERMIOS_H) */ diff --git a/arch/sparc/include/asm/termbits.h b/arch/sparc/include/asm/termbits.h deleted file mode 100644 index fa9de4a46d36..000000000000 --- a/arch/sparc/include/asm/termbits.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _SPARC_TERMBITS_H -#define _SPARC_TERMBITS_H - -#include - -#define VMIN 16 -#define VTIME 17 -#endif /* !(_SPARC_TERMBITS_H) */ diff --git a/arch/um/include/asm/ktermios.h b/arch/um/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/um/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/x86/include/asm/ktermios.h b/arch/x86/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/x86/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/arch/xtensa/include/asm/ktermios.h b/arch/xtensa/include/asm/ktermios.h new file mode 100644 index 000000000000..4320921a82a9 --- /dev/null +++ b/arch/xtensa/include/asm/ktermios.h @@ -0,0 +1 @@ +#include diff --git a/include/asm-generic/ktermios.h b/include/asm-generic/ktermios.h new file mode 100644 index 000000000000..bf22e22d8130 --- /dev/null +++ b/include/asm-generic/ktermios.h @@ -0,0 +1,26 @@ +#ifndef _ASM_GENERIC_KTERMIOS_H +#define _ASM_GENERIC_KTERMIOS_H + +#ifndef KNCCS +# define KNCCS NCCS +#endif + +struct ktermios { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ +#ifndef KTERMIOS_C_CC_BEFORE_C_LINE + /* Most architectures */ + cc_t c_line; /* line discipline */ + cc_t c_cc[KNCCS]; /* control characters */ +#else + /* Alpha and PowerPC */ + cc_t c_cc[KNCCS]; /* control characters */ + cc_t c_line; /* line discipline */ +#endif + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; + +#endif /* _ASM_GENERIC_KTERMIOS_H */ diff --git a/include/linux/termios.h b/include/linux/termios.h new file mode 100644 index 000000000000..9d37d24cae02 --- /dev/null +++ b/include/linux/termios.h @@ -0,0 +1,7 @@ +#ifndef _LINUX_TERMIOS_H +#define _LINUX_TERMIOS_H + +#include +#include + +#endif diff --git a/include/uapi/asm-generic/termbits.h b/include/uapi/asm-generic/termbits.h index 890ef29053e2..df60b006657f 100644 --- a/include/uapi/asm-generic/termbits.h +++ b/include/uapi/asm-generic/termbits.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef __ASM_GENERIC_TERMBITS_H -#define __ASM_GENERIC_TERMBITS_H +#ifndef _UAPI_ASM_GENERIC_TERMBITS_H +#define _UAPI_ASM_GENERIC_TERMBITS_H #include @@ -27,17 +27,6 @@ struct termios2 { speed_t c_ospeed; /* output speed */ }; -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - /* c_cc characters */ #define VINTR 0 #define VQUIT 1 diff --git a/include/uapi/linux/termios.h b/include/uapi/linux/termios.h index e6da9d4433d1..32ff18b0dfbc 100644 --- a/include/uapi/linux/termios.h +++ b/include/uapi/linux/termios.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _LINUX_TERMIOS_H -#define _LINUX_TERMIOS_H +#ifndef _UAPI_LINUX_TERMIOS_H +#define _UAPI_LINUX_TERMIOS_H #include #include -- 2.50.1 From linux at armlinux.org.uk Wed Jul 16 10:57:11 2025 From: linux at armlinux.org.uk (Russell King (Oracle)) Date: Wed, 16 Jul 2025 18:57:11 +0100 Subject: [PATCH 1/1] uapi/termios: remove struct ktermios from uapi headers In-Reply-To: <20250716164735.170713-1-hpa@zytor.com> References: <20250716164735.170713-1-hpa@zytor.com> Message-ID: On Wed, Jul 16, 2025 at 09:47:32AM -0700, H. Peter Anvin wrote: > diff --git a/arch/arm/include/asm/ktermios.h b/arch/arm/include/asm/ktermios.h > new file mode 100644 > index 000000000000..4320921a82a9 > --- /dev/null > +++ b/arch/arm/include/asm/ktermios.h > @@ -0,0 +1 @@ > +#include Isn't this what arch/arm/include/asm/Kbuild's generic-y is for? Ditto for other arches. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! From hpa at zytor.com Wed Jul 16 11:04:52 2025 From: hpa at zytor.com (H. Peter Anvin) Date: Wed, 16 Jul 2025 11:04:52 -0700 Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_1/1=5D_uapi/termios=3A_remov?= =?US-ASCII?Q?e_struct_ktermios_from_uapi_headers?= In-Reply-To: References: <20250716164735.170713-1-hpa@zytor.com> Message-ID: <9AEAF0BE-39D7-4617-9CB5-D0703B3E6DF8@zytor.com> On July 16, 2025 10:57:11 AM PDT, "Russell King (Oracle)" wrote: >On Wed, Jul 16, 2025 at 09:47:32AM -0700, H. Peter Anvin wrote: >> diff --git a/arch/arm/include/asm/ktermios.h b/arch/arm/include/asm/ktermios.h >> new file mode 100644 >> index 000000000000..4320921a82a9 >> --- /dev/null >> +++ b/arch/arm/include/asm/ktermios.h >> @@ -0,0 +1 @@ >> +#include > >Isn't this what arch/arm/include/asm/Kbuild's generic-y is for? > >Ditto for other arches. > Ah, yes, you're right (except for those with nontrivial stubs.) I also found that a handful of drivers and arch/sparc needs ? in . From braker.noob.kernel at gmail.com Fri Jul 18 03:27:20 2025 From: braker.noob.kernel at gmail.com (Rujra Bhatt) Date: Fri, 18 Jul 2025 15:57:20 +0530 Subject: [PATCH] arc:kernel:perf_event.c : replaced sprintf with sysfs_emit() In-Reply-To: References: Message-ID: Hi, On Sat, Jul 5, 2025 at 1:00?PM Rujra Bhatt wrote: > > Replaced sprintf() with sysfs_emit() in sysfs*_show() function in > perf_event.c file to follow the kernel's guidelines from > documentation/filesystems/sysfs.rst > This will improve consistency, safety, and makes it easier to maintain > and update in future. > > Signed-off-by: Rujra Bhatt > --- > arch/arc/kernel/perf_event.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c > index ed6d4f0cd621..424ec072c441 100644 > --- a/arch/arc/kernel/perf_event.c > +++ b/arch/arc/kernel/perf_event.c > @@ -648,7 +648,7 @@ static ssize_t arc_pmu_events_sysfs_show(struct device *dev, > struct perf_pmu_events_attr *pmu_attr; > > pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); > - return sprintf(page, "event=0x%04llx\n", pmu_attr->id); > + return sysfs_emit(page, "event=0x%04llx\n", pmu_attr->id); > } > > /* > -- > 2.43.0 > Gentle reminder for the replacement of sprintf() with the sysfs_emit(), kindly review it. Thanking you, regards, Rujra Bhatt From greg at kroah.com Fri Jul 18 04:47:56 2025 From: greg at kroah.com (Greg KH) Date: Fri, 18 Jul 2025 13:47:56 +0200 Subject: [PATCH] arc:kernel:perf_event.c : replaced sprintf with sysfs_emit() In-Reply-To: References: Message-ID: <2025071801-driveway-curly-698c@gregkh> On Fri, Jul 18, 2025 at 03:57:20PM +0530, Rujra Bhatt wrote: > Hi, > > On Sat, Jul 5, 2025 at 1:00?PM Rujra Bhatt wrote: > > > > Replaced sprintf() with sysfs_emit() in sysfs*_show() function in > > perf_event.c file to follow the kernel's guidelines from > > documentation/filesystems/sysfs.rst > > This will improve consistency, safety, and makes it easier to maintain > > and update in future. > > > > Signed-off-by: Rujra Bhatt > > --- > > arch/arc/kernel/perf_event.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c > > index ed6d4f0cd621..424ec072c441 100644 > > --- a/arch/arc/kernel/perf_event.c > > +++ b/arch/arc/kernel/perf_event.c > > @@ -648,7 +648,7 @@ static ssize_t arc_pmu_events_sysfs_show(struct device *dev, > > struct perf_pmu_events_attr *pmu_attr; > > > > pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); > > - return sprintf(page, "event=0x%04llx\n", pmu_attr->id); > > + return sysfs_emit(page, "event=0x%04llx\n", pmu_attr->id); > > } > > > > /* > > -- > > 2.43.0 > > > > Gentle reminder for the replacement of sprintf() with the sysfs_emit(), kindly > review it. Why is this required? There is no bug in the current code, so no need to change it at all. Please just use sysfs_emit() for new sysfs files, no need to churn the tree and change all existing entries, otherwise we would have done this a long time ago when we introduced these functions. thanks, greg k-h From wiktoria.bielaszka at subventuro.com Mon Jul 21 00:45:48 2025 From: wiktoria.bielaszka at subventuro.com (Wiktoria Bielaszka) Date: Mon, 21 Jul 2025 07:45:48 GMT Subject: =?UTF-8?Q?Zamro=C5=BCenie_ceny_energii?= Message-ID: <20250721084500-0.1.lf.2xoou.0.o7dx3jdfpp@CyberCircuitryCo.com> Dzie? dobry, czy planuj? Pa?stwo optymalizacj? koszt?w energii elektrycznej w swojej firmie? Chcieliby?my przedstawi? nasz? ofert? XPOT, kt?ra mo?e przynie?? znacz?ce oszcz?dno?ci. Ju? od teraz, mog? Pa?stwo uzyska? cen? ni?sz? o 40,9% w stosunku do obecnej ceny ustawowej. Nasza propozycja obejmuje lata 2025 i 2026, a start wsp??pracy jest mo?liwy od zaraz. Gwarantujemy elastyczne warunki umowy (3-6-9-12 miesi?cy), zapewniaj?c minimum formalno?ci. Jeste?my pionierem w sprzeda?y energii w cenach RDN wed?ug TGE dla ka?dej grupy taryfowej. Przez ca?y okres trwania umowy zapewniamy Pa?stwu dedykowanego opiekuna, a ca?y proces Zmiany Sprzedawcy i wszelkie formalno?ci realizujemy za Klient?w. Ch?tnie porozmawiam o tym, jak mo?emy wsp?lnie zrealizowa? Pa?stwa cele energetyczne. Prosz? o wiadomo?? w przypadku zainteresowania. Pozdrawiam Wiktoria Bielaszka From braker.noob.kernel at gmail.com Mon Jul 21 20:52:57 2025 From: braker.noob.kernel at gmail.com (Rujra Bhatt) Date: Tue, 22 Jul 2025 09:22:57 +0530 Subject: [PATCH] arc:kernel:perf_event.c : replaced sprintf with sysfs_emit() In-Reply-To: <2025071801-driveway-curly-698c@gregkh> References: <2025071801-driveway-curly-698c@gregkh> Message-ID: On Fri, Jul 18, 2025 at 5:18?PM Greg KH wrote: > > On Fri, Jul 18, 2025 at 03:57:20PM +0530, Rujra Bhatt wrote: > > Hi, > > > > On Sat, Jul 5, 2025 at 1:00?PM Rujra Bhatt wrote: > > > > > > Replaced sprintf() with sysfs_emit() in sysfs*_show() function in > > > perf_event.c file to follow the kernel's guidelines from > > > documentation/filesystems/sysfs.rst > > > This will improve consistency, safety, and makes it easier to maintain > > > and update in future. > > > > > > Signed-off-by: Rujra Bhatt > > > --- > > > arch/arc/kernel/perf_event.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c > > > index ed6d4f0cd621..424ec072c441 100644 > > > --- a/arch/arc/kernel/perf_event.c > > > +++ b/arch/arc/kernel/perf_event.c > > > @@ -648,7 +648,7 @@ static ssize_t arc_pmu_events_sysfs_show(struct device *dev, > > > struct perf_pmu_events_attr *pmu_attr; > > > > > > pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); > > > - return sprintf(page, "event=0x%04llx\n", pmu_attr->id); > > > + return sysfs_emit(page, "event=0x%04llx\n", pmu_attr->id); > > > } > > > > > > /* > > > -- > > > 2.43.0 > > > > > > > Gentle reminder for the replacement of sprintf() with the sysfs_emit(), kindly > > review it. > > Why is this required? There is no bug in the current code, so no need > to change it at all. Please just use sysfs_emit() for new sysfs files, > no need to churn the tree and change all existing entries, otherwise we > would have done this a long time ago when we introduced these functions. > Hi Greg, I appreciate your feedback. I wanted to bring the formatting in line with the latest guidance, especially since sysfs_emit() has become the recommended method for sysfs output. I see now, though, that I should restrict myself to using that helper only in the context of genuine bug fixes or in the course of adding features. I'll make sure to only use sysfs_emit() for new sysfs entries or when modifying existing files for actual bugs or feature changes, as per your guidance. Thank you so much for pointing this out. regards, Rujra Bhatt From lkp at intel.com Tue Jul 22 09:11:37 2025 From: lkp at intel.com (kernel test robot) Date: Wed, 23 Jul 2025 00:11:37 +0800 Subject: include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) Message-ID: <202507230016.wIB7yFIo-lkp@intel.com> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 89be9a83ccf1f88522317ce02f854f30d6115c41 commit: ea7caffedd011f7d40abe93a884ffbe46f122535 ARC: atomics: Implement arch_atomic64_cmpxchg using _relaxed date: 6 weeks ago config: arc-randconfig-r111-20250722 (https://download.01.org/0day-ci/archive/20250723/202507230016.wIB7yFIo-lkp at intel.com/config) compiler: arc-linux-gcc (GCC) 8.5.0 reproduce: (https://download.01.org/0day-ci/archive/20250723/202507230016.wIB7yFIo-lkp at intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202507230016.wIB7yFIo-lkp at intel.com/ sparse warnings: (new ones prefixed by >>) lib/atomic64_test.c: note: in included file (through include/linux/atomic.h, include/asm-generic/bitops/lock.h, arch/arc/include/asm/bitops.h, ...): include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) >> include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) >> include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) vim +4152 include/linux/atomic/atomic-arch-fallback.h 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4126 ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4127 /** ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4128 * raw_atomic64_cmpxchg() - atomic compare and exchange with full ordering ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4129 * @v: pointer to atomic64_t ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4130 * @old: s64 value to compare with ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4131 * @new: s64 value to assign ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4132 * ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4133 * If (@v == @old), atomically updates @v to @new with full ordering. 6dfee110c6cc7a include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2024-02-09 4134 * Otherwise, @v is not modified and relaxed ordering is provided. ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4135 * ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4136 * Safe to use in noinstr code; prefer atomic64_cmpxchg() elsewhere. ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4137 * ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4138 * Return: The original value of @v. ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4139 */ 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4140 static __always_inline s64 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4141 raw_atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new) 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4142 { 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4143 #if defined(arch_atomic64_cmpxchg) 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4144 return arch_atomic64_cmpxchg(v, old, new); 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4145 #elif defined(arch_atomic64_cmpxchg_relaxed) 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4146 s64 ret; 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4147 __atomic_pre_full_fence(); 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4148 ret = arch_atomic64_cmpxchg_relaxed(v, old, new); 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4149 __atomic_post_full_fence(); 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4150 return ret; 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4151 #else 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 @4152 return raw_cmpxchg(&v->counter, old, new); d12157efc8e083 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4153 #endif 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4154 } d12157efc8e083 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4155 :::::: The code at line 4152 was first introduced by commit :::::: 9257959a6e5b4fca6fc8e985790bff62c2046f20 locking/atomic: scripts: restructure fallback ifdeffery :::::: TO: Mark Rutland :::::: CC: Peter Zijlstra -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki