[PATCH kexec-tools] github: add RISC-V to workflow

2022-10-21 Thread Simon Horman
Add RISC-V builds to workflow

Signed-off-by: Simon Horman 
---
 .github/workflows/build.yml | 3 +++
 1 file changed, 3 insertions(+)

 Hi Xianting Tian,

 Please consider including this a v3 patch-set
 to add RISC-V to kexec-tools.

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e554751e0017..2731282d9521 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -19,6 +19,8 @@ jobs:
 - powerpc
 - powerpc64
 - powerpc64le
+- riscv32
+- riscv64
 - sh4
 - s390x
 - x86_64-x32
@@ -42,6 +44,7 @@ jobs:
 case $ARCH in
   arm) GNU_ARCH="arm-linux-gnueabi" ;;
   arm64)   GNU_ARCH="aarch64-linux-gnu" ;;
+  riscv32) CROSS_COMPILER_PKG="gcc-riscv64-linux-gnu" ;;
   x86_64)  ;;
   x86_64-x32)  GNU_ARCH="x86_64-linux-gnux32"
CROSS_COMPILER_PKG="gcc-x86-64-linux-gnux32" ;;
-- 
2.30.2


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH] workflow: update to checkout@v3

2022-10-21 Thread Simon Horman
Use to checkout@v3 instead of checkout@v2
as the latter uses Node.js 12 actions which are deprecated.

https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

Signed-off-by: Simon Horman 
---
 .github/workflows/build.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2731282d9521..efa17edc77bf 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,7 +30,7 @@ jobs:
 libxen: libxen
 steps:
 - name: Checkout
-  uses: actions/checkout@v2
+  uses: actions/checkout@v3
 
 - name: Set Environment
   env:
-- 
2.30.2


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH V2] RISC-V: Add support for riscv kexec/kdump on kexec-tools

2022-10-21 Thread Simon Horman
On Thu, Oct 20, 2022 at 11:15:48AM +0800, Xianting Tian wrote:
> From: Nick Kossifidis 
> 
> This patch adds support for loading the ELF kernel image. It parses
> the current/provided device tree to determine the system's memory
> layout, and /proc/iomem for the various kernel segments.
> 
> This patch was firstly developed by Nick Kossifidis, and two fixes (
>1: fail to find free memory area for dtb load when using initrd image,
>   lists.infradead.org/pipermail/linux-riscv/2022-August/018398.html;
>2: fix memory range size calculation,
>kexec/arch/riscv/crashdump-riscv.c:line 85
> ) are contributed by Yixun Lan, Xianting Tian.
> 
> Tested on Qemu's rv64 virt machine and SoC of T-Head RISC-V Xuantie 910 CPU.

Hi,

thanks for some patch.

Some minor feedback follows.

Separately, I'll post a patch to add RISC-V builds to the github
workflow. If you could include that in V3 I'd be most grateful.

> 
> Tested-by: Yixun Lan 
> Co-developed-by: Xianting Tian 
> Co-developed-by: Yixun Lan 
> Signed-off-by: Nick Kossifidis 

...

> + ret = mem_regions_alloc_and_add(mem_ranges, start,
> + end - start, type);

mem_regions_alloc_and_add isn't always available.
f.e. on mips this causes a build failure.

Ref: 
https://github.com/horms/kexec-tools/actions/runs/3298491143/jobs/5440677595

...

> +int dtb_get_memory_ranges(char *dtb, struct memory_ranges *mem_ranges, 
> struct memory_ranges *extra_ranges)
> +{

...

> + mem_regions_sort(mem_ranges);

Likewise, mem_regions_sort isn't always available.
f.e. on mips this causes a build failure.

...

> diff --git a/purgatory/arch/riscv/Makefile b/purgatory/arch/riscv/Makefile
> new file mode 100644
> index 000..8bded71
> --- /dev/null
> +++ b/purgatory/arch/riscv/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Purgatory riscv
> +#
> +
> +riscv_PURGATORY_SRCS =
> +
> +dist += purgatory/arch/sh/Makefile $(riscv_PURGATORY_SRCS)

s/sh/riscv/

Else the distribution tarball won't include this Makefile

You can exercise this using:
  make distcheck DISTCHECK_CONFIGURE_FLAGS="--host=riscv64-linux-gnu"

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli  Sent: Tuesday, October 4, 2022 
10:20 AM
> 
> On 04/10/2022 13:24, Michael Kelley (LINUX) wrote:
> > [...]
> >
> > Tested this patch in combination with Patch 9 in this series.  Verified
> > that both the panic and die paths work correctly with notification to
> > Hyper-V via hyperv_report_panic() or via hv_kmsg_dump().  Hyper-V
> > framebuffer is updated as expected, though I did not reproduce
> > a case where the ring buffer lock is held.  vmbus_initiate_unload() runs
> > as expected.
> >
> > Tested-by: Michael Kelley 
> >
> 
> Thanks a lot for the tests/review Michael!
> 
> Do you think Hyper-V folks could add both patches in hv tree? If you
> prefer, I can re-send them individually.
> 

Wei Liu:  Could you pick up Patch 9 and Patch 10 from this series in the
hyperv-next tree?

Michael

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH V2 2/2] Documentation: kdump: describe VMCOREINFO export for RISCV64

