Re: [Kgdb-bugreport] [PATCH v2] arm64: kgdb: handle read-only text / modules

2016-09-21 Thread Mark Rutland
# 3.18-3.19: 2f896d5: arm64: use fixmap > Cc: <sta...@vger.kernel.org> # 4.0- For v3.18-v3.19, we also need commit f6242cac10427c54 ("arm64: Fix text patching logic when using fixmap"), so as to not break the !CONFIG_DEBUG_SET_MODULE_RONX case. With that: Reviewed-by: Mark Rutlan

Re: [Kgdb-bugreport] [PATCH] arm64: kgdb: handle read-only text / modules

2016-09-20 Thread Mark Rutland
On Tue, Sep 20, 2016 at 07:03:21PM +0900, AKASHI Takahiro wrote: > Handle read-only cases (CONFIG_DEBUG_RODATA/CONFIG_DEBUG_SET_MODULE_RONX) > by using aarch64_insn_write() instead of probe_kernel_write(). > See how this works: > commit 2f896d586610 ("arm64: use fixmap for text patching") > >

Re: [Kgdb-bugreport] Possible to annotate ARM64 IRQ handling to help gdb?

2019-02-05 Thread Mark Rutland
On Fri, Feb 01, 2019 at 01:38:05PM -0800, Doug Anderson wrote: > Hi, Hi Doug, > I was wondering if anyone out there has given any thought to > annotating the ARM64 IRQ handling in such a way that we could stack > crawl past el1_irq() when in gdb. > > I spent a bit of time on this a few months

Re: [Kgdb-bugreport] [PATCH 3/6] sched, perf, kvm: Fix preemption condition

