[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGM2reaOZiCsJbLonrZH0-uPQFLG4Xek0mJ4gNZe7K6iJFU=Xw@mail.gmail.com>
Date: Mon, 25 Jun 2018 10:06:10 -0400
From: Pavel Tatashin <pasha.tatashin@...cle.com>
To: peterz@...radead.org
Cc: tglx@...utronix.de, Steven Sistare <steven.sistare@...cle.com>,
Daniel Jordan <daniel.m.jordan@...cle.com>,
linux@...linux.org.uk, schwidefsky@...ibm.com,
Heiko Carstens <heiko.carstens@...ibm.com>,
John Stultz <john.stultz@...aro.org>, sboyd@...eaurora.org,
x86@...nel.org, LKML <linux-kernel@...r.kernel.org>,
mingo@...hat.com, hpa@...or.com, douly.fnst@...fujitsu.com,
prarit@...hat.com, feng.tang@...el.com,
Petr Mladek <pmladek@...e.com>, gnomes@...rguk.ukuu.org.uk,
linux-s390@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v12 01/11] x86: text_poke() may access uninitialized
struct pages
> Also, I think the better condition is @early_boot_irqs_disabled, until
> we enable IRQs for the first time, text_poke_early() should be fine. And
> once we enable interrupts, all that other crud should really be working.
Sure, I will use early_boot_irqs_disabled flag. I think, we still want
to have BUG_ON(!after_bootmem); in text_poke(). I could do
BUG_ON(early_boot_irqs_disabled), but I am worried that there are call
sites that might be using text_poke() between mem_init() and
local_irq_enable() in start_kernel().
>
> This gives:
>
> diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c
> index e56c95be2808..425ba6102828 100644
> --- a/arch/x86/kernel/jump_label.c
> +++ b/arch/x86/kernel/jump_label.c
> @@ -46,6 +46,9 @@ static void __jump_label_transform(struct jump_entry *entry,
> const unsigned char default_nop[] = { STATIC_KEY_INIT_NOP };
> const unsigned char *ideal_nop = ideal_nops[NOP_ATOMIC5];
>
> + if (early_boot_irqs_disabled)
> + poker = text_poke_early;
> +
> if (type == JUMP_LABEL_JMP) {
> if (init) {
> /*
>
> > Also, modify text_poke_early to call sync_core().
Also, we still need to add __ref to __jump_label_transform as
text_poke_early() is __init
Powered by blists - more mailing lists