2022-10-21 Thread Bagas Sanjaya
On Fri, Oct 14, 2022 at 09:41:39PM +0800, Xianting Tian wrote:
> The following interrelated definitions and ranges are needed by the kdump
> crash tool, they are exported by "arch/riscv/kernel/crash_core.c":

Better say "..., which are exported by ..."

> diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst 
> b/Documentation/admin-guide/kdump/vmcoreinfo.rst
> index 6726f439958c..8e2e164cf3db 100644
> --- a/Documentation/admin-guide/kdump/vmcoreinfo.rst
> +++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst
> @@ -595,3 +595,33 @@ X2TLB
>  -
>  
>  Indicates whether the crashed kernel enabled SH extended mode.
> +
> +RISCV64
> +===
> +
> +VA_BITS
> +---
> +
> +The maximum number of bits for virtual addresses. Used to compute the
> +virtual memory ranges.
> +
> +PAGE_OFFSET
> +---
> +
> +Indicates the virtual kernel start address of direct-mapped RAM region.
> +
> +phys_ram_base
> +-
> +
> +Indicates the start physical RAM address.
> +
> +MODULES_VADDR|MODULES_END|VMALLOC_START|VMALLOC_END|VMEMMAP_START|VMEMMAP_END|KASAN_SHADOW_START|KASAN_SHADOW_END|KERNEL_LINK_ADDR|ADDRESS_SPACE_END
> +
> +
> +Used to get the correct ranges:
> +
> +  * MODULES_VADDR ~ MODULES_END : Kernel module space.
> +  * VMALLOC_START ~ VMALLOC_END : vmalloc() / ioremap() space.
> +  * VMEMMAP_START ~ VMEMMAP_END : vmemmap region, used for struct page array.
> +  * KASAN_SHADOW_START ~ KASAN_SHADOW_END : kasan shadow space.
> +  * KERNEL_LINK_ADDR ~ ADDRESS_SPACE_END : Kernel link and BPF space.

The documentation LGTM, thanks.

When the patch subject is fixed,

Reviewed-by: Bagas Sanjaya 

-- 
An old man doll... just what I always wanted! - Clara


signature.asc
Description: PGP signature
___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 20/10/2022 18:29, Steven Rostedt wrote:
> [...]
> Sorry for the late reply.
> 
> Acked-by: Steven Rostedt (Google) 
> 
> -- Steve

No need for apologies! Appreciate your review/ack =)

Could you pick it in your tree? Or do you prefer that I re-send as a
solo patch, with your ACK?

Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 20/10/2022 19:22, Steven Rostedt wrote:
> On Thu, 20 Oct 2022 18:53:43 -0300
> "Guilherme G. Piccoli"  wrote:
> 
>> Could you pick it in your tree? Or do you prefer that I re-send as a
>> solo patch, with your ACK?
> 
> I wasn't sure there were any dependencies on this. If not, I can take it.
> 
> -- Steve

Thank you! No dependency at all...I just piled a bunch of independent
panic notifiers fixes, so they can be reviewed by the maintainers and
picked individually.

Some maintainers though prefer them to be sent individually, as solo
patches...hence my question.

Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 17/10/2022 14:47, Russell King (Oracle) wrote:
> On Mon, Oct 17, 2022 at 11:50:05AM -0300, Guilherme G. Piccoli wrote:
>> On 17/10/2022 11:17, Russell King (Oracle) wrote:
>>> [...]
 Monthly ping - let me know if there's something I should improve in
 order this fix is considered!
