All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] purgatory: do not enable vectorization automatically for purgatory compiling
@ 2022-03-29 10:01 Baoquan He
  2022-03-29 10:12 ` [PATCH v2] " Baoquan He
  0 siblings, 1 reply; 4+ messages in thread
From: Baoquan He @ 2022-03-29 10:01 UTC (permalink / raw)
  To: kexec

Redhat CKI reported kdump kernel will hang a while very early after crash
triggered, then reset to firmware to reboot.

This failure can only be observed with kdump or kexec reboot via
kexec_load system call. With kexec_file_load interface, both kdump and
kexec reboot work very well. And further investigation shows that gcc
version 11 doesn't have this issue, while gcc version 12 does.

After checking the release notes of the latest gcc, Dave found out it's
because gcc 12 enables auto-vectorization for -O2 optimization level.
Please see below link for more information:

  https://www.phoronix.com/scan.php?page=news_item&px=GCC-12-Auto-Vec-O2

Adding -fno-tree-vectorize to Makefile of purgatory can fix the issue.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/purgatory/Makefile b/purgatory/Makefile
index 49ce80a638b2..9e04a5b0ef93 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -49,7 +49,7 @@ $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
 		      $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 		      -Os -fno-builtin -ffreestanding \
 		      -fno-zero-initialized-in-bss \
-		      -fno-PIC -fno-PIE -fno-stack-protector
+		      -fno-PIC -fno-PIE -fno-stack-protector -fno-tree-vectorize
 
 $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 			-I$(srcdir)/purgatory/include \
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] purgatory: do not enable vectorization automatically for purgatory compiling
  2022-03-29 10:01 [PATCH] purgatory: do not enable vectorization automatically for purgatory compiling Baoquan He
@ 2022-03-29 10:12 ` Baoquan He
  2022-03-30  9:14   ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Baoquan He @ 2022-03-29 10:12 UTC (permalink / raw)
  To: kexec

Redhat CKI reported kdump kernel will hang a while very early after crash
triggered, then reset to firmware to reboot.

This failure can only be observed with kdump or kexec reboot via
kexec_load system call. With kexec_file_load interface, both kdump and
kexec reboot work very well. And further investigation shows that gcc
version 11 doesn't have this issue, while gcc version 12 does.

After checking the release notes of the latest gcc, Dave found out it's
because gcc 12 enables auto-vectorization for -O2 optimization level.
Please see below link for more information:

  https://www.phoronix.com/scan.php?page=news_item&px=GCC-12-Auto-Vec-O2

Adding -fno-tree-vectorize to Makefile of purgatory can fix the issue.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
v1->v2:
 Rebase code change on latest master branch since v1 code was made on my
 local branch based on an old release version of kexec-tools.

 purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/purgatory/Makefile b/purgatory/Makefile
index 2dd6c476889e..15adb120e54a 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -49,7 +49,7 @@ $(PURGATORY): CFLAGS=$(PURGATORY_EXTRA_CFLAGS) \
 		      $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 		      -Os -fno-builtin -ffreestanding \
 		      -fno-zero-initialized-in-bss \
-		      -fno-PIC -fno-PIE -fno-stack-protector
+		      -fno-PIC -fno-PIE -fno-stack-protector -fno-tree-vectorize
 
 $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 			-I$(srcdir)/purgatory/include \
-- 
2.34.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] purgatory: do not enable vectorization automatically for purgatory compiling
  2022-03-29 10:12 ` [PATCH v2] " Baoquan He
@ 2022-03-30  9:14   ` Simon Horman
  2022-03-30  9:52     ` Baoquan He
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2022-03-30  9:14 UTC (permalink / raw)
  To: kexec

On Tue, Mar 29, 2022 at 06:12:28PM +0800, Baoquan He wrote:
> Redhat CKI reported kdump kernel will hang a while very early after crash
> triggered, then reset to firmware to reboot.
> 
> This failure can only be observed with kdump or kexec reboot via
> kexec_load system call. With kexec_file_load interface, both kdump and
> kexec reboot work very well. And further investigation shows that gcc
> version 11 doesn't have this issue, while gcc version 12 does.
> 
> After checking the release notes of the latest gcc, Dave found out it's
> because gcc 12 enables auto-vectorization for -O2 optimization level.
> Please see below link for more information:
> 
>   https://www.phoronix.com/scan.php?page=news_item&px=GCC-12-Auto-Vec-O2
> 
> Adding -fno-tree-vectorize to Makefile of purgatory can fix the issue.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>

Thanks, applied.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] purgatory: do not enable vectorization automatically for purgatory compiling
  2022-03-30  9:14   ` Simon Horman
@ 2022-03-30  9:52     ` Baoquan He
  0 siblings, 0 replies; 4+ messages in thread
From: Baoquan He @ 2022-03-30  9:52 UTC (permalink / raw)
  To: kexec

On 03/30/22 at 11:14am, Simon Horman wrote:
> On Tue, Mar 29, 2022 at 06:12:28PM +0800, Baoquan He wrote:
> > Redhat CKI reported kdump kernel will hang a while very early after crash
> > triggered, then reset to firmware to reboot.
> > 
> > This failure can only be observed with kdump or kexec reboot via
> > kexec_load system call. With kexec_file_load interface, both kdump and
> > kexec reboot work very well. And further investigation shows that gcc
> > version 11 doesn't have this issue, while gcc version 12 does.
> > 
> > After checking the release notes of the latest gcc, Dave found out it's
> > because gcc 12 enables auto-vectorization for -O2 optimization level.
> > Please see below link for more information:
> > 
> >   https://www.phoronix.com/scan.php?page=news_item&px=GCC-12-Auto-Vec-O2
> > 
> > Adding -fno-tree-vectorize to Makefile of purgatory can fix the issue.
> > 
> > Signed-off-by: Baoquan He <bhe@redhat.com>
> 
> Thanks, applied.

Thanks, Simon.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-30  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 10:01 [PATCH] purgatory: do not enable vectorization automatically for purgatory compiling Baoquan He
2022-03-29 10:12 ` [PATCH v2] " Baoquan He
2022-03-30  9:14   ` Simon Horman
2022-03-30  9:52     ` Baoquan He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.