mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Nathan Chancellor <nathan@kernel.org>,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] objtool/LoongArch: Fix fall through warning about efi_boot_kernel()
Date: Tue, 26 Aug 2025 20:33:20 +0800	[thread overview]
Message-ID: <487a8149-6cbe-46a7-6771-66aef0045f07@loongson.cn> (raw)
In-Reply-To: <CAAhV-H5wW_04NHQ7z+SCPb6-T5Hc__n+x=ykg-u9vn4b4GXuww@mail.gmail.com>

On 2025/8/26 下午4:32, Huacai Chen wrote:
> On Tue, Aug 26, 2025 at 2:46 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>>
>> When compiling with LLVM and CONFIG_LTO_CLANG is set, there exists
>> the following objtool warning:
>>
>>    vmlinux.o: warning: objtool: __efistub_efi_boot_kernel()
>>    falls through to next function __efistub_exit_boot_func()

...

>> -typedef void __noreturn (*kernel_entry_t)(bool efi, unsigned long cmdline,
>> +typedef void (*kernel_entry_t)(bool efi, unsigned long cmdline,
>>                                            unsigned long systab);
>  From my point of view this is incorrect, this function is indeed a
> noreturn function, and this modification makes LoongArch different to
> other architectures.
> 
> Maybe it is better to let objtool ignore the whole
> drivers/firmware/efi/libstub directory. Because efistub is discarded
> at runtime so it is useless for stack unwinder.

I tested the following change but there is no effect, the objtool
warning still exists, this is because OBJECT_FILES_NON_STANDARD
does not work for link time validation of vmlinux.o according to
tools/objtool/Documentation/objtool.txt.

diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
index 8efbcf699e4f..f1fff48eea76 100644
--- a/drivers/firmware/efi/Makefile
+++ b/drivers/firmware/efi/Makefile
@@ -10,6 +10,8 @@
  #
  KASAN_SANITIZE_runtime-wrappers.o      := n

+OBJECT_FILES_NON_STANDARD              := y
+
  obj-$(CONFIG_ACPI_BGRT)                += efi-bgrt.o
  obj-$(CONFIG_EFI)                      += efi.o vars.o reboot.o 
memattr.o tpm.o
  obj-$(CONFIG_EFI)                      += memmap.o

Thanks,
Tiezhu


  reply	other threads:[~2025-08-26 12:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  6:46 [RFC PATCH 0/2] Fix objtool warnings if LTO is enabled for LoongArch (Part 2) Tiezhu Yang
2025-08-26  6:46 ` [RFC PATCH 1/2] objtool/LoongArch: Fix fall through warning about efi_boot_kernel() Tiezhu Yang
2025-08-26  8:32   ` Huacai Chen
2025-08-26 12:33     ` Tiezhu Yang [this message]
2025-08-26 13:03       ` Huacai Chen
2025-08-26 23:39         ` Josh Poimboeuf
2025-08-28  2:01           ` Tiezhu Yang
2025-08-26  6:46 ` [RFC PATCH 2/2] objtool/LoongArch: Fix unreachable instruction warnings about head.S Tiezhu Yang
2025-08-26  8:20   ` Peter Zijlstra
2025-08-26 12:27     ` Tiezhu Yang
2025-08-26  8:26   ` Huacai Chen
2025-08-26 12:30     ` Tiezhu Yang
2025-08-26 23:43       ` Josh Poimboeuf
2025-08-28  2:01         ` Tiezhu Yang

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=487a8149-6cbe-46a7-6771-66aef0045f07@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®