>>>
>>> Patches don't get applied unless they end up in the patch system.
>>> Thanks.
>>>
>>
>> Thanks Russell! Can you show me some documentation on how should I send
>> the patches to this patch system? My understanding based in the
>> MAINTAINERS file is that we should send the arm32 patches to you + arm ML.
> 
> Look below in my signature --.
>  |
>v


Thank you! It seems I was able to submit it properly now:
https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=9257/1

Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH V2] RISC-V: Add support for riscv kexec/kdump on kexec-tools

2022-10-21 Thread Xianting Tian
From: Nick Kossifidis 

This patch adds support for loading the ELF kernel image. It parses
the current/provided device tree to determine the system's memory
layout, and /proc/iomem for the various kernel segments.

This patch was firstly developed by Nick Kossifidis, and two fixes (
   1: fail to find free memory area for dtb load when using initrd image,
  lists.infradead.org/pipermail/linux-riscv/2022-August/018398.html;
   2: fix memory range size calculation,
   kexec/arch/riscv/crashdump-riscv.c:line 85
) are contributed by Yixun Lan, Xianting Tian.

Tested on Qemu's rv64 virt machine and SoC of T-Head RISC-V Xuantie 910 CPU.

Tested-by: Yixun Lan 
Co-developed-by: Xianting Tian 
Co-developed-by: Yixun Lan 
Signed-off-by: Nick Kossifidis 
---
Changes
  V1 -> V2:
  1, Rebase the patch to latest kexec code.
  2, Set patch author Nick Kossifidis.

 configure.ac|   3 +
 include/elf.h   |   1 +
 kexec/Makefile  |   1 +
 kexec/arch/riscv/Makefile   |  35 ++
 kexec/arch/riscv/crashdump-riscv.c  | 140 
 kexec/arch/riscv/include/arch/options.h |  43 +++
 kexec/arch/riscv/kexec-elf-riscv.c  | 255 ++
 kexec/arch/riscv/kexec-riscv.c  | 365 +++
 kexec/arch/riscv/kexec-riscv.h  |  32 ++
 kexec/dt-ops.c  | 442 +++-
 kexec/dt-ops.h  |   7 +
 kexec/kexec-syscall.h   |   4 +
 purgatory/Makefile  |   1 +
 purgatory/arch/riscv/Makefile   |   7 +
 14 files changed, 1335 insertions(+), 1 deletion(-)
 create mode 100644 kexec/arch/riscv/Makefile
 create mode 100644 kexec/arch/riscv/crashdump-riscv.c
 create mode 100644 kexec/arch/riscv/include/arch/options.h
 create mode 100644 kexec/arch/riscv/kexec-elf-riscv.c
 create mode 100644 kexec/arch/riscv/kexec-riscv.c
 create mode 100644 kexec/arch/riscv/kexec-riscv.h
 create mode 100644 purgatory/arch/riscv/Makefile

diff --git a/configure.ac b/configure.ac
index d081c82..9204c37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,9 @@ case $target_cpu in
loongarch*)
ARCH="loongarch"
;;
+   riscv32|riscv64)
+   ARCH="riscv"
+   ;;
* )
AC_MSG_ERROR([unsupported architecture $target_cpu])
;;
diff --git a/include/elf.h b/include/elf.h
index 1c8d2cc..93a5ee5 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -259,6 +259,7 @@ typedef struct
 #define EM_ARC_A5  93  /* ARC Cores Tangent-A5 */
 #define EM_XTENSA  94  /* Tensilica Xtensa Architecture */
 #define EM_AARCH64 183 /* ARM AARCH64 */
+#define EM_RISCV   243 /* RISC-V */
 #define EM_LOONGARCH   258 /* Loongson Loongarch*/
 #define EM_NUM 184
 
diff --git a/kexec/Makefile b/kexec/Makefile
index 8a52e8d..405864a 100644
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -88,6 +88,7 @@ include $(srcdir)/kexec/arch/mips/Makefile
 include $(srcdir)/kexec/arch/cris/Makefile
 include $(srcdir)/kexec/arch/ppc/Makefile
 include $(srcdir)/kexec/arch/ppc64/Makefile
+include $(srcdir)/kexec/arch/riscv/Makefile
 include $(srcdir)/kexec/arch/s390/Makefile
 include $(srcdir)/kexec/arch/sh/Makefile
 include $(srcdir)/kexec/arch/x86_64/Makefile
