[Kgdb-bugreport] [PATCH 2/3] Revert "kdb: Implement disable_nmi command"

2025-01-29 Thread Douglas Anderson
ff-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 37 - 1 file changed, 37 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 5f4be507d79f..3a5408b54570 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debu

[Kgdb-bugreport] [PATCH 0/3] kdb: Delete never used KGDB NMI code

2025-01-29 Thread Douglas Anderson
ail.com [2] https://lore.kernel.org/lkml/1348522080-32629-9-git-send-email-anton.voront...@linaro.org/ Douglas Anderson (3): Revert "tty/serial: Add kgdb_nmi driver" Revert "kdb: Implement disable_nmi command" Revert "kernel/debug: Mask KGDB NMI upon entry" drivers/tt

[Kgdb-bugreport] [PATCH 3/3] Revert "kernel/debug: Mask KGDB NMI upon entry"

2025-01-29 Thread Douglas Anderson
ff-by: Douglas Anderson --- include/linux/kgdb.h | 3 --- kernel/debug/debug_core.c | 14 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 14739952698b..5eebbe7a3545 100644 --- a/include/linux/kgdb.h +++ b/in

[Kgdb-bugreport] [PATCH 1/3] Revert "tty/serial: Add kgdb_nmi driver"

2025-01-29 Thread Douglas Anderson
" is not defined. No architectures define it. [1] https://lore.kernel.org/lkml/1348522080-32629-9-git-send-email-anton.voront...@linaro.org/ Signed-off-by: Douglas Anderson --- drivers/tty/serial/Kconfig| 19 --- drivers/tty/serial/Makefile | 1 - drivers/tt

[Kgdb-bugreport] [PATCH 03/13] kdb: Use "bool" in "md" implementation where appropriate

2024-06-17 Thread Douglas Anderson
uot; functions to use "bool". While touching this, we touch a line next to a comment using a style that's nonstandard for the kdb codebase. Update it in passing. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 36 +--- 1 file cha

[Kgdb-bugreport] [PATCH 12/13] kdb: Add mdpW / mdpWcN commands

2024-06-17 Thread Douglas Anderson
When specifying a physical address allow specifying the word side and the number of words. NOTE: we don't do this for the "mds" command since it's pretty much a different beast. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 16 ++--

[Kgdb-bugreport] [PATCH 11/13] kdb: Abstract out parsing for mdWcN

2024-06-17 Thread Douglas Anderson
We'd like to use the "WcN" parsing for some other "md" variants. Abstract it out. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 55 +++-- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/kernel/debu

[Kgdb-bugreport] [PATCH 09/13] kdb: Use 'unsigned int' in kdb_md() where appropriate

2024-06-17 Thread Douglas Anderson
Several of the integers in kdb_md() should be marked unsigned. Mark them as such. When doing this, we need to add an explicit cast to the address masking or it ends up getting truncated down to "int" size. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 10 +---

[Kgdb-bugreport] [PATCH 07/13] kdb: Tweak "repeat" handling code for "mdW" and "mdWcN"

2024-06-17 Thread Douglas Anderson
and "mdWcN" handling. This breaks the above case where the user tweaked "argv[0]" and then tried to somehow leverage the "repeat" code to do something smart, but that feels like it was a misfeature anyway. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/k

[Kgdb-bugreport] [PATCH 05/13] kdb: Separate out "mdr" handling

2024-06-17 Thread Douglas Anderson
Though the "mdr" has a similar purpose to the other "md" commands in that they all display memory, the actual code to implement it has almost nothing in common with the rest of the commands. Separate things out. Signed-off-by: Douglas Anderson --- kernel/debug

[Kgdb-bugreport] [PATCH 01/13] kdb: Get rid of "minlen" for the "md" command

2024-06-17 Thread Douglas Anderson
n't really unique (it could be the prefix for "mm" also) and it's only saving one letter. Remove the setting of "minlen" to 1 for "md". Signed-off-by: Douglas Anderson --- While digging into this, I found that "minlen" doesn't seem to mean

[Kgdb-bugreport] [PATCH 06/13] kdb: Remove "mdW" and "mdWcN" handling of "W" == 0

2024-06-17 Thread Douglas Anderson
00 ... This doesn't seem like particularly useful behavior and adds a bunch of complexity to the arg parsing. Remove it. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 5 - 1 file changed, 5 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb

[Kgdb-bugreport] [PATCH 13/13] kdb: Add mdi, mdiW / mdiWcN commands to show iomapped memory

2024-06-17 Thread Douglas Anderson
Add commands that are like the other "md" commands but that allow you to read memory that's in the IO space. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c| 38 +++ kernel/debug/kdb/kdb_private.h | 1 + kernel/debug/kdb/kdb

[Kgdb-bugreport] [PATCH 02/13] kdb: Document the various "md" commands better

2024-06-17 Thread Douglas Anderson
re obvious. As part of this, add "bogus" commands to the table for "mdW" and "mdWcN" so we don't have to obscurely reference them in the normal "md" help. These bogus commands don't really hurt since kdb_md() validate

