All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Vincent Donnefort <vincent.donnefort@arm.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Steven Price <steven.price@arm.com>,
	linux-kernel@vger.kernel.org, Baokun Li <libaokun1@huawei.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Valentin Schneider <valentin.schneider@arm.com>,
	Yuan ZhaoXiong <yuanzhaoxiong@baidu.com>,
	YueHaibing <yuehaibing@huawei.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>
Subject: [PATCH v3 0/2] cpu/hotplug: Fix cpuhp_cpu_state used before init
Date: Mon, 11 Apr 2022 16:22:31 +0100	[thread overview]
Message-ID: <20220411152233.474129-1-steven.price@arm.com> (raw)

Currently it's possible to trigger a case where the cpuhp_cpu_state::cpu
member is used before it has been initialised. This can cause CPU 0 to
be erroneously marked as dying and trigger a scheduler panic (full
details in v1[1]).

The two patches here fix the root cause by removing the 'cpu' member
altogether and to prevent similar confusion in the future ensure that
the cpuhp_cpu_state structures are initialised before any hotplugging
occurs.

Changes since v2[2]:
 * Remove the cpu member altogether (first patch)
 * Move the initialisation of cpuhp_cpu_state as suggested by tglx
   (second patch)

[1] https://lore.kernel.org/all/20220225134918.105796-1-steven.price@arm.com/
[2] https://lore.kernel.org/all/20220316153637.288199-1-steven.price@arm.com/

Steven Price (2):
  cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state
  cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier

 kernel/cpu.c | 58 ++++++++++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 27 deletions(-)

-- 
2.25.1


             reply	other threads:[~2022-04-11 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 15:22 Steven Price [this message]
2022-04-11 15:22 ` [PATCH v3 1/2] cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state Steven Price
2022-04-13 19:25   ` [tip: smp/urgent] " tip-bot2 for Steven Price
2022-04-13 19:32   ` [tip: smp/core] " tip-bot2 for Steven Price
2022-04-11 15:22 ` [PATCH v3 2/2] cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier Steven Price
2022-04-13 19:32   ` [tip: smp/core] " tip-bot2 for Steven Price

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=20220411152233.474129-1-steven.price@arm.com \
    --to=steven.price@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dongli.zhang@oracle.com \
    --cc=libaokun1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.donnefort@arm.com \
    --cc=yuanzhaoxiong@baidu.com \
    --cc=yuehaibing@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.