diff --git a/kexec/arch/riscv/Makefile b/kexec/arch/riscv/Makefile
new file mode 100644
index 000..f26cc90
--- /dev/null
+++ b/kexec/arch/riscv/Makefile
@@ -0,0 +1,35 @@
+#
+# kexec riscv
+#
+riscv_KEXEC_SRCS =  kexec/arch/riscv/kexec-riscv.c
+riscv_KEXEC_SRCS += kexec/arch/riscv/kexec-elf-riscv.c
+riscv_KEXEC_SRCS += kexec/arch/riscv/crashdump-riscv.c
+
+riscv_MEM_REGIONS = kexec/mem_regions.c
+
+riscv_DT_OPS += kexec/dt-ops.c
+
+riscv_ARCH_REUSE_INITRD =
+
+riscv_CPPFLAGS += -I $(srcdir)/kexec/
+
+dist += kexec/arch/riscv/Makefile $(riscv_KEXEC_SRCS)  \
+   kexec/arch/riscv/kexec-riscv.h  \
+   kexec/arch/riscv/include/arch/options.h
+
+ifdef HAVE_LIBFDT
+
+LIBS += -lfdt
+
+else
+
+include $(srcdir)/kexec/libfdt/Makefile.libfdt
+
+libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/libfdt/%)
+
+riscv_CPPFLAGS += -I$(srcdir)/kexec/libfdt
+
+riscv_KEXEC_SRCS += $(libfdt_SRCS)
+
+endif
+
diff --git a/kexec/arch/riscv/crashdump-riscv.c 
b/kexec/arch/riscv/crashdump-riscv.c
new file mode 100644
index 000..3ed4fe3
--- /dev/null
+++ b/kexec/arch/riscv/crashdump-riscv.c
@@ -0,0 +1,140 @@
+#include 
+#include 
+#include 
+
+#include "kexec.h"
+#include "crashdump.h"
+#include "kexec-elf.h"
+#include "mem_regions.h"
+
+static struct crash_elf_info elf_info = {
+#if __riscv_xlen == 64
+   .class  = ELFCLASS64,
+#else
+   .class  = ELFCLASS32,
+#endif
+   .data   = ELFDATA2LSB,
+   .machine= EM_RISCV,
+};
+
+static struct memory_ranges crash_mem_ranges = {0};
+struct 

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

2022-10-21 Thread Steven Rostedt
On Thu, 20 Oct 2022 18:53:43 -0300
"Guilherme G. Piccoli"  wrote:

> Could you pick it in your tree? Or do you prefer that I re-send as a
> solo patch, with your ACK?

I wasn't sure there were any dependencies on this. If not, I can take it.

-- Steve

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
> 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 Siewior 
> Cc: Steven Rostedt 
> Cc: Valentin Schneider 
> Cc: Xiaoming Ni 
> Signed-off-by: Guilherme G. Piccoli 
> 
> ---
> 
> V3:
> - Yet another major change - thanks to Arjan's great suggestion,
> refactored the code to make use of tracepoints instead of guarding
> the output with a Kconfig debug setting.
> 
> V2:
> - Major improvement thanks to the great idea from Xiaoming - changed
> all the ksym wheel reinvention to printk %ps modifier;
> 
> - Instead of ifdefs, using IS_ENABLED() - thanks Steven.
> 
> - Removed an unlikely() hint on debug path.
> 

Hi Arjan / all, apologies for the re-ping.
Did you have a chance to take a look in this one, is there anything else
I could improve?

Thanks in advance,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Russell King (Oracle)
On Mon, Oct 17, 2022 at 11:50:05AM -0300, Guilherme G. Piccoli wrote:
> On 17/10/2022 11:17, Russell King (Oracle) wrote:
> > [...]
> >> Monthly ping - let me know if there's something I should improve in
> >> order this fix is considered!
> > 
> > Patches don't get applied unless they end up in the patch system.
> > Thanks.
> > 
> 
> Thanks Russell! Can you show me some documentation on how should I send
> the patches to this patch system? My understanding based in the
> MAINTAINERS file is that we should send the arm32 patches to you + arm ML.

Look below in my signature --.
 |
 v