[Kgdb-bugreport] [PATCH 08/13] kdb: In kdb_md() make `repeat` and `mdcount` calculations more obvious

2024-06-17 Thread Douglas Anderson
logic more obvious by initializing `repeat` to 0 and then setting it to non-zero when it should override. Then we can do all the math at once. While changing this, use the proper DIV_ROUND_UP() macro and introcue a constant for KDB_MD_BYTES_PER_LINE. We'll also make and "if else" more obv

[Kgdb-bugreport] [PATCH 10/13] kdb: Replease simple_strtoul() with kstrtouint() in kdb_md()

2024-06-17 Thread Douglas Anderson
The docs say you should use kstrtouint() instead of simple_strtoul(), so do so. This nicely simplfies the code a little. Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_main.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b

[Kgdb-bugreport] [PATCH 00/13] kdb: Add the ability to read iomapped memory via kdb + clean up "md" commands

2024-06-17 Thread Douglas Anderson
the weird corners. I have a hard time believing anyone was relying on these, but if you think someone is then please yell. Also note that it would probably be good to add iomapped memory writes, but this series is already pretty long so maybe that can be done later. Douglas Anderson (13): kdb

[Kgdb-bugreport] [PATCH 04/13] kdb: Drop "offset" and "name" args to kdbgetaddrarg()

2024-06-17 Thread Douglas Anderson
Every caller to kdbgetaddrarg() didn't care about the "offset" and "name" returned by the function. Some passed NULL and some passed the address of a bogus local variable that was never looked at. Drop the arguments. Signed-off-by: Douglas Anderson --- kernel/deb

[Kgdb-bugreport] [PATCH] kdb: Use the passed prompt in kdb_position_cursor()

2024-05-28 Thread Douglas Anderson
ion. This patch is expected to functionally be a no-op. Fixes: 09b35989421d ("kdb: Use format-strings rather than '\0' injection in kdb_read()") Signed-off-by: Douglas Anderson --- kernel/debug/kdb/kdb_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ker

[Kgdb-bugreport] [PATCH v13 1/7] irqchip/gic-v3: Enable support for SGIs to act as NMIs

2023-09-06 Thread Douglas Anderson
c_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Acked-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- I'll note that this change is a little more black magic to me than othe

[Kgdb-bugreport] [PATCH v13 5/7] arm64: smp: IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI

2023-09-06 Thread Douglas Anderson
eviewed-by: Sumit Garg Acked-by: Mark Rutland Tested-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- This patch is tested by Mark Rutland's LKDTM test [1]. [1] http://lore.kernel.org/lkml/20230831101026.3122590-1-mark.rutl...@arm.com (no changes since v10)

[Kgdb-bugreport] [PATCH v13 2/7] arm64: idle: Tag the arm64 idle functions as __cpuidle

2023-09-06 Thread Douglas Anderson
x30c Acked-by: Mark Rutland Reviewed-by: Stephen Boyd Acked-by: Sumit Garg Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- (no changes since v11) Changes in v11: - Updated commit message as per Stephen. Changes in v9: - Added to commit message that this doesn't catch all cases.

[Kgdb-bugreport] [PATCH v13 3/7] arm64: smp: Remove dedicated wakeup IPI

2023-09-06 Thread Douglas Anderson
redundant IPI_RESCHEDULE IPIs, so there should be no functional impact as a result of this change. Signed-off-by: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Sumit Garg Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Cc: Catalin Marinas Cc: Marc Zyngier Cc: Will Deacon --- I have no i

[Kgdb-bugreport] [PATCH v13 0/7] arm64: Add IPI for backtraces / kgdb; try to use NMI for some IPIs

2023-09-06 Thread Douglas Anderson
- Moved header file out of "include" since it didn't need to be there. - Remove arm64_supports_nmi() - Remove fallback for when debug IPI isn't available. - Renamed "NMI IPI" to "debug IPI" since it might not be backed by NMI. - arch_trigger_cpumask_backtrace() no l

[Kgdb-bugreport] [PATCH v13 6/7] arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup

2023-09-06 Thread Douglas Anderson
Garg Signed-off-by: Sumit Garg Reviewed-by: Daniel Thompson Reviewed-by: Stephen Boyd Acked-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- (no changes since v10) Changes in v10: - Don't allocate the cpumask on the stack; just iterate. - Moved kgdb calls to

[Kgdb-bugreport] [PATCH v13 4/7] arm64: smp: Add arch support for backtrace using pseudo-NMI

2023-09-06 Thread Douglas Anderson
y: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Misono Tomohiro Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- (no changes since v12) Changes in v12: - Minor comment change to add "()" after nmi_trigger_cpumask_backtrace. - Updated the commit hash of the commit this de

[Kgdb-bugreport] [PATCH v13 7/7] arm64: smp: Mark IPI globals as __ro_after_init

