mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Borislav Petkov <bp@alien8.de>, Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>, x86-ml <x86@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] x86/urgent for v6.3-rc7
Date: Wed, 19 Apr 2023 18:03:53 +0200	[thread overview]
Message-ID: <ed6bfa1a-7e82-8273-ee7f-0e8097397724@suse.com> (raw)
In-Reply-To: <20230419155900.GCZEAPxNiOUP31q+/H@fat_crate.local>


[-- Attachment #1.1.1: Type: text/plain, Size: 2118 bytes --]

On 19.04.23 17:59, Borislav Petkov wrote:
> On Mon, Apr 17, 2023 at 06:24:35PM -0700, Josh Poimboeuf wrote:
>> I implemented it in the patch below.
> 
> Ha, amazing! Thanks man. :-)
> 
>> It was pretty straightforward
>> since this case always(?) involves two relocations within a single
>> instruction, like:
>>
>>   3d9:	48 c7 05 00 00 00 00 00 00 00 00 	movq   $0x0,0x0(%rip)        # 3e4 <x86_wallclock_init+0xa4>	3dc: R_X86_64_PC32	x86_platform+0x8
>> 	3e0: R_X86_64_32S	.init.text+0x280
>>
>> So objtool warns if the instruction's first relocation is non-init and
>> the second one is init.
> 
> Sounds plausible to me.
> 
>> There are 9 "disallowed store" warnings.  There would have been more,
>> but I added per-symbol rate-limiting to keep the total number of
>> warnings down.  For example, instead of the x86_wallclock_init() issue
>> discovered above, it shows a similar warning from elsewhere:
>>
>>    vmlinux.o: warning: objtool: xen_init_apic+0xab: disallowed store of init symbol xen_apic_check to non-init data x86_platform
> 
> Obviously a good catch.
> 
> However, the only call site is in apic_intr_mode_init() which itself is
> __init. So yeah, strictly speaking nothing wrong.
> 
> *IF* something calls it later, when __init is gone, then boom.
> 
> Dunno, maybe
> 
> a) track call sites too but maybe expensive and too much
> 
> or
> 
> b) make those warnings debug messages in case someone wants to run objtool
> in debug mode, feels really bored and wants to fix potential issues.
> 
> Or someone has a better idea.
> 
>> Anyway, this is kind of experimental.  If any of these warnings don't
>> turn out to be useful I could drop some or all them.
> 
> Right, I can certainly see potential and as said, since we're already
> doing objtool massaging of object files, thought this should be pretty
> easy to do. As you've shown. ;-)

What about splitting the function vectors into __init and non-init parts?

This would solve above problem automatically, as a non-init function couldn't
deref the __init part of x86_platform.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2023-04-19 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 12:29 Borislav Petkov
2023-04-16 17:33 ` Linus Torvalds
2023-04-17  9:04   ` Borislav Petkov
2023-04-18  1:24     ` Josh Poimboeuf
2023-04-19 15:59       ` Borislav Petkov
2023-04-19 16:03         ` Juergen Gross [this message]
2023-04-19 16:44           ` Josh Poimboeuf
2023-04-16 17:43 ` pr-tracker-bot

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=ed6bfa1a-7e82-8273-ee7f-0e8097397724@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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®