-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Russell King (Oracle)
On Mon, Oct 17, 2022 at 11:00:46AM -0300, Guilherme G. Piccoli wrote:
> On 18/09/2022 10:58, Guilherme G. Piccoli wrote:
> > On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
> >> 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, it makes sense to disable FIQs here,
> >> but there's no need for (re-)disabling IRQs.
> >>
> >> More than that: there is an alternative path for disabling CPUs,
> >> in the form of function crash_smp_send_stop(), which is used for
> >> kexec/panic path. This function relies on a SMP call that also
> >> triggers a busy-wait loop [at machine_crash_nonpanic_core()], but
> >> without disabling FIQs. This might lead to odd scenarios, like
> >> early interrupts in the boot of kexec'd kernel or even interrupts
> >> in secondary "disabled" CPUs while the main one still works in the
> >> panic path and assumes all secondary CPUs are (really!) off.
> >>
> >> So, let's disable FIQs in both paths and *not* disable IRQs a second
> >> time, since they are already masked in both paths by the architecture.
> >> This way, we keep both CPU quiesce paths consistent and safe.
> >>
> >> Cc: Marc Zyngier 
> >> Cc: Michael Kelley 
> >> Cc: Russell King 
> >> Signed-off-by: Guilherme G. Piccoli 
> >>
> 
> Monthly ping - let me know if there's something I should improve in
> order this fix is considered!

Patches don't get applied unless they end up in the patch system.
Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 17/10/2022 11:17, Russell King (Oracle) wrote:
> [...]
>> Monthly ping - let me know if there's something I should improve in
>> order this fix is considered!
> 
> Patches don't get applied unless they end up in the patch system.
> Thanks.
> 

Thanks Russell! Can you show me some documentation on how should I send
the patches to this patch system? My understanding based in the
MAINTAINERS file is that we should send the arm32 patches to you + arm ML.

Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
> 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 showing useless trace
> data (like the callback names for the other notifiers); finally,
> we also removed an unnecessary header inclusion.
> 
> Cc: Petr Mladek 
> Cc: Sergei Shtylyov 
> Cc: Steven Rostedt 
> Signed-off-by: Guilherme G. Piccoli 
> 
> ---
> 
> V3:
> - Removed goto usage, as per Steven suggestion (thanks!).
> 
> V2:
> - Different approach; instead of using IDs to distinguish die and
> panic events, rely on address comparison like other notifiers do
> and as per Petr's suggestion;
> 
> - Removed ACK from Steven since the code changed.
> 

Hi Steven, apologies for the re-ping. Is there anything else to do in
this one, or do you think it's good enough?

Thanks,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 18/09/2022 18:19, Richard Weinberger wrote:
> - Ursprüngliche Mail -
>> Von: "Guilherme G. Piccoli" 
>> On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
>>> 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 notifiers earlier;
>>> user mode linux shouldn't care much with other panic notifiers but
>>> the ordering among the mconsole and arch notifier is important,
>>> given that the arch one effectively triggers a core dump.
>>>
>>> Fix that by running the mconsole notifier as the first panic
>>> notifier, followed by the architecture one (that coredumps).
>>>
>>> Cc: Anton Ivanov 
>>> Cc: Johannes Berg 
>>> Cc: Richard Weinberger 
>>> Signed-off-by: Guilherme G. Piccoli 
>>>
>>> V3:
>>> - No changes.
>>> [...]
>>
>> Hi Johannes, sorry for the ping. Do you think you could pick this one?
>> Or if you prefer, I can resend it alone (not in the series) - let me
>> know your preference.
> 
> This patch is on my TODO list.
> Just had no chance to test it.
> 
> Thanks,
> //richard

Hi Richard / Johannes, is there any news on this one?
Thanks in advance,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 18/09/2022 10:58, Guilherme G. Piccoli wrote:
> On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
>> 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, it makes sense to disable FIQs here,
>> but there's no need for (re-)disabling IRQs.
>>
>> More than that: there is an alternative path for disabling CPUs,
>> in the form of function crash_smp_send_stop(), which is used for
>> kexec/panic path. This function relies on a SMP call that also
>> triggers a busy-wait loop [at machine_crash_nonpanic_core()], but
>> without disabling FIQs. This might lead to odd scenarios, like
>> early interrupts in the boot of kexec'd kernel or even interrupts
>> in secondary "disabled" CPUs while the main one still works in the
>> panic path and assumes all secondary CPUs are (really!) off.
>>
>> So, let's disable FIQs in both paths and *not* disable IRQs a second
>> time, since they are already masked in both paths by the architecture.
>> This way, we keep both CPU quiesce paths consistent and safe.
>>
>> Cc: Marc Zyngier 
>> Cc: Michael Kelley 
>> Cc: Russell King 
>> Signed-off-by: Guilherme G. Piccoli 
>>

