Re: [PATCH] KVM: SEV: Disable SEV-SNP support on initialization failure

2025-05-09 Thread Tom Lendacky
On 5/9/25 12:52, Kalra, Ashish wrote: > > On 5/9/2025 12:01 PM, Paluri, PavanKumar wrote: >> >> >> On 5/8/2025 5:52 PM, Ashish Kalra wrote: >>> From: Ashish Kalra >>> >>> During platform init, SNP initialization may fail for several reasons, >>> such as firmware command failures and incompatible

Re: [PATCH] dt-bindings: remoteproc: qcom,sm8150-pas: Add missing SC8180X compatible

2025-05-09 Thread Rob Herring (Arm)
On Mon, 28 Apr 2025 09:52:44 +0200, Krzysztof Kozlowski wrote: > Commit 4b4ab93ddc5f ("dt-bindings: remoteproc: Consolidate SC8180X and > SM8150 PAS files") moved SC8180X bindings from separate file into this > one, but it forgot to add actual compatibles in top-level properties > section making

Re: [PATCH bpf-next v3 00/11] bpf: Mitigate Spectre v1 using barriers

2025-05-09 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov : On Thu, 1 May 2025 09:35:51 +0200 you wrote: > This improves the expressiveness of unprivileged BPF by inserting > speculation barriers instead of rejecting the programs. > > The approach was previously presente

Re: [PATCH bpf-next v3 00/11] bpf: Mitigate Spectre v1 using barriers

2025-05-09 Thread Alexei Starovoitov
On Fri, May 9, 2025 at 11:39 AM wrote: > > Hello: > > This series was applied to bpf/bpf-next.git (master) > by Alexei Starovoitov : > > On Thu, 1 May 2025 09:35:51 +0200 you wrote: > > This improves the expressiveness of unprivileged BPF by inserting > > speculation barriers instead of rejecting

Re: [GIT PULL] Modules fixes for v6.15-rc6

2025-05-09 Thread pr-tracker-bot
The pull request you sent on Fri, 9 May 2025 17:09:54 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git/ > tags/modules-6.15-rc6 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/29fe5d50dfa6b61043e2e89206389ae56b5596eb Thank you! -- Deet-doot-d

[PATCH v7 2/4] virtio_rtc: Add PTP clocks

2025-05-09 Thread Peter Hilber
Expose the virtio_rtc clocks as PTP clocks to userspace, similar to ptp_kvm. virtio_rtc can expose multiple clocks, e.g. a UTC clock and a monotonic clock. Userspace should distinguish different clocks through the name assigned by the driver. In particular, UTC-like clocks can also be distinguishe

Re: [PATCH 1/3] selftests/timens: Print TAP headers

2025-05-09 Thread Shuah Khan
On 5/9/25 09:41, Thomas Weißschuh wrote: +Cc Kees On Wed, May 07, 2025 at 03:06:16PM -0600, Shuah Khan wrote: On 5/2/25 06:03, Thomas Weißschuh wrote: The TAP specification requires that the output begins with a header line. These headers lines are missing in the timens tests. Print such a li

Re: [PATCH 02/12] locking/rtmutex: Move max_lock_depth into rtmutex.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:06PM +0200, Joel Granados wrote: > Move the max_lock_depth sysctl table element and variable into > rtmutex.c. Make the variable static as it no longer needs to be > exported. Removed the rtmutex.h include from sysctl.c. > > This is part of a greater effort to move ct

Re: [PATCH 11/12] sysctl: Remove (very) old file changelog

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:15PM +0200, Joel Granados wrote: > These comments are older than 2003 and therefore do not bare any > relevance on the current state of the sysctl.c file. Remove them as they > confuse more than clarify. > > Signed-off-by: Joel Granados Reviewed-by: Kees Cook --

Re: [PATCH 12/12] sysctl: Remove superfluous includes from kernel/sysctl.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:16PM +0200, Joel Granados wrote: > Remove the following headers from the include list in sysctl.c. > > * These are removed as the related variables are no longer there. > === > Include Related Var > ==

Re: [GIT PULL] Modules fixes for v6.15-rc6

2025-05-09 Thread Petr Pavlu
On 5/9/25 18:19, Linus Torvalds wrote: > On Fri, 9 May 2025 at 08:09, Petr Pavlu wrote: >> >> The fix has been on modules-next only since yesterday but should be safe. > > Hmm. > > At a minimum, the *description* of this bug is garbage. > > It talks about an "uninitialized completion pointer",

[PATCH v2 17/62] objtool: Fix weak symbol detection

2025-05-09 Thread Josh Poimboeuf
find_symbol_hole_containing() fails to find a symbol hole (aka stripped weak symbol) if its section has no symbols before the hole. This breaks weak symbol detection if -ffunction-sections is enabled. Fix that by allowing the interval tree to contain section symbols, which are always at offset ze