2023-09-06 Thread Douglas Anderson
tland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- This patch is almost completely unrelated to the rest of the series other than the fact that it would cause a merge conflict with the series if sent separately. I tacked it on to this series in response to Stephen's feedback on v11 o

[Kgdb-bugreport] [PATCH v12 5/7] arm64: smp: IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI

2023-08-30 Thread Douglas Anderson
eviewed-by: Sumit Garg Signed-off-by: Douglas Anderson --- I don't actually have any good way to test/validate this patch. It's added to the series at Mark's request. (no changes since v10) Changes in v10: - ("IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI") new for

[Kgdb-bugreport] [PATCH v12 7/7] arm64: smp: Mark IPI globals as __ro_after_init

2023-08-30 Thread Douglas Anderson
Mark the three IPI-related globals in smp.c as "__ro_after_init" since they are only ever set in set_smp_ipi_range(), which is marked "__init". This is a better and more secure marking than the old "__read_mostly". Suggested-by: Stephen Boyd Signed-off-by: Dougl

[Kgdb-bugreport] [PATCH v12 4/7] arm64: smp: Add arch support for backtrace using pseudo-NMI

2023-08-30 Thread Douglas Anderson
y: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Misono Tomohiro Signed-off-by: Douglas Anderson --- Changes in v12: - Minor comment change to add "()" after nmi_trigger_cpumask_backtrace. - Updated the commit hash of the commit this depends on. Changes in v11: - Adjust comment abou

[Kgdb-bugreport] [PATCH v12 6/7] arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup

2023-08-30 Thread Douglas Anderson
Garg Signed-off-by: Sumit Garg Reviewed-by: Daniel Thompson Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson --- I debated whether this should be in "arch/arm64/kernel/smp.c" or if I should try to find a way for it to go into "arch/arm64/kernel/kgdb.c". In the end th

[Kgdb-bugreport] [PATCH v12 2/7] arm64: idle: Tag the arm64 idle functions as __cpuidle

2023-08-30 Thread Douglas Anderson
x30c Acked-by: Mark Rutland Reviewed-by: Stephen Boyd Acked-by: Sumit Garg Signed-off-by: Douglas Anderson --- (no changes since v11) Changes in v11: - Updated commit message as per Stephen. Changes in v9: - Added to commit message that this doesn't catch all cases. Changes in v8: - "T

[Kgdb-bugreport] [PATCH v12 0/7] arm64: Add IPI for backtraces / kgdb; try to use NMI for some IPIs

2023-08-30 Thread Douglas Anderson
g IPI isn't available. - Renamed "NMI IPI" to "debug IPI" since it might not be backed by NMI. - arch_trigger_cpumask_backtrace() no longer returns bool Changes in v8: - "Tag the arm64 idle functions as __cpuidle" new for v8 - Removed "#ifdef CONFIG_SMP" sin

[Kgdb-bugreport] [PATCH v12 3/7] arm64: smp: Remove dedicated wakeup IPI

2023-08-30 Thread Douglas Anderson
redundant IPI_RESCHEDULE IPIs, so there should be no functional impact as a result of this change. Signed-off-by: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Sumit Garg Signed-off-by: Douglas Anderson Cc: Catalin Marinas Cc: Marc Zyngier Cc: Will Deacon --- I have no idea how to test this. I

[Kgdb-bugreport] [PATCH v12 1/7] irqchip/gic-v3: Enable support for SGIs to act as NMIs

2023-08-30 Thread Douglas Anderson
c_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- I'll note that this change is a little more black magic to me than others in this series. I don't have a massive am

[Kgdb-bugreport] [PATCH v11 6/6] arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup

2023-08-24 Thread Douglas Anderson
Garg Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- I debated whether this should be in "arch/arm64/kernel/smp.c" or if I should try to find a way for it to go into "arch/arm64/kernel/kgdb.c". In the end this is so little code that it didn't seem worth it

[Kgdb-bugreport] [PATCH v11 2/6] arm64: idle: Tag the arm64 idle functions as __cpuidle

2023-08-24 Thread Douglas Anderson
x30c Acked-by: Mark Rutland Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson --- Changes in v11: - Updated commit message as per Stephen. Changes in v9: - Added to commit message that this doesn't catch all cases. Changes in v8: - "Tag the arm64 idle functions as __cpuidle&q

[Kgdb-bugreport] [PATCH v11 5/6] arm64: smp: IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI

2023-08-24 Thread Douglas Anderson
There's no reason why IPI_CPU_STOP and IPI_CPU_CRASH_STOP can't be handled as NMI. They are very simple and everything in them is NMI-safe. Mark them as things to use NMI for if NMI is available. Suggested-by: Mark Rutland Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson -

[Kgdb-bugreport] [PATCH v11 3/6] arm64: smp: Remove dedicated wakeup IPI

2023-08-24 Thread Douglas Anderson
redundant IPI_RESCHEDULE IPIs, so there should be no functional impact as a result of this change. Signed-off-by: Mark Rutland Signed-off-by: Douglas Anderson Cc: Catalin Marinas Cc: Marc Zyngier Cc: Sumit Garg Cc: Will Deacon --- I have no idea how to test this. I just took Mark's patch and ja

