Re: [PATCH RFC 2/2] checkpatch: warn on usage of VM_BUG_ON() and friends

2022-08-24 Thread David Hildenbrand
On 24.08.22 18:52, Joe Perches wrote: > On Wed, 2022-08-24 at 18:31 +0200, David Hildenbrand wrote: >> checkpatch does not point out that VM_BUG_ON() and friends should be >> avoided, however, Linus notes: >> >> VM_BUG_ON() has the exact same semantics as BUG_ON. It is literally >> no

Re: [PATCH RFC 2/2] checkpatch: warn on usage of VM_BUG_ON() and friends

2022-08-24 Thread Joe Perches
On Wed, 2022-08-24 at 18:31 +0200, David Hildenbrand wrote: > checkpatch does not point out that VM_BUG_ON() and friends should be > avoided, however, Linus notes: > > VM_BUG_ON() has the exact same semantics as BUG_ON. It is literally > no different, the only difference is "we can make

[PATCH RFC 0/2] coding-style.rst: document BUG() and WARN() rules

2022-08-24 Thread David Hildenbrand
As it seems to be rather unclear if/when to use BUG(), BUG_ON(), VM_BUG_ON(), WARN_ON_ONCE(), ... let's try to document the result of a recent discussion. Details can be found in patch #1. -- Here is some braindump after

[PATCH RFC 1/2] coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel")

2022-08-24 Thread David Hildenbrand
Linus notes [1] that the introduction of new code that uses VM_BUG_ON() is just as bad as BUG_ON(), because it will crash the kernel on distributions that enable CONFIG_DEBUG_VM (like Fedora): VM_BUG_ON() has the exact same semantics as BUG_ON. It is literally no different, the only

[PATCH RFC 2/2] checkpatch: warn on usage of VM_BUG_ON() and friends

2022-08-24 Thread David Hildenbrand
checkpatch does not point out that VM_BUG_ON() and friends should be avoided, however, Linus notes: VM_BUG_ON() has the exact same semantics as BUG_ON. It is literally no different, the only difference is "we can make the code smaller because these are less important". [1] So let's

[PATCH V3 09/11] video/hyperv_fb: Avoid taking busy spinlock on panic path

2022-08-24 Thread Guilherme G. Piccoli
The Hyper-V framebuffer code registers a panic notifier in order to try updating its fbdev if the kernel crashed. The notifier callback is straightforward, but it calls the vmbus_sendpacket() routine eventually, and such function takes a spinlock for the ring buffer operations. Panic path runs in

[PATCH V3 02/11] notifier: Add panic notifiers info and purge trailing whitespaces

2022-08-24 Thread Guilherme G. Piccoli
Although many notifiers are mentioned in the comments, the panic notifiers infrastructure is not. Also, the file contains some trailing whitespaces. Fix both issues here. Cc: Arjan van de Ven Cc: Cong Wang Cc: Sebastian Andrzej Siewior Cc: Valentin Schneider Cc: Xiaoming Ni Reviewed-by:

[PATCH V3 01/11] ARM: Disable FIQs (but not IRQs) on CPUs shutdown paths

2022-08-24 Thread Guilherme G. Piccoli
Currently the regular CPU shutdown path for ARM disables IRQs/FIQs in the secondary CPUs - smp_send_stop() calls ipi_cpu_stop(), which is responsible for that. IRQs are architecturally masked when we take an interrupt, but FIQs are high priority than IRQs, hence they aren't masked. With that said,

[PATCH V3 06/11] tracing: Improve panic/die notifiers

2022-08-24 Thread Guilherme G. Piccoli
Currently the tracing dump_on_oops feature is implemented through separate notifiers, one for die/oops and the other for panic; given they have the same functionality, let's unify them. Also improve the function comment and change the priority of the notifier to make it execute earlier, avoiding

[PATCH V3 11/11] panic: Fixes the panic_print NMI backtrace setting

2022-08-24 Thread Guilherme G. Piccoli
Commit 8d470a45d1a6 ("panic: add option to dump all CPUs backtraces in panic_print") introduced a setting for the "panic_print" kernel parameter to allow users to request a NMI backtrace on panic. Problem is that the panic_print handling happens after the secondary CPUs are already disabled,

[PATCH V3 07/11] notifiers: Add tracepoints to the notifiers infrastructure

2022-08-24 Thread Guilherme G. Piccoli
Currently there is no way to show the callback names for registered, unregistered or executed notifiers. This is very useful for debug purposes, hence add this functionality here in the form of notifiers' tracepoints, one per operation. Cc: Arjan van de Ven Cc: Cong Wang Cc: Sebastian Andrzej

[PATCH V3 00/11] The panic notifiers refactor - fixes/clean-ups (V3)

2022-08-24 Thread Guilherme G. Piccoli
Hey everybody, this the third iteration of the panic notifiers fixes/clean-ups; V2 available at: https://lore.kernel.org/lkml/20220719195325.402745-1-gpicc...@igalia.com/ V1 (including the refactor) available at: https://lore.kernel.org/lkml/20220427224924.592546-1-gpicc...@igalia.com/ There

[PATCH V3 03/11] alpha: Clean-up the panic notifier code

2022-08-24 Thread Guilherme G. Piccoli
The alpha panic notifier has some code issues, not following the conventions of other notifiers. Also, it might halt the machine but still it is set to run as early as possible, which doesn't seem to be a good idea. So, let's clean the code and set the notifier to run as the latest, following the

[PATCH V3 10/11] drivers/hv/vmbus, video/hyperv_fb: Untangle and refactor Hyper-V panic notifiers

2022-08-24 Thread Guilherme G. Piccoli
Currently Hyper-V guests are among the most relevant users of the panic infrastructure, like panic notifiers, kmsg dumpers, etc. The reasons rely both in cleaning-up procedures (closing hypervisor <-> guest connection, disabling some paravirtualized timer) as well as to data collection (sending

[PATCH V3 04/11] um: Improve panic notifiers consistency and ordering

2022-08-24 Thread Guilherme G. Piccoli
Currently the panic notifiers from user mode linux don't follow the convention for most of the other notifiers present in the kernel (indentation, priority setting, numeric return). More important, the priorities could be improved, since it's a special case (userspace), hence we could run the

[PATCH V3 05/11] parisc: Replace regular spinlock with spin_trylock on panic path

2022-08-24 Thread Guilherme G. Piccoli
The panic notifiers' callbacks execute in an atomic context, with interrupts/preemption disabled, and all CPUs not running the panic function are off, so it's very dangerous to wait on a regular spinlock, there's a risk of deadlock. Refactor the panic notifier of parisc/power driver to make use

[PATCH V3 08/11] EDAC/altera: Skip the panic notifier if kdump is loaded

2022-08-24 Thread Guilherme G. Piccoli
The altera_edac panic notifier performs some data collection with regards errors detected; such code relies in the regmap layer to perform reads/writes, so the code is abstracted and there is some risk level to execute that, since the panic path runs in atomic context, with interrupts/preemption

Re: [PATCH V3 0/9] Support RISCV64 arch and common commands

2022-08-24 Thread Xianting Tian
在 2022/8/22 下午3:28, Yixun Lan 写道: Hi lijiang On Mon, Aug 22, 2022 at 3:56 AM lijiang wrote: Hi, Xianting Thank you for the update. On Sat, Aug 13, 2022 at 11:18 AM Xianting Tian wrote: This series of patches are for Crash-utility tool, it make crash tool support RISCV64 arch and the