[PATCH v2 31/62] objtool: Avoid emptying lists for duplicate sections

2025-05-09 Thread Josh Poimboeuf
When a to-be-created section already exists, there's no point in emptying the various lists if their respective sections already exist. In fact it's better to leave them intact as they might get used later. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 4 1 file changed, 4 delet

[PATCH] selftests/bpf: Fix bpf selftest build warning

2025-05-09 Thread Saket Kumar Bhaskar
On linux-next, build for bpf selftest displays a warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/if_xdp.h' differs from latest version at 'include/uapi/linux/if_xdp.h'. Commit 8066e388be48 ("net: add UAPI to the header guard in various network headers") changed the header guard

[PATCH 01/12] module: Move modprobe_path and modules_disabled ctl_tables into the module subsys

2025-05-09 Thread Joel Granados
Move module sysctl (modprobe_path and modules_disabled) out of sysctl.c and into the modules subsystem. Make the modprobe_path variable static as it no longer needs to be exported. Remove module.h from the includes in sysctl as it no longer uses any module exported variables. This is part of a gre

[PATCH 11/12] sysctl: Remove (very) old file changelog

2025-05-09 Thread Joel Granados
These comments are older than 2003 and therefore do not bare any relevance on the current state of the sysctl.c file. Remove them as they confuse more than clarify. Signed-off-by: Joel Granados --- kernel/sysctl.c | 16 1 file changed, 16 deletions(-) diff --git a/kernel/sysctl

[PATCH 00/12] sysctl: Move sysctls to their respective subsystems (second batch)

2025-05-09 Thread Joel Granados
5 files changed, 271 insertions(+), 252 deletions(-) --- base-commit: 7a94ff386a4a0d9322c56c0e998dd20468d869b1 change-id: 20250509-jag-mv_ctltables_iter2-9a176a322c9d Best regards, -- Joel Granados

[PATCH 06/12] fork: mv threads-max into kernel/fork.c

2025-05-09 Thread Joel Granados
make sysctl_max_threads static as it no longer needs to be exported into sysctl.c. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados --- include/linux/sysctl.h | 3 --- ker

[PATCH 12/12] sysctl: Remove superfluous includes from kernel/sysctl.c

2025-05-09 Thread Joel Granados
Remove the following headers from the include list in sysctl.c. * These are removed as the related variables are no longer there. === Include Related Var === linux/kmod.h usermodehelper a

[PATCH 05/12] parisc/power: Move soft-power into power.c

2025-05-09 Thread Joel Granados
Move the soft-power ctl table into parisc/power.c. As a consequence the pwrsw_enabled var is made static. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados --- drivers/paris

[PATCH 08/12] sysctl: Move tainted ctl_table into kernel/panic.c

2025-05-09 Thread Joel Granados
Move the ctl_table with the "tainted" proc_name into kernel/panic.c. With it moves the proc_tainted helper function. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados --- ke

[PATCH 02/12] locking/rtmutex: Move max_lock_depth into rtmutex.c

2025-05-09 Thread Joel Granados
Move the max_lock_depth sysctl table element and variable into rtmutex.c. Make the variable static as it no longer needs to be exported. Removed the rtmutex.h include from sysctl.c. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge con

[PATCH 03/12] rcu: Move rcu_stall related sysctls into rcu/tree_stall.h

2025-05-09 Thread Joel Granados
Move sysctl_panic_on_rcu_stall and sysctl_max_rcu_stall_to_panic into the kernel/rcu subdirectory. Make these static in tree_stall.h and removed them as extern from panic.h as their scope is now confined into one file. This is part of a greater effort to move ctl tables into their respective subsy

[PATCH 07/12] Input: sysrq: mv sysrq into drivers/tty/sysrq.c

2025-05-09 Thread Joel Granados
Move both sysrq ctl_table and supported sysrq_sysctl_handler helper function into drivers/tty/sysrq.c. Replaced the __do_proc_dointvec in helper function with do_proc_dointvec as the former is local to kernel/sysctl.c. This is part of a greater effort to move ctl tables into their respective subsy

[PATCH 04/12] mm: move randomize_va_space into memory.c

2025-05-09 Thread Joel Granados
Move the randomize_va_space variable together with all its sysctl table elements into memory.c. Register it to the "kernel" directory by adding it to the subsys initialization calls This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge con

[PATCH 09/12] sysctl: move cad_pid into kernel/pid.c

2025-05-09 Thread Joel Granados
Move cad_pid as well as supporting function proc_do_cad_pid into kernel/pic.c. Replaced call to __do_proc_dointvec with proc_dointvec inside proc_do_cad_pid which requires the copy of the ctl_table to handle the temp value. This is part of a greater effort to move ctl tables into their respective

Re: [PATCH v2] rcu/nocb: Add Safe checks for access offloaded rdp

2025-05-09 Thread Frederic Weisbecker
Le Thu, May 08, 2025 at 02:43:11PM +0800, Z qiang a écrit : > On Thu, May 8, 2025 at 12:25 AM Frederic Weisbecker > wrote: > > On a second thought, isn't "rdp == this_cpu_ptr(&rcu_data)" enough? > > If the CONFIG_DEBUG_PREEMPT=y, the following code will cause > a warning in rcuop kthreads: > >

Re: [PATCH 1/3] selftests/timens: Print TAP headers

2025-05-09 Thread Thomas Weißschuh
+Cc Kees On Wed, May 07, 2025 at 03:06:16PM -0600, Shuah Khan wrote: > On 5/2/25 06:03, Thomas Weißschuh wrote: > > The TAP specification requires that the output begins with a header line. > > These headers lines are missing in the timens tests. > > > > Print such a line. > > There is no cover

Re: [PATCH 02/12] locking/rtmutex: Move max_lock_depth into rtmutex.c

2025-05-09 Thread Waiman Long
On 5/9/25 8:54 AM, Joel Granados wrote: Move the max_lock_depth sysctl table element and variable into rtmutex.c. Make the variable static as it no longer needs to be exported. Removed the rtmutex.h include from sysctl.c. This is part of a greater effort to move ctl tables into their respectiv

Re: [PATCH v2] selftests/mm: add simple VM_PFNMAP tests based on mmap'ing /dev/mem

2025-05-09 Thread Lorenzo Stoakes
On Fri, May 09, 2025 at 05:30:32PM +0200, David Hildenbrand wrote: > Let's test some basic functionality using /dev/mem. These tests will > implicitly cover some PAT (Page Attribute Handling) handling on x86. > > These tests will only run when /dev/mem access to the first two pages > in physical a

[PATCH v2 0/3] rpmsg: Introduce RPMSG_CREATE_EPT_FD_IOCTL uAPI

2025-05-09 Thread Dawei Li
Hi, This is V2 of series which introduce new uAPI(RPMSG_CREATE_EPT_FD_IOCTL) for rpmsg subsystem. Current uAPI implementation for rpmsg ctrl & char device manipulation is abstracted in procedures below: - fd = open("/dev/rpmsg_ctrlX") - ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &info); /dev/rpmsgY devnod

[PATCH v7 0/4] Add virtio_rtc module

2025-05-09 Thread Peter Hilber
This series implements a driver for a virtio-rtc device conforming to spec proposal v9 [1]. It includes a PTP clock driver and an RTC class driver with alarm. v7 updates == v7 adds a char length printf modifier to avoid a warning with old compilers. The spec v9 changes do not affect this

[PATCH v2 2/3] rpmsg: char: Implement eptdev based on anon inode

2025-05-09 Thread Dawei Li
Introduce new eptdev abstraction based on anon inode. The new API is exactly same with legacy one except: - It's anonymous and devnode/path free. - Its fops->open() is empty. Signed-off-by: Dawei Li --- drivers/rpmsg/rpmsg_char.c | 44 ++ drivers/rpmsg/rpmsg_

[PATCH v2 3/3] rpmsg: ctrl: Introduce RPMSG_CREATE_EPT_FD_IOCTL uAPI