Monthly ping - let me know if there's something I should improve in
order this fix is considered!
Thanks,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 18/09/2022 11:10, Guilherme G. Piccoli wrote:
> On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
>> 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 and secondary CPUs disabled.
>>
>> Users want the information collected in this panic notifier though,
>> so in order to balance the risk/benefit, let's skip the altera panic
>> notifier if kdump is loaded. While at it, remove a useless header
>> and encompass a macro inside the sole ifdef block it is used.
>>
>> Cc: Borislav Petkov 
>> Cc: Petr Mladek 
>> Cc: Tony Luck 
>> Acked-by: Dinh Nguyen 
>> Signed-off-by: Guilherme G. Piccoli 
>>
>> ---
>>
>> V3:
>> - added the ack tag from Dinh - thanks!
>> - had a good discussion with Boris about that in V2 [0],
>> hopefully we can continue and reach a consensus in this V3.
>> [0] 
>> https://lore.kernel.org/lkml/46137c67-25b4-6657-33b7-cffdc7afc...@igalia.com/
>>
>> V2:
>> - new patch, based on the discussion in [1].
>> [1] 
>> https://lore.kernel.org/lkml/62a63fc2-346f-f375-043a-fa2138527...@igalia.com/
>>
>> [...]
> 
> Hi Dinh, Tony, Boris - sorry for the ping.

Hey folks, apologies for the new ping.

Is there anything to improve here maybe? Reviews / opinions are very
appreciated!
Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Guilherme G. Piccoli
On 17/10/2022 11:10, Richard Weinberger wrote:
> - Ursprüngliche Mail -
>> Von: "Guilherme G. Piccoli" 
>> Hi Richard / Johannes, is there any news on this one?
>> Thanks in advance,
> 
> It's upstream:
> git.kernel.org/linus/758dfdb9185cf94160f20e85bbe05583e3cd4ff4
> 
> Thanks,
> //richard

Wow, thanks! I am sorry, I didn't notice.
Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Richard Weinberger
- Ursprüngliche Mail -
> Von: "Guilherme G. Piccoli" 
> Hi Richard / Johannes, is there any news on this one?
> Thanks in advance,

It's upstream:
git.kernel.org/linus/758dfdb9185cf94160f20e85bbe05583e3cd4ff4

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


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

2022-10-21 Thread Steven Rostedt
On Fri, 19 Aug 2022 19:17:26 -0300
"Guilherme G. Piccoli"  wrote:

> 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 showing useless trace
> data (like the callback names for the other notifiers); finally,
> we also removed an unnecessary header inclusion.
> 
> Cc: Petr Mladek 
> Cc: Sergei Shtylyov 
> Cc: Steven Rostedt 
> Signed-off-by: Guilherme G. Piccoli 

Sorry for the late reply.

Acked-by: Steven Rostedt (Google) 

-- Steve

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH] Makefile: Remove version from /usr/share/makedumpfile

2022-10-21 Thread Leonidas Spyropoulos
Version specific paths doesn't make sense at
/usr/share/makedumpfile. This assumes you will have only one version
installed which on a normal system it makes sense and devs can always
specify different DESTDIR per versions.

Fixes: #10

Signed-off-by: Leonidas Spyropoulos 
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 548e5b7..f6ecbe2 100644
--- a/Makefile
+++ b/Makefile
@@ -130,6 +130,6 @@ install:
install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile 
$(VPATH)makedumpfile-R.pl
install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8
install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5
-   mkdir -p ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts
-   install -m 644 -D $(VPATH)makedumpfile.conf 
${DESTDIR}/usr/share/makedumpfile-${VERSION}/makedumpfile.conf.sample
-   install -m 644 -t 
${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts/ 
$(VPATH)eppic_scripts/*
+   mkdir -p ${DESTDIR}/usr/share/makedumpfile/eppic_scripts
+   install -m 644 -D $(VPATH)makedumpfile.conf 
${DESTDIR}/usr/share/makedumpfile/makedumpfile.conf.sample
+   install -m 644 -t ${DESTDIR}/usr/share/makedumpfile/eppic_scripts/ 
$(VPATH)eppic_scripts/*
-- 
2.38.1


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec