Re: vmlinux.o: warning: objtool: do_machine_check()+0x5fa: call to memset() leaves .noinstr.text section

From: Jakub Kicinski
Date: Wed Jan 19 2022 - 17:57:35 EST


On Wed, 19 Jan 2022 22:16:16 +0100 Borislav Petkov wrote:
> On Wed, Jan 19, 2022 at 12:37:14PM -0800, Jakub Kicinski wrote:
> > gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-3)
>
> I have
>
> $ gcc-8 --version
> gcc-8 (SUSE Linux) 8.2.1 20180831 [gcc-8-branch revision 264010]
>
> but I can't trigger anything with it either.
>
> So I had a report about a randconfig from the 0day robot guys which
> doesn't look like allmodconfig but which triggered some of the issues
> you're seeing and I have fixes for that one which we wanna queue after
> -rc1.
>
> You could try them to see if they fix your warnings too. First take the
> 2 here:
>
> https://lore.kernel.org/r/20220113155357.4706-1-bp@xxxxxxxxx
>
> and then this one ontop:
>
> https://lore.kernel.org/r/YeWsopFagTZ4W8WA@xxxxxxx
>
> Thx.

That does fix one of the warnings, it seems.

Before:

vmlinux.o: warning: objtool: mce_start()+0x5e: call to __kasan_check_write() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_gather_info()+0x5f: call to v8086_mode.isra.1() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_read_aux()+0x8a: call to mca_msr_reg() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0x196: call to mce_no_way_out() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_severity_amd.constprop.1()+0xd1: call to mce_severity_amd_smca.isra.0() leaves .noinstr.text section

After:

vmlinux.o: warning: objtool: mce_start()+0x5e: call to __kasan_check_write() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_gather_info()+0x5f: call to v8086_mode.isra.1() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0xa32: call to mce_clear_state() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_severity_amd.constprop.1()+0xd1: call to mce_severity_amd_smca.isra.0() leaves .noinstr.text section


At a glance mce_read_aux() is gone and do_machine_check() complains
about a different call.