2025-05-09 Thread Dawei Li
Implement RPMSG_CREATE_EPT_FD_IOCTL, new uAPI for rpmsg ctrl, which shares most of operations of RPMSG_CREATE_EPT_IOCTL except that it returns fd representing eptdev to userspace directly. Possible calling procedures for userspace are: - fd = open("/dev/rpmsg_ctrlX") - ioctl(fd, RPMSG_CREATE_EPT_F

Re: [PATCH 09/12] sysctl: move cad_pid into kernel/pid.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:13PM +0200, Joel Granados wrote: > Move cad_pid as well as supporting function proc_do_cad_pid into > kernel/pic.c. Replaced call to __do_proc_dointvec with proc_dointvec > inside proc_do_cad_pid which requires the copy of the ctl_table to > handle the temp value. > >

Re: [PATCH 05/12] parisc/power: Move soft-power into power.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:09PM +0200, Joel Granados wrote: > Move the soft-power ctl table into parisc/power.c. As a consequence the > pwrsw_enabled var is made static. > > This is part of a greater effort to move ctl tables into their > respective subsystems which will reduce the merge confli

Re: [PATCH 03/12] rcu: Move rcu_stall related sysctls into rcu/tree_stall.h

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:07PM +0200, Joel Granados wrote: > Move sysctl_panic_on_rcu_stall and sysctl_max_rcu_stall_to_panic into > the kernel/rcu subdirectory. Make these static in tree_stall.h and > removed them as extern from panic.h as their scope is now confined into > one file. > > This

Re: [PATCH 08/12] sysctl: Move tainted ctl_table into kernel/panic.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:12PM +0200, Joel Granados wrote: > Move the ctl_table with the "tainted" proc_name into kernel/panic.c. > With it moves the proc_tainted helper function. > > This is part of a greater effort to move ctl tables into their > respective subsystems which will reduce the m

Re: [PATCH 06/12] fork: mv threads-max into kernel/fork.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:10PM +0200, Joel Granados wrote: > make sysctl_max_threads static as it no longer needs to be exported into > sysctl.c. > > This is part of a greater effort to move ctl tables into their > respective subsystems which will reduce the merge conflicts in > kernel/sysctl.

Re: [PATCH 1/3] selftests/timens: Print TAP headers

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 05:41:03PM +0200, Thomas Weißschuh wrote: > The suppression was actually there at some point and got removed by Kees in > commit f41c322f17ec ("selftests: Remove KSFT_TAP_LEVEL"). Right, to get consistent output and to work with indentation, there's no need to track level a

Re: [PATCH] rcu/nocb: Fix possible invalid rdp's->nocb_cb_kthread pointer access

2025-05-09 Thread Joel Fernandes
On 5/9/2025 3:07 PM, Joel Fernandes wrote: > > > On 5/7/2025 7:26 AM, Zqiang wrote: >> In the preparation stage of CPU online, if the corresponding >> the rdp's->nocb_cb_kthread does not exist, will be created, >> there is a situation where the rdp's rcuop kthreads creation fails, >> and then de-

Re: [PATCH v2 3/3] remoteproc: imx_rproc: add power mode check for remote core attachment

2025-05-09 Thread Hiago De Franco
On Fri, May 09, 2025 at 12:37:02PM +0200, Ulf Hansson wrote: > On Thu, 8 May 2025 at 22:28, Hiago De Franco wrote: > > > > Hello, > > > > On Thu, May 08, 2025 at 12:03:33PM +0200, Ulf Hansson wrote: > > > On Wed, 7 May 2025 at 18:02, Hiago De Franco > > > wrote: > > > > > > > > From: Hiago De Fr

Re: [PATCH] rcutorture: Fix rcutorture_one_extend_check() splat in RT kernels

2025-05-09 Thread Joel Fernandes
On 5/7/2025 5:04 PM, Paul E. McKenney wrote: > On Wed, May 07, 2025 at 07:26:03PM +0800, Zqiang wrote: >> For built with CONFIG_PREEMPT_RT=y kernels, running rcutorture >> tests resulted in the following splat: >> >> [ 68.797425] rcutorture_one_extend_check during change: Current 0x1 To >> a

Re: [PATCH v2] rcu/nocb: Add Safe checks for access offloaded rdp

2025-05-09 Thread Joel Fernandes
On 5/9/2025 9:33 AM, Frederic Weisbecker wrote: > Le Thu, May 08, 2025 at 02:43:11PM +0800, Z qiang a écrit : >> On Thu, May 8, 2025 at 12:25 AM Frederic Weisbecker >> wrote: >>> On a second thought, isn't "rdp == this_cpu_ptr(&rcu_data)" enough? >> >> If the CONFIG_DEBUG_PREEMPT=y, the follow

Re: [PATCH] selftests/seccomp: fix negative_ENOSYS tracer tests on arm32

2025-05-09 Thread Kees Cook
On Fri, 09 May 2025 12:56:22 +0100, Terry Tritton wrote: > TRACE_syscall.ptrace.negative_ENOSYS and TRACE_syscall.seccomp.negative_ENOSYS > on arm32 are being reported as failures instead of skipping. > > The teardown_trace_fixture function sets the test to KSFT_FAIL in case of a > non 0 return va

Re: [PATCH] KVM: SEV: Disable SEV-SNP support on initialization failure

2025-05-09 Thread Tom Lendacky
On 5/8/25 17:52, Ashish Kalra wrote: > From: Ashish Kalra > > During platform init, SNP initialization may fail for several reasons, > such as firmware command failures and incompatible versions. However, > the KVM capability may continue to advertise support for it. > > The platform may have SN

[PATCH 2/3] KVM: arm64: selftests: fix thread migration in arch_timer_edge_cases

2025-05-09 Thread Sebastian Ott
arch_timer_edge_cases tries to migrate itself across host cpus. Before the first test it migrates to cpu 0 by setting up an affinity mask with only bit 0 set. After that it looks for the next possible cpu in the current affinity mask which still has only bit 0 set. So there is no migration at all.

Re: [PATCH 0/3] Make rcutorture safe(r) for arm64

2025-05-09 Thread Paul E. McKenney
On Fri, May 09, 2025 at 09:18:00AM -0400, Joel Fernandes wrote: > > > On 5/8/2025 7:42 PM, Paul E. McKenney wrote: > > Hello! > > > > This series makes a few small updates to make rcutorture run better > > on arm64 servers. Remaining issues include TREE07 .config issues > > that are addressed b

[PATCH 3/3] KVM: arm64: selftests: arch_timer_edge_cases - workaround for AC03_CPU_14

2025-05-09 Thread Sebastian Ott
arch_timer_edge_cases currently fails on ampere-one machines with the following assertion failure: Test Assertion Failure arm64/arch_timer_edge_cases.c:169: timer_condition == istatus pid=11236 tid=11236 errno=4 - Interrupted system call 1 0x00404ce7: test_run at arch_t

[PATCH 1/3] KVM: arm64: selftests: fix help text for arch_timer_edge_cases

2025-05-09 Thread Sebastian Ott
Fix the help text for arch_timer_edge_cases to show the correct option for setting the wait time. Signed-off-by: Sebastian Ott --- tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/arm64/arch_

[PATCH v2 6/6] kbuild: Create modules.builtin.modinfo for modpost results

2025-05-09 Thread Alexey Gladkov
Create modules.builtin.modinfo as a combination of modinfo from vmlinux and the result of generating modalias by modpost. Signed-off-by: Alexey Gladkov --- scripts/Makefile.vmlinux | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/scripts/Makefil

[PATCH v2 3/6] modpost: Make mod_device_table aliases more unique

2025-05-09 Thread Alexey Gladkov
In order to avoid symbol conflicts if they appear in the same binary, a more unique alias identifier can be generated. Signed-off-by: Alexey Gladkov --- include/linux/module.h | 14 -- scripts/mod/file2alias.c | 18 ++ 2 files changed, 26 insertions(+), 6 deletions(

[PATCH v2 2/6] modules: Add macros to specify modinfo prefix

2025-05-09 Thread Alexey Gladkov
The __MODULE_INFO macros always use __MODULE_INFO_PREFIX. The only way to use a different prefix is to override __MODULE_INFO_PREFIX, which is not very useful. The new macro will be used in file2alias.c to generate modalias for builtin modules. Signed-off-by: Alexey Gladkov --- include/linux/mo

[PATCH v2 0/6] Add generated modalias to modules.builtin.modinfo

2025-05-09 Thread Alexey Gladkov
The modules.builtin.modinfo file is used by userspace (kmod to be specific) to get information about builtin modules. Among other information about the module, information about module aliases is stored. This is very important to determine that a particular modalias will be handled by a module that

[PATCH v2 1/6] scsi: Define MODULE_DEVICE_TABLE only if necessary

2025-05-09 Thread Alexey Gladkov
Define MODULE_DEVICE_TABLE only if a structure is defined for it. drivers/scsi/BusLogic.c:3735:26: error: use of undeclared identifier 'blogic_pci_tbl' 3735 | MODULE_DEVICE_TABLE(pci, blogic_pci_tbl); Fixes: 1079a2d251f2 ("[SCSI] BusLogic: stop using check_region") Cc: Khalid Aziz Cc: "James E

[PATCH v2] sched,livepatch: Untangle cond_resched() and live-patching

2025-05-09 Thread Sebastian Andrzej Siewior
From: Peter Zijlstra With the goal of deprecating / removing VOLUNTARY preempt, live-patch needs to stop relying on cond_resched() to make forward progress. Instead, rely on schedule() with TASK_FREEZABLE set. Just like live-patching, the freezer needs to be able to stop tasks in a safe / known

Re: [PATCH v2 5/7] modpost: Create modalias for builtin modules

2025-05-09 Thread Alexey Gladkov
On Fri, May 09, 2025 at 12:42:39AM +0900, Masahiro Yamada wrote: > On Mon, May 5, 2025 at 6:39 PM Alexey Gladkov wrote: > > > > For some modules, modalias is generated using the modpost utility and > > the section is added to the module file. > > > > When a module is added inside vmlinux, modpost

[PATCH v2 5/6] kbuild: Move modules.builtin.modinfo to another makefile

2025-05-09 Thread Alexey Gladkov
The creation of modules.builtin.modinfo is going to depend on .vmlinux.export.o so it is worth moving its creation closer to it. Signed-off-by: Alexey Gladkov --- scripts/Makefile.vmlinux | 26 ++ scripts/Makefile.vmlinux_o | 26 +- 2 files chang

Re: [PATCH] kunit: configs: Enable coverage of the bitfield packing library

2025-05-09 Thread Rae Moar
On Fri, Apr 25, 2025 at 6:19 PM Mark Brown wrote: > > There are KUnit tests for the bitfield packing library but these depend > on CONFIG_PACKING which is not enabled by anything in either the > existing KUnit all_tests.config or the base UML config it runs on as > standard. Enable that in all_te

Re: [PATCH] rcu/nocb: Fix possible invalid rdp's->nocb_cb_kthread pointer access

2025-05-09 Thread Joel Fernandes
On 5/7/2025 7:26 AM, Zqiang wrote: > In the preparation stage of CPU online, if the corresponding > the rdp's->nocb_cb_kthread does not exist, will be created, > there is a situation where the rdp's rcuop kthreads creation fails, > and then de-offload this CPU's rdp, does not assign this CPU's >

Re: [PATCH 04/12] mm: move randomize_va_space into memory.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:08PM +0200, Joel Granados wrote: > Move the randomize_va_space variable together with all its sysctl table > elements into memory.c. Register it to the "kernel" directory by > adding it to the subsys initialization calls > > This is part of a greater effort to move ct

[PATCH v2 02/62] vmlinux.lds: Unify TEXT_MAIN, DATA_MAIN, and related macros

2025-05-09 Thread Josh Poimboeuf
TEXT_MAIN, DATA_MAIN and friends are defined differently depending on whether certain config options enable -ffunction-sections and/or -fdata-sections. There's no technical reason for that beyond voodoo coding. Keeping the separate implementations adds unnecessary complexity, fragments the logic,

[PATCH v2 06/62] compiler.h: Make addressable symbols less of an eyesore

2025-05-09 Thread Josh Poimboeuf
Avoid underscore overload by changing: __UNIQUE_ID___addressable_loops_per_jiffy_868 to the following: __UNIQUE_ID_addressable_loops_per_jiffy_868 This matches the format used by other __UNIQUE_ID()-generated symbols and improves readability for those who stare at ELF symbol table dumps. S

[PATCH v2 03/62] x86/module: Improve relocation error messages

2025-05-09 Thread Josh Poimboeuf
Add the section number and reloc index to relocation error messages to help find the faulty relocation. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/module.c | 15 +-- kernel/livepatch/core.c | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/x86/ke

[PATCH v2 01/62] s390/vmlinux.lds.S: Prevent thunk functions from getting placed with normal text

2025-05-09 Thread Josh Poimboeuf
The s390 indirect thunks are placed in the .text.__s390_indirect_jump_* sections. Certain config options which enable -ffunction-sections have a custom version of the TEXT_TEXT macro: .text.[0-9a-zA-Z_]* That unintentionally matches the thunk sections, causing them to get grouped with normal t

[PATCH v2 05/62] compiler: Tweak __UNIQUE_ID() naming

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, add an underscore between the name and the counter. This will make it possible for objtool to distinguish between the non-unique and unique parts of the symbol name so it can properly correlate the symbols. Signed-off-by: Josh Poimboeuf --- in

[PATCH v2 07/62] elfnote: Change ELFNOTE() to use __UNIQUE_ID()

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, replace the custom unique symbol name generation in ELFNOTE() with __UNIQUE_ID(). This standardizes the naming format for all "unique" symbols, which will allow objtool to properly correlate them. Note this also removes the "one ELF note per lin

[PATCH v2 11/62] objtool: Make find_symbol_containing() less arbitrary

2025-05-09 Thread Josh Poimboeuf
In the rare case of overlapping symbols, find_symbol_containing() just returns the first one it finds. Make it slightly less arbitrary by returning the smallest symbol with size > 0. Signed-off-by: Josh Poimboeuf --- tools/objtool/elf.c | 25 - 1 file changed, 20 inserti

[PATCH v2 09/62] modpost: Ignore unresolved section bounds symbols

2025-05-09 Thread Josh Poimboeuf
In preparation for klp-build livepatch module creation tooling, suppress warnings for unresolved references to linker-generated __start_* and __stop_* section bounds symbols. These symbols are expected to be undefined when modpost runs, as they're created later by the linker. Cc: Masahiro Yamada

[PATCH v2 08/62] kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, remove the arbitrary 'kmod_' prefix from __KBUILD_MODNAME and instead add it explicitly in the __initcall_id() macro. This change supports the standardization of "unique" symbol naming by ensuring the non-unique portion of the name comes before t

[PATCH v2 13/62] objtool: Fix broken error handling in read_symbols()

2025-05-09 Thread Josh Poimboeuf
The free(sym) call in the read_symbols() error path is fundamentally broken: 'sym' doesn't point to any allocated block. If triggered, things would go from bad to worse. Remove the free() and simplify the error paths. Freeing memory isn't necessary here anyway, these are fatal errors which lead

[PATCH v2 18/62] objtool: Fix x86 addend calculation

2025-05-09 Thread Josh Poimboeuf
On x86, arch_dest_reloc_offset() hardcodes the addend adjustment to four, but the actual adjustment depends on the relocation type. Fix that. Signed-off-by: Josh Poimboeuf --- tools/objtool/arch/loongarch/decode.c | 4 ++-- tools/objtool/arch/powerpc/decode.c | 4 ++-- tools/objtool/arch/x8

[PATCH v2 10/62] x86/alternative: Refactor INT3 call emulation selftest

2025-05-09 Thread Josh Poimboeuf
The INT3 call emulation selftest is a bit fragile as it relies on the compiler not inserting any extra instructions before the int3_selftest_ip() definition. Also, the int3_selftest_ip() symbol overlaps with the int3_selftest symbol(), which can confuse objtool. Fix those issues by slightly rewor

[PATCH v2 16/62] objtool: Fix interval tree insertion for zero-length symbols

2025-05-09 Thread Josh Poimboeuf
Zero-length symbols get inserted in the wrong spot. Fix that. Signed-off-by: Josh Poimboeuf --- tools/objtool/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index a8a78b55d3ec..c024937eb12a 100644 --- a/tools/objtool/elf.c +++

[PATCH v2 26/62] objtool: Add section/symbol type helpers

2025-05-09 Thread Josh Poimboeuf
Add some helper macros to improve readability. Signed-off-by: Josh Poimboeuf --- tools/objtool/arch/x86/special.c| 2 +- tools/objtool/check.c | 58 - tools/objtool/elf.c | 20 - tools/objtool/include/objtool/elf.h | 66 +

[PATCH v2 29/62] objtool: Mark prefix functions

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, introduce a flag to identify __pfx_*() and __cfi_*() functions in advance so they don't need to be manually identified every time a check is needed. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 3 +-- tools/objtool/el

[PATCH v2 32/62] objtool: Suppress section skipping warnings with --dryrun

2025-05-09 Thread Josh Poimboeuf
It's common to use --dryrun on binaries that have already been processed. Don't print the section skipping warnings in that case. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/objto

[PATCH v2 52/62] objtool/klp: Introduce klp diff subcommand for diffing object files

2025-05-09 Thread Josh Poimboeuf
Add a new klp diff subcommand which performs a binary diff between two object files and extracts changed functions into a new object which can then be linked into a livepatch module. This builds on concepts from the longstanding out-of-tree kpatch [1] project which began in 2012 and has been used

[PATCH v2 54/62] objtool/klp: Add post-link subcommand to finalize livepatch modules

2025-05-09 Thread Josh Poimboeuf
Livepatch needs some ELF magic which linkers don't like: - Two relocation sections (.rela*, .klp.rela*) for the same text section. - Use of SHN_LIVEPATCH to mark livepatch symbols. Unfortunately linkers tend to mangle such things. To work around that, klp diff generates a linker-complia

[PATCH v2 53/62] objtool/klp: Add --debug option to show cloning decisions

2025-05-09 Thread Josh Poimboeuf
Add a --debug option to klp diff which prints cloning decisions and an indented dependency tree for all cloned symbols and relocations. This helps visualize which symbols and relocations were included and why. Signed-off-by: Josh Poimboeuf --- tools/objtool/include/objtool/warn.h | 21

[PATCH v2 47/62] x86/orc: Define ELF section entry size for unwind hints

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, define the entry size for the discard.unwind_hints section in its ELF header. This will allow tooling to extract individual entries. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/unwind_orc.c | 2 ++ include/linux/objtool.h | 9 ++

[PATCH v2 58/62] livepatch/klp-build: Add stub init code for livepatch modules

2025-05-09 Thread Josh Poimboeuf
Add a module initialization stub which can be linked with binary diff objects to produce a livepatch module. Signed-off-by: Josh Poimboeuf --- scripts/livepatch/init.c | 108 +++ 1 file changed, 108 insertions(+) create mode 100644 scripts/livepatch/init.c d

[PATCH v2 15/62] objtool: Add empty symbols to the symbol tree again

2025-05-09 Thread Josh Poimboeuf
The following commit 5da6aea375cd ("objtool: Fix find_{symbol,func}_containing()") fixed the issue where overlapping symbols weren't getting sorted properly in the symbol tree. Therefore the workaround to skip adding empty symbols from the following commit a2e38dffcd93 ("objtool: Don't add

[PATCH v2 25/62] objtool: Convert elf iterator macros to use 'struct elf'

2025-05-09 Thread Josh Poimboeuf
'struct objtool_file' is specific to the check code and doesn't belong in the elf code which is supposed to be objtool_file-agnostic. Convert the elf iterator macros to use 'struct elf' instead. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 22 +++--- t

[PATCH v2 23/62] objtool: Clean up compiler flag usage

2025-05-09 Thread Josh Poimboeuf
KBUILD_HOSTCFLAGS and KBUILD_HOSTLDFLAGS aren't defined when objtool is built standalone. Also, the EXTRA_WARNINGS flags are rather arbitrary. Make things simpler and more consistent by specifying compiler flags explicitly and tweaking the warnings. Also make a few code tweaks to make the new wa

[PATCH v2 21/62] objtool: Check for missing annotation entries in read_annotate()

2025-05-09 Thread Josh Poimboeuf
Add a sanity check to make sure none of the relocations for the .discard.annotate_insn section have gone missing. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 53793b9ea974..0cd

[PATCH v2 22/62] objtool: Const string cleanup

2025-05-09 Thread Josh Poimboeuf
Use 'const char *' where applicable. Signed-off-by: Josh Poimboeuf --- tools/objtool/arch/loongarch/decode.c | 2 +- tools/objtool/arch/powerpc/decode.c | 2 +- tools/objtool/arch/x86/decode.c | 2 +- tools/objtool/elf.c | 6 +++--- tools/objtool/include/objtool/arch.h

[PATCH v2 20/62] objtool: Fix "unexpected end of section" warning for alternatives

2025-05-09 Thread Josh Poimboeuf
Due to the short circuiting logic in next_insn_to_validate(), control flow may silently transition from .altinstr_replacement to .text without a corresponding nested call to validate_branch(). As a result the validate_branch() 'sec' variable doesn't get reinitialized, which can trigger a confusing

[PATCH v2 24/62] objtool: Remove .parainstructions reference

2025-05-09 Thread Josh Poimboeuf
The .parainstructions section no longer exists since the following commit: 60bc276b129e ("x86/paravirt: Switch mixed paravirt/alternative calls to alternatives"). Remove the reference to it. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 1 - 1 file changed, 1 deletion(-) diff -

[PATCH v2 46/62] x86/bug: Define ELF section entry size for the bug table

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, define the entry size for the __bug_table section in its ELF header. This will allow tooling to extract individual entries. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/bug.h | 44 -- 1 file change

[PATCH v2 49/62] kbuild,objtool: Defer objtool validation step for CONFIG_LIVEPATCH

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, defer objtool validation for CONFIG_LIVEPATCH until the final pre-link archive (e.g., vmlinux.o, module-foo.o) is built. This will simplify the process of generating livepatch modules. Delayed objtool is generally preferred anyway, and is alread

[PATCH v2 42/62] kbuild,x86: Fix module permissions for __jump_table and __bug_table

2025-05-09 Thread Josh Poimboeuf
An upcoming patch will add the SHF_MERGE flag to x86 __jump_table and __bug_table so their entry sizes can be defined in inline asm. However, those sections have SHF_WRITE, which the Clang linker (lld) explicitly forbids combining with SHF_MERGE. Those sections are modified at runtime and must re

[PATCH v2 34/62] objtool: Reindent check_options[]

2025-05-09 Thread Josh Poimboeuf
Bring the cmdline check_options[] array back into vertical alignment for better readability. Signed-off-by: Josh Poimboeuf --- tools/objtool/builtin-check.c | 50 +-- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/objtool/builtin-check.c b/t

[PATCH v2 44/62] x86/jump_label: Define ELF section entry size for jump table

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, define the entry size for the __jump_table section in its ELF header. This will allow tooling to extract individual entries. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/jump_label.h | 32 +-- include/linu

[PATCH v2 38/62] objtool: Generalize elf_create_section()

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, broaden the elf_create_section() interface to give callers more control and reduce duplication of some subtle setup logic. While at it, make elf_create_rela_section() public so sections can be created by the upcoming klp diff code. Signed-off-by

[PATCH v2 43/62] x86/alternative: Define ELF section entry size for alternatives

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, define the entry size for the .altinstructions section in its ELF header. This will allow tooling to extract individual entries. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/alternative.h | 7 +-- arch/x86/kernel/alternative.c

[PATCH v2 45/62] x86/extable: Define ELF section entry size for exception tables

2025-05-09 Thread Josh Poimboeuf
In preparation for the objtool klp diff subcommand, define the entry size for the __ex_table section in its ELF header. This will allow tooling to extract individual entries. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/asm.h | 20 kernel/extable.c | 2

[PATCH v2 48/62] objtool: Make STACK_FRAME_NON_STANDARD consistent

2025-05-09 Thread Josh Poimboeuf
The C version of STACK_FRAME_NON_STANDARD differs from its asm counterpart in that it creates eight-byte entries (vs four) and creates a superfluous temporary variable. Make the entry sizes consistent by converting the C version to four byte entries. Signed-off-by: Josh Poimboeuf --- include/li

[PATCH v2 60/62] livepatch/klp-build: Add --debug option to show cloning decisions

2025-05-09 Thread Josh Poimboeuf
Add a --debug option which gets passed to "objtool klp diff" to enable debug output related to cloning decisions. Signed-off-by: Josh Poimboeuf --- scripts/livepatch/klp-build | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/livepatch/klp-build b/scri

[PATCH v2 55/62] objtool: Disallow duplicate prefix symbols

2025-05-09 Thread Josh Poimboeuf
In preparation for adding objtool 'check' support for analyzing livepatch modules, error out if a duplicate prefix symbol is attempted. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 12 +++- tools/objtool/elf.c | 9 + tools/objtool/inclu

  1   2   >