[Kgdb-bugreport] [PATCH v11 1/6] irqchip/gic-v3: Enable support for SGIs to act as NMIs

2023-08-24 Thread Douglas Anderson
c_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- In v10 I removed the previous Reviewed-by and Tested-by tags since the patch contents changed pretty drastically. I'll

[Kgdb-bugreport] [PATCH v11 0/6] arm64: Add IPI for backtraces / kgdb; try to use NMI for some IPIs

2023-08-24 Thread Douglas Anderson
4_supports_nmi() - Remove fallback for when debug IPI isn't available. - Renamed "NMI IPI" to "debug IPI" since it might not be backed by NMI. - arch_trigger_cpumask_backtrace() no longer returns bool Changes in v8: - "Tag the arm64 idle functions as __cpuidle"

[Kgdb-bugreport] [PATCH v11 4/6] arm64: smp: Add arch support for backtrace using pseudo-NMI

2023-08-24 Thread Douglas Anderson
Rutland Signed-off-by: Douglas Anderson --- Changes in v11: - Adjust comment about NR_IPI/MAX_IPI. - Don't use confusing "backed by" idiom in comment. - Made arm64_backtrace_ipi() static. Changes in v10: - Backtrace now directly supported in smp.c - Squash backtrace into patch

[Kgdb-bugreport] [PATCH v10 6/6] arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup

2023-08-22 Thread Douglas Anderson
Garg Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- I debated whether this should be in "arch/arm64/kernel/smp.c" or if I should try to find a way for it to go into "arch/arm64/kernel/kgdb.c". In the end this is so little code that it didn't seem worth it

[Kgdb-bugreport] [PATCH v10 5/6] arm64: smp: IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI

2023-08-22 Thread Douglas Anderson
There's no reason why IPI_CPU_STOP and IPI_CPU_CRASH_STOP can't be handled as NMI. They are very simple and everything in them is NMI-safe. Mark them as things to use NMI for if NMI is available. Suggested-by: Mark Rutland Signed-off-by: Douglas Anderson --- I don't actually ha

[Kgdb-bugreport] [PATCH v10 1/6] irqchip/gic-v3: Enable support for SGIs to act as NMIs

2023-08-22 Thread Douglas Anderson
c_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- In v10 I removed the previous Reviewed-by and Tested-by tags since the patch contents changed pretty drastically. I'll

[Kgdb-bugreport] [PATCH v10 4/6] arm64: smp: Add arch support for backtrace using pseudo-NMI

2023-08-22 Thread Douglas Anderson
Rutland Signed-off-by: Douglas Anderson --- Changes in v10: - Backtrace now directly supported in smp.c - Squash backtrace into patch adding support for pseudo-NMI IPIs. Changes in v9: - Added comments that we might not be using NMI always. - Fold in v8 patch #10 ("Fallback to a regu

[Kgdb-bugreport] [PATCH v10 3/6] arm64: smp: Remove dedicated wakeup IPI

2023-08-22 Thread Douglas Anderson
redundant IPI_RESCHEDULE IPIs, so there should be no functional impact as a result of this change. Signed-off-by: Mark Rutland Signed-off-by: Douglas Anderson Cc: Catalin Marinas Cc: Marc Zyngier Cc: Sumit Garg Cc: Will Deacon --- I have no idea how to test this. I just took Mark's patch and ja

[Kgdb-bugreport] [PATCH v10 2/6] arm64: idle: Tag the arm64 idle functions as __cpuidle

2023-08-22 Thread Douglas Anderson
Rutland Signed-off-by: Douglas Anderson --- (no changes since v9) Changes in v9: - Added to commit message that this doesn't catch all cases. Changes in v8: - "Tag the arm64 idle functions as __cpuidle" new for v8 arch/arm64/kernel/idle.c | 4 ++-- 1 file changed, 2 insertio

[Kgdb-bugreport] [PATCH v10 0/6] arm64: Add IPI for backtraces / kgdb; try to use NMI for some IPIs

2023-08-22 Thread Douglas Anderson
uot;NMI IPI" to "debug IPI" since it might not be backed by NMI. - arch_trigger_cpumask_backtrace() no longer returns bool Changes in v8: - "Tag the arm64 idle functions as __cpuidle" new for v8 - Removed "#ifdef CONFIG_SMP" since arm64 is always SMP - debug_ipi

[Kgdb-bugreport] [PATCH] kgdb: Flush console before entering kgdb on panic

2023-08-22 Thread Douglas Anderson
PANIC print. Let's replicate the commands to flush the console in the kdb panic entry point to avoid this. Signed-off-by: Douglas Anderson --- kernel/debug/debug_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index d5e9ccde3a

[Kgdb-bugreport] [PATCH] kdb: Handle LF in the command parser

2023-06-28 Thread Douglas Anderson
; out of uart_poll_put_char(). Having that conversion at such a low level could interfere if we ever want to transfer binary data. In addition, if we truly made uart_poll_get_char() the inverse of uart_poll_put_char() it would convert back to '\n' and (ironically) kdb's parse

[Kgdb-bugreport] [PATCH v9 5/7] arm64: ipi_debug: Add support for backtrace using the debug IPI

2023-06-01 Thread Douglas Anderson
le is `kernel.softlockup_all_cpu_backtrace`. This also allows us to backtrace hard locked up CPUs in cases where the debug IPI is backed by an NMI (or pseudo NMI). Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- Changes in v9: - Added comments that we might not be using NMI always. - Renamed &qu

[Kgdb-bugreport] [PATCH v9 4/7] arm64: smp: Assign and setup the debug IPI

2023-06-01 Thread Douglas Anderson
Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- I could imagine that people object to using up the last free IPI on interrupt controllers with only 8 IPIs. However, it shouldn't be a big deal. If we later need an extra IPI, it shouldn't be too hard to combine some of the

[Kgdb-bugreport] [PATCH v9 7/7] arm64: kgdb: Roundup cpus using the debug IPI

2023-06-01 Thread Douglas Anderson
l work. Signed-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- Changes in v9: - Remove fallback for when debug IPI isn't available. - Renamed "NMI IPI" to "debug IPI" since it might not be backed by NMI. arch/arm64/kernel/ipi_debug.c | 5 + arch/arm64/k

[Kgdb-bugreport] [PATCH v9 6/7] kgdb: Provide a stub kgdb_nmicallback() if !CONFIG_KGDB

2023-06-01 Thread Douglas Anderson
To save architectures from needing to wrap the call in #ifdefs, add a stub no-op version of kgdb_nmicallback(), which returns 1 if it didn't handle anything. Reviewed-by: Daniel Thompson Signed-off-by: Douglas Anderson --- In v9 this is the only kgdb dependency. I'm assuming it could

[Kgdb-bugreport] [PATCH v9 3/7] arm64: Add framework for a debug IPI

2023-06-01 Thread Douglas Anderson
ned-off-by: Sumit Garg Signed-off-by: Douglas Anderson --- I didn't get any feedback from v8 patch #10 [1], but I went ahead and folded it in here anyway since it really simplfies things. If people don't like the fallback to regular IPI, I can also undo it. [1] https://lore.kernel.org/r/

[Kgdb-bugreport] [PATCH v9 1/7] irqchip/gic-v3: Enable support for SGIs to act as NMIs

2023-06-01 Thread Douglas Anderson
this routine. Signed-off-by: Sumit Garg Reviewed-by: Masayoshi Mizuma Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- (no changes since v1) drivers/irqchip/irq-gic-v3.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip

[Kgdb-bugreport] [PATCH v9 0/7] arm64: Add debug IPI for backtraces / kgdb; try to use NMI for it

2023-06-01 Thread Douglas Anderson
h_trigger_cpumask_backtrace() no longer returns bool Changes in v8: - "Provide a stub kgdb_nmicallback() if !CONFIG_KGDB" new for v8 - "Tag the arm64 idle functions as __cpuidle" new for v8 - Removed "#ifdef CONFIG_SMP" since arm64 is always SMP - debug_ipi_setup() and debug

[Kgdb-bugreport] [PATCH v9 2/7] arm64: idle: Tag the arm64 idle functions as __cpuidle

2023-06-01 Thread Douglas Anderson
ing looked like this: gic_cpu_sys_reg_init+0x1f8/0x314 gic_cpu_pm_notifier+0x40/0x78 raw_notifier_call_chain+0x5c/0x134 cpu_pm_notify+0x38/0x64 cpu_pm_exit+0x20/0x2c psci_enter_idle_state+0x48/0x70 cpuidle_enter_state+0xb8/0x260 cpuidle_enter+0x44/0x5c do_idle+0x188/0x30c Signed-off-

[Kgdb-bugreport] [PATCH 08/10] watchdog/buddy: Simplify the dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY

2023-05-26 Thread Douglas Anderson
The dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY was more complicated than it needed to be. If the "perf" detector is available and we have SMP then we have a choice, so enable the config based on just those two config items. Suggested-by: Petr Mladek Signed-off-by: Dougla

[Kgdb-bugreport] [PATCH 10/10] watchdog/hardlockup: Rename HAVE_HARDLOCKUP_DETECTOR_NON_ARCH to ..._PERF_OR_BUDDY

2023-05-26 Thread Douglas Anderson
HAVE_HARDLOCKUP_DETECTOR_NON_ARCH is a mouthful and confusing. HAVE_HARDLOCKUP_DETECTOR_PERF_OR_BUDDY is even more of a mouthful, but probably less confusing. Rename the Kconfig names. Signed-off-by: Douglas Anderson --- lib/Kconfig.debug | 12 ++-- 1 file changed, 6 insertions(+), 6

[Kgdb-bugreport] [PATCH 06/10] watchdog/buddy: Cleanup how watchdog_buddy_check_hardlockup() is called

