From: Michael Ellerman <mpe@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: "naveen.n.rao@linux.ibm.com" <naveen.n.rao@linux.ibm.com>
Subject: Re: [PATCH v5] Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto"
Date: Mon, 17 Jul 2023 15:01:07 +1000 [thread overview]
Message-ID: <87a5vvjfn0.fsf@mail.lhotse> (raw)
In-Reply-To: <e63b1f49-1022-9485-e555-68d6c4a7879c@csgroup.eu>
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 12/07/2023 à 15:45, Michael Ellerman a écrit :
>> From: Christophe Leroy <christophe.leroy@csgroup.eu>
>>
>> This partly reverts commit 1e688dd2a3d6759d416616ff07afc4bb836c4213.
>>
>> That commit aimed at optimising the code around generation of
>> WARN_ON/BUG_ON but this leads to a lot of dead code erroneously
>> generated by GCC.
>>
>> That dead code becomes a problem when we start using objtool validation
>> because objtool will abort validation with a warning as soon as it
>> detects unreachable code. This is because unreachable code might
>> be the indication that objtool doesn't properly decode object text.
>>
>> text data bss dec hex filename
>> 9551585 3627834 224376 13403795 cc8693 vmlinux.before
>> 9535281 3628358 224376 13388015 cc48ef vmlinux.after
>>
>> Once this change is reverted, in a standard configuration (pmac32 +
>> function tracer) the text is reduced by 16k which is around 1.7%
>>
>> We already had problem with it when starting to use objtool on powerpc
>> as a replacement for recordmcount, see commit 93e3f45a2631 ("powerpc:
>> Fix __WARN_FLAGS() for use with Objtool")
>>
>> There is also a problem with at least GCC 12, on ppc64_defconfig +
>> CONFIG_CC_OPTIMIZE_FOR_SIZE=y + CONFIG_DEBUG_SECTION_MISMATCH=y :
>>
>> LD .tmp_vmlinux.kallsyms1
>> powerpc64-linux-ld: net/ipv4/tcp_input.o:(__ex_table+0xc4): undefined reference to `.L2136'
>> make[2]: *** [scripts/Makefile.vmlinux:36: vmlinux] Error 1
>> make[1]: *** [/home/chleroy/linux-powerpc/Makefile:1238: vmlinux] Error 2
>>
>> Taking into account that other problems are encountered with that
>> 'asm goto' in WARN_ON(), including build failures, keeping that
>> change is not worth it allthough it is primarily a compiler bug.
>>
>> Revert it for now.
>>
>> mpe: Retain EMIT_WARN_ENTRY as a synonym for EMIT_BUG_ENTRY to reduce
>> churn, as there are now nearly as many uses of EMIT_WARN_ENTRY as
>> EMIT_BUG_ENTRY.
>
> In that case, should we keep __EMIT_BUG_ENTRY and also keep the check
> that makes sure nobody uses EMIT_BUG_ENTRY with BUGFLAG_WARNING ?
I didn't think it was worth it, now that it's not a correctness issue.
I think the better option would be to have EMIT_WARN_ENTRY add
BUGFLAG_WARNING itself, rather than the caller having to pass it.
cheers
next prev parent reply other threads:[~2023-07-17 5:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 13:45 [PATCH v5] Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto" Michael Ellerman
2023-07-12 13:52 ` Christophe Leroy
2023-07-17 5:01 ` Michael Ellerman [this message]
2023-07-17 15:46 ` Christophe Leroy
2023-07-20 13:50 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a5vvjfn0.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=christophe.leroy@csgroup.eu \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naveen.n.rao@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).