2021-06-02 Thread Mark Rutland
amp;& current->on_rq) { > > > > This changes from checking task->state to current->on_rq, but this change > > from "task" to "current" is not described in the commit message, which is > > odd. > > > > Are we rea

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

2023-08-31 Thread Mark Rutland
gned-off-by. I certainly won't object. That's all reasonable, and I'm perfectly happy without a tag. I have one trivial nit below, but with or without that fixed up: Acked-by: Mark Rutland > > [1] https://lore.kernel.org/r/znc-yrqopo0pa...@fvff77s0q05n.cambridge.arm.com > > Chan

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

2023-08-31 Thread Mark Rutland
t out an LKDTM test that can be used to test this: http://lore.kernel.org/lkml/20230831101026.3122590-1-mark.rutl...@arm.com So FWIW: Acked-by: Mark Rutland Tested-by: Mark Rutland Mark. > > (no changes since v10) > > Changes in v10: > - ("IPI_CPU_STOP and IPI_CPU_CRASH

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

2023-08-31 Thread Mark Rutland
and smp.c. If someone has strong feelings and wants > this to change, please shout and give details of your preferred > solution. Putting this in smp.c seems fine to me. Acked-by: Mark Rutland Mark. > > FWIW, it seems like ~half the other platforms put this in "smp.c" with >

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

2023-08-31 Thread Mark Rutland
> (resolving merge conflicts). > > [1] > https://lore.kernel.org/r/cae-0n52ivdgza8xt8ktmj12c_essjt7f7a0fuz_oammqpgc...@mail.gmail.com This looks reasonable to me, so: Acked-by: Mark Rutland Mark. > > Changes in v12: > - ("arm64: smp: Mark IPI globals as __ro_after_init") new for v12. > >

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

2023-08-31 Thread Mark Rutland
On Thu, Aug 31, 2023 at 08:31:37AM -0700, Doug Anderson wrote: > Hi, > > On Thu, Aug 31, 2023 at 1:53 AM Mark Rutland wrote: > > > > On Wed, Aug 30, 2023 at 12:11:22PM -0700, Douglas Anderson wrote: > > > As of commit 6abbd6988971 ("

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

2023-08-22 Thread Mark Rutland
On Mon, Aug 21, 2023 at 05:06:50PM -0700, Doug Anderson wrote: > On Mon, Aug 7, 2023 at 3:23 AM Mark Rutland wrote: > > On Thu, Jun 01, 2023 at 02:31:49PM -0700, Douglas Anderson wrote: > > > From: Sumit Garg > > > static irqreturn_t ipi_debug_

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

2023-08-22 Thread Mark Rutland
On Mon, Aug 21, 2023 at 03:16:56PM -0700, Doug Anderson wrote: > Hi, > > On Mon, Aug 7, 2023 at 3:12 AM Mark Rutland wrote: > > > > On Thu, Jun 01, 2023 at 02:31:47PM -0700, Douglas Anderson wrote: > > > From: Sumit Garg > > > > > > Introduce a

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

2023-06-12 Thread Mark Rutland
On Fri, May 19, 2023 at 10:18:39AM -0700, Douglas Anderson wrote: > 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 >

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

2023-06-12 Thread Mark Rutland
On Mon, Jun 12, 2023 at 06:55:37AM -0700, Doug Anderson wrote: > Mark, > > On Mon, Jun 12, 2023 at 3:33 AM Mark Rutland wrote: > > > > On Fri, May 19, 2023 at 10:18:39AM -0700, Douglas Anderson wrote: > > > On arm64, NMI support needs to be detected at runt

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

2023-08-07 Thread Mark Rutland
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-by: Douglas Anderson I don't have strong feelings either way for this, so: Acked-by: Mark Rutland Thanks, Mark. > --- >

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

2023-08-07 Thread Mark Rutland
On Mon, Aug 07, 2023 at 11:47:04AM +0100, Marc Zyngier wrote: > On 2023-08-07 11:28, Mark Rutland wrote: > > On Thu, Jun 01, 2023 at 02:31:51PM -0700, Douglas Anderson wrote: > > > From: Sumit Garg > > > > > > Let's use the debug IPI for rounding up CP

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

2023-08-07 Thread Mark Rutland
On Mon, Aug 07, 2023 at 06:16:24PM +0530, Sumit Garg wrote: > On Mon, 7 Aug 2023 at 16:11, Mark Rutland wrote: > > On Mon, Jul 24, 2023 at 08:55:44AM -0700, Doug Anderson wrote: > > > On Thu, Jun 1, 2023 at 2:37 PM Douglas Anderson > > > wrote: > > I'd also str

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

2023-08-07 Thread Mark Rutland
On Mon, Aug 07, 2023 at 04:52:40PM +0530, Sumit Garg wrote: > On Mon, 7 Aug 2023 at 15:20, Mark Rutland wrote: > > On Thu, Jun 01, 2023 at 02:31:45PM -0700, Douglas Anderson wrote: > > > @@ -542,16 +543,22 @@ static int gic_irq_nmi_setup(struct irq_data *d) > > >

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

2023-08-07 Thread Mark Rutland
On Mon, Aug 07, 2023 at 04:24:44PM +0100, Daniel Thompson wrote: > On Mon, Aug 07, 2023 at 11:28:52AM +0100, Mark Rutland wrote: > > On Thu, Jun 01, 2023 at 02:31:51PM -0700, Douglas Anderson wrote: > > > From: Sumit Garg > > > > > > Let's use the debug IP

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

2023-08-07 Thread Mark Rutland
On Mon, Aug 07, 2023 at 11:27:00AM +0100, Mark Rutland wrote: > On Thu, Jun 01, 2023 at 02:31:50PM -0700, Douglas Anderson wrote: > > +static inline int kgdb_nmicallback(int cpu, void *regs) { return 1; } > > Is '1' an error? > > Can we return an actual error code if

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

2023-08-07 Thread Mark Rutland
On Thu, Jun 01, 2023 at 02:31:50PM -0700, Douglas Anderson wrote: > 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

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

2023-08-07 Thread Mark Rutland
On Thu, Jun 01, 2023 at 02:31:48PM -0700, Douglas Anderson wrote: > From: Sumit Garg > > All current arm64 interrupt controllers have at least 8 > IPIs. Currently we are only using 7 of them on arm64. Let's use the > 8th one as a debug IPI. This uses the new "debug IPI" infrastructure > which

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

2023-08-07 Thread Mark Rutland
On Thu, Jun 01, 2023 at 02:31:49PM -0700, Douglas Anderson wrote: > From: Sumit Garg > > Enable arch_trigger_cpumask_backtrace() support on arm64 using the new > debug IPI. With this arm64 can now get backtraces in cases where > callers of the trigger_xyz_backtrace() class of functions don't

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

2023-08-07 Thread Mark Rutland
On Thu, Jun 01, 2023 at 02:31:47PM -0700, Douglas Anderson wrote: > From: Sumit Garg > > Introduce a framework for an IPI that will be used for debug > purposes. The primary use case of this IPI will be to generate stack > crawls on other CPUs, but it will also be used to round up CPUs for >

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

2023-08-07 Thread Mark Rutland
Hi Doug, Apologies for the delay. On Mon, Jul 24, 2023 at 08:55:44AM -0700, Doug Anderson wrote: > On Thu, Jun 1, 2023 at 2:37 PM Douglas Anderson wrote: > I'm looking for some ideas on what to do to move this patch series > forward. Thanks to Daniel, the kgdb patch is now in Linus's tree which

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

2023-08-07 Thread Mark Rutland
Hi Doug, On Thu, Jun 01, 2023 at 02:31:45PM -0700, Douglas Anderson wrote: > From: Sumit Garg > > Add support to handle SGIs as pseudo NMIs. As SGIs or IPIs default to a > special flow handler: handle_percpu_devid_fasteoi_ipi(), so skip NMI > handler update in case of SGIs. I couldn't find

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

2023-08-07 Thread Mark Rutland
On Mon, Aug 07, 2023 at 12:08:06PM +0100, Marc Zyngier wrote: > On 2023-08-07 11:54, Mark Rutland wrote: > > On Mon, Aug 07, 2023 at 11:47:04AM +0100, Marc Zyngier wrote: > > > On 2023-08-07 11:28, Mark Rutland wrote: > > > > On Thu, Jun 01, 2023 at 02:31:51PM

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

2023-08-07 Thread Mark Rutland
On Thu, Jun 01, 2023 at 02:31:51PM -0700, Douglas Anderson wrote: > From: Sumit Garg > > Let's use the debug IPI for rounding up CPUs in kgdb. When the debug > IPI is backed by an NMI (or pseudo NMI) then this will let us debug > even hard locked CPUs. When the debug IPI isn't backed by an NMI

Re: [Kgdb-bugreport] [PATCH v8 06/10] arm64: idle: Tag the arm64 idle functions as __cpuidle

2023-05-10 Thread Mark Rutland
On Wed, Apr 19, 2023 at 03:56:00PM -0700, Douglas Anderson wrote: > As per the (somewhat recent) comment before the definition of > `__cpuidle`, the tag is like `noinstr` but also marks a function so it > can be identified by cpu_in_idle(). Let'a add this. > > After doing this then when we dump

Re: [Kgdb-bugreport] [PATCH v8 00/10] arm64: Add framework to turn an IPI as NMI

2023-05-10 Thread Mark Rutland
On Wed, May 10, 2023 at 08:28:17AM -0700, Doug Anderson wrote: > Hi, Hi Doug, > On Wed, Apr 19, 2023 at 3:57 PM Douglas Anderson > wrote: > > This is an attempt to resurrect Sumit's old patch series [1] that > > allowed us to use the arm64 pseudo-NMI to get backtraces of CPUs and > > also to