2023-05-26 Thread Douglas Anderson
t, so we should match types. Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson --- include/linux/nmi.h | 4 ++-- kernel/watchdog.c | 15 +++ kernel/watchdog_buddy.c | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/linux/nmi.h b/incl

[Kgdb-bugreport] [PATCH 07/10] watchdog/buddy: Don't copy the cpumask in watchdog_next_cpu()

2023-05-26 Thread Douglas Anderson
There's no reason to make a copy of the "watchdog_cpus" locally in watchdog_next_cpu(). Making a copy wouldn't make things any more race free and we're just reading the value so there's no need for a copy. Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson

[Kgdb-bugreport] [PATCH 05/10] watchdog/hardlockup: remove softlockup comment in touch_nmi_watchdog()

2023-05-26 Thread Douglas Anderson
In the patch ("watchdog/hardlockup: add comments to touch_nmi_watchdog()") we adjusted some comments for touch_nmi_watchdog(). The comment about the softlockup had a typo and were also felt to be too obvious. Remove it. Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson ---

[Kgdb-bugreport] [PATCH 09/10] watchdog/hardlockup: Move SMP barriers from common code to buddy code

2023-05-26 Thread Douglas Anderson
Signed-off-by: Douglas Anderson --- kernel/watchdog.c | 6 -- kernel/watchdog_buddy.c | 21 + 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 6cc46b8e3d07..a351ab0c35eb 100644 --- a/kernel/watchdog

[Kgdb-bugreport] [PATCH 04/10] watchdog/hardlockup: In watchdog_hardlockup_check() use cpumask_copy()

2023-05-26 Thread Douglas Anderson
Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson --- kernel/watchdog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 32dac8028753..85f4839b6faf 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c

[Kgdb-bugreport] [PATCH 03/10] watchdog/hardlockup: Don't use raw_cpu_ptr() in watchdog_hardlockup_kick()

2023-05-26 Thread Douglas Anderson
In the patch ("watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check()") there was no reason to use raw_cpu_ptr(). Using this_cpu_ptr() works fine. Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson --- kernel/watchdog.c | 2 +- 1 file changed, 1 inse

[Kgdb-bugreport] [PATCH 02/10] watchdog/hardlockup: HAVE_NMI_WATCHDOG must implement watchdog_hardlockup_probe()

2023-05-26 Thread Douglas Anderson
by: Petr Mladek Signed-off-by: Douglas Anderson --- Though this does fix a minor bug, I didn't mark this as "Fixes" because it's super minor. One could also argue that this wasn't a bug at all but simply was never an implemented feature. The code that added some amount

[Kgdb-bugreport] [PATCH 01/10] watchdog/hardlockup: Keep kernel.nmi_watchdog sysctl as 0444 if probe fails

2023-05-26 Thread Douglas Anderson
Implement init time detection of perf") Reported-by: Petr Mladek Closes: https://lore.kernel.org/r/ZHCn4hNxFpY5-9Ki@alley Signed-off-by: Douglas Anderson --- include/linux/nmi.h | 6 -- kernel/watchdog.c | 30 -- 2 files changed, 20 insertions(+), 16 del

[Kgdb-bugreport] [PATCH 00/10] watchdog: Cleanup / fixes after buddy series v5 reviews

2023-05-26 Thread Douglas Anderson
anup a few things that were pointed out in review. Douglas Anderson (10): watchdog/hardlockup: Keep kernel.nmi_watchdog sysctl as 0444 if probe fails watchdog/hardlockup: HAVE_NMI_WATCHDOG must implement watchdog_hardlockup_probe() watchdog/hardlockup: Don't use raw_cpu_ptr() in

[Kgdb-bugreport] [PATCH v5 13/18] watchdog/hardlockup: Have the perf hardlockup use __weak functions more cleanly

2023-05-20 Thread Douglas Anderson
we tried to add the buddy lockup detector which was not arch-specific but wanted to hook into those same functions. This is not expected to have any functional impact. Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- (no changes since v4) Changes in v4: - ("Have the perf ha

[Kgdb-bugreport] [PATCH v5 02/18] watchdog/perf: More properly prevent false positives with turbo modes

2023-05-20 Thread Douglas Anderson
itives with turbo modes") Signed-off-by: Douglas Anderson --- Changes in v5: - ("More properly prevent false ...") promoted to its own patch for v5. kernel/watchdog_hld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld

[Kgdb-bugreport] [PATCH v5 01/18] watchdog/perf: Define dummy watchdog_update_hrtimer_threshold() on correct config

2023-05-20 Thread Douglas Anderson
xes: 7edaeb6841df ("kernel/watchdog: Prevent false positives with turbo modes") Reviewed-by: Nicholas Piggin Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- Changes in v5: - Add Nicholas's explanation of why this didn't break builds. - watchdog_hardlockup_perf.c

[Kgdb-bugreport] [PATCH v5 05/18] watchdog/perf: Ensure CPU-bound context when creating hardlockup detector event

2023-05-20 Thread Douglas Anderson
to prevent mistakes when calling the code in another code path. Signed-off-by: Pingfan Liu Co-developed-by: Lecopzer Chen Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it

[Kgdb-bugreport] [PATCH v5 15/18] watchdog/perf: Add a weak function for an arch to detect if perf can use NMIs

2023-05-20 Thread Douglas Anderson
On arm64, NMI support needs to be detected at runtime. Add a weak function to the perf hardlockup detector so that an architecture can implement it to detect whether NMIs are available. Signed-off-by: Douglas Anderson --- While I won't object to this patch landing, I consider it part o

[Kgdb-bugreport] [PATCH v5 09/18] watchdog/hardlockup: Style changes to watchdog_hardlockup_check() / is_hardlockup()

2023-05-20 Thread Douglas Anderson
returns since it seemed more symmetric. Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- Changes in v5: - watchdog_hardlockup_dumped_stacks => watchdog_hardlockup_all_cpu_dumped - watchdog_hardlockup_processed => watchdog_hardlockup_warned Changes in v4: - ("Style ch

[Kgdb-bugreport] [PATCH v5 06/18] watchdog/hardlockup: Add comments to touch_nmi_watchdog()

2023-05-20 Thread Douglas Anderson
x27;d like to rename these functions but that is a fairly disruptive change touching a lot of drivers. After discussion [1] the plan is to defer this until a good time. [1] https://lore.kernel.org/r/ZFy0TX1tfhlH8gxj@alley Signed-off-by: Douglas Anderson --- Changes in v5: - No lon

[Kgdb-bugreport] [PATCH v5 17/18] arm64: add hw_nmi_get_sample_period for preparation of lockup detector

2023-05-20 Thread Douglas Anderson
arg Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts between my series and the one adding the arm64 perf hardlockup detec

[Kgdb-bugreport] [PATCH v5 18/18] arm64: Enable perf events based hard lockup detector

2023-05-20 Thread Douglas Anderson
initialized. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts

[Kgdb-bugreport] [PATCH v5 12/18] watchdog/hardlockup: Rename some "NMI watchdog" constants/function

2023-05-20 Thread Douglas Anderson
or, which isn't using NMIs. As part of this, we sanitized a few names for consistency. Signed-off-by: Douglas Anderson --- Changes in v5: - Found a few more names / comments to change. - Tried to make names more consistent as per v4 feedback. Changes in v4: - ("Rename some "NMI wa

[Kgdb-bugreport] [PATCH v5 08/18] watchdog/hardlockup: Move perf hardlockup checking/panic to common watchdog.c

2023-05-20 Thread Douglas Anderson
d as well. This change is expected to be a no-op. Signed-off-by: Douglas Anderson --- Changes in v5: - watchdog_hardlockup_interrupt_count() => watchdog_hardlockup_kick() - watchdog_hardlockup_is_lockedup() => is_hardlockup() Changes in v4: - ("Move perf hardlockup checking/panic ...&

[Kgdb-bugreport] [PATCH v5 04/18] watchdog/hardlockup: change watchdog_nmi_enable() to void

2023-05-20 Thread Douglas Anderson
From: Lecopzer Chen Nobody cares about the return value of watchdog_nmi_enable(), changing its prototype to void. Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Acked-by: Nicholas Piggin Signed-off-by: Douglas Anderson --- I yanked this patch from the

[Kgdb-bugreport] [PATCH v5 10/18] watchdog/hardlockup: Add a "cpu" param to watchdog_hardlockup_check()

2023-05-20 Thread Douglas Anderson
ted hrtimer_interrupts_saved, however, because we end up petting all affected CPUs to make sure the new and old CPU can't end up somehow read/write hrtimer_interrupts_saved at the same time. Signed-off-by: Douglas Anderson --- Changes in v5: - Don't dump stack on the buddy CPU if we f

[Kgdb-bugreport] [PATCH v5 14/18] watchdog/hardlockup: detect hard lockups using secondary (buddy) CPUs

2023-05-20 Thread Douglas Anderson
arm-kernel/20220903093415.15850-1-lecopzer.c...@mediatek.com/ Signed-off-by: Colin Cross Signed-off-by: Matthias Kaehlcke Signed-off-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Signed-off-by: Douglas Anderson --- This patch has been rebased in ChromeOS kernel trees many times, and each time

[Kgdb-bugreport] [PATCH v5 03/18] watchdog: remove WATCHDOG_DEFAULT

2023-05-20 Thread Douglas Anderson
From: Lecopzer Chen No reference to WATCHDOG_DEFAULT, remove it. Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts

[Kgdb-bugreport] [PATCH v5 16/18] watchdog/perf: Adapt the watchdog_perf interface for async model

2023-05-20 Thread Douglas Anderson
hen Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts between my series and the one adding the arm64 perf hardlockup detector, in case someone wanted to test them both together. As part

[Kgdb-bugreport] [PATCH v5 07/18] watchdog/perf: Rename watchdog_hld.c to watchdog_perf.c

2023-05-20 Thread Douglas Anderson
ewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- (no changes since v4) Changes in v4: - ("Rename watchdog_hld.c to watchdog_perf.c") new for v4. kernel/Makefile| 2 +- kernel/{watchdog_hld.c => watchdog_perf.c} | 2 +- 2 files changed

[Kgdb-bugreport] [PATCH v5 11/18] watchdog/hardlockup: Move perf hardlockup watchdog petting to watchdog.c

2023-05-20 Thread Douglas Anderson
that the CPU we're running on might be different than the one we're checking. Currently the code in watchdog.c is guarded by CONFIG_HARDLOCKUP_DETECTOR_PERF, which makes this change seem silly. However, a future patch will change this. Signed-off-by: Douglas Anderson --- Changes in v

[Kgdb-bugreport] [PATCH v4 02/17] watchdog: remove WATCHDOG_DEFAULT

2023-05-04 Thread Douglas Anderson
From: Lecopzer Chen No reference to WATCHDOG_DEFAULT, remove it. Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts

[Kgdb-bugreport] [PATCH v4 17/17] arm64: Enable perf events based hard lockup detector

2023-05-04 Thread Douglas Anderson
initialized. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts

[Kgdb-bugreport] [PATCH v4 16/17] arm64: add hw_nmi_get_sample_period for preparation of lockup detector

2023-05-04 Thread Douglas Anderson
arg Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts between my series and the one adding the arm64 perf hardlockup detec

[Kgdb-bugreport] [PATCH v4 15/17] watchdog/perf: Adapt the watchdog_perf interface for async model

2023-05-04 Thread Douglas Anderson
hen Suggested-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts between my series and the one adding the arm64 perf hardlockup detector, in case someone wanted to test them both together. As part

[Kgdb-bugreport] [PATCH v4 04/17] watchdog/perf: Ensure CPU-bound context when creating hardlockup detector event

2023-05-04 Thread Douglas Anderson
to prevent mistakes when calling the code in another code path. Signed-off-by: Pingfan Liu Co-developed-by: Lecopzer Chen Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it

[Kgdb-bugreport] [PATCH v4 06/17] watchdog/perf: Rename watchdog_hld.c to watchdog_perf.c

2023-05-04 Thread Douglas Anderson
f. It could be argued that the new name makes it less obvious that this is a hardlockup detector. While true, it's not hard to remember that the "perf" detector is always a hardlockup detector and it's nice not to have names that are too convoluted. Signed-off-by: Douglas Ander

[Kgdb-bugreport] [PATCH v4 12/17] watchdog/hardlockup: Have the perf hardlockup use __weak functions more cleanly

2023-05-04 Thread Douglas Anderson
we tried to add the buddy lockup detector which was not arch-specific but wanted to hook into those same functions. This is not expected to have any functional impact. Signed-off-by: Douglas Anderson --- Changes in v4: - ("Have the perf hardlockup use __weak ...") new for v4. includ

[Kgdb-bugreport] [PATCH v4 08/17] watchdog/hardlockup: Style changes to watchdog_hardlockup_check() / ..._is_lockedup()

2023-05-04 Thread Douglas Anderson
rns since it seemed more symmetric. Signed-off-by: Douglas Anderson --- Changes in v4: - ("Style changes to watchdog_hardlockup_check ...") new for v4. kernel/watchdog.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/kernel/wat

[Kgdb-bugreport] [PATCH v4 03/17] watchdog/hardlockup: change watchdog_nmi_enable() to void

2023-05-04 Thread Douglas Anderson
From: Lecopzer Chen Nobody cares about the return value of watchdog_nmi_enable(), changing its prototype to void. Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my

[Kgdb-bugreport] [PATCH v4 14/17] watchdog/perf: Add a weak function for an arch to detect if perf can use NMIs

2023-05-04 Thread Douglas Anderson
On arm64, NMI support needs to be detected at runtime. Add a weak function to the perf hardlockup detector so that an architecture can implement it to detect whether NMIs are available. Signed-off-by: Douglas Anderson --- While I won't object to this patch landing, I consider it part o

[Kgdb-bugreport] [PATCH v4 10/17] watchdog/hardlockup: Move perf hardlockup watchdog petting to watchdog.c

2023-05-04 Thread Douglas Anderson
pets super fast. The new behavior of handling super-fast perf before clearing watchdog pets seems better. Signed-off-by: Douglas Anderson --- Changes in v4: - ("Move perf hardlockup watchdog petting to watchdog.c") new for v4. include/linux/nmi.h| 5 +++-

[Kgdb-bugreport] [PATCH v4 07/17] watchdog/hardlockup: Move perf hardlockup checking/panic to common watchdog.c

2023-05-04 Thread Douglas Anderson
ounting to only be there if the perf hardlockup detector is configured as well. This change is expected to be a no-op. Signed-off-by: Douglas Anderson --- Changes in v4: - ("Move perf hardlockup checking/panic ...") new for v4. include/linux/nmi.h| 5 ++- kernel/watchdog.c

  1   2   3   >