From: "Cédric Le Goater" <clg@kaod•org>
To: linuxppc-dev@lists•ozlabs.org
Cc: "Michael Ellerman" <mpe@ellerman•id.au>,
"Benjamin Herrenschmidt" <benh@kernel•crashing.org>,
"Cédric Le Goater" <clg@kaod•org>
Subject: [PATCH 1/4] powerpc/64/kexec: fix race in kexec when XIVE is shutdowned
Date: Tue, 3 Apr 2018 09:15:45 +0200 [thread overview]
Message-ID: <20180403071548.19829-2-clg@kaod.org> (raw)
In-Reply-To: <20180403071548.19829-1-clg@kaod.org>
The kexec_state KEXEC_STATE_IRQS_OFF barrier is reached by all
secondary CPUs before the kexec_cpu_down() operation is called on
secondaries. This can raise conflicts and provoque errors in the XIVE
hcalls when XIVE is shutdowned with H_INT_RESET on the primary CPU.
To synchronize the kexec_cpu_down() operations and make sure the
secondaries have completed their task before the primary starts doing
the same, let's move the primary kexec_cpu_down() after the
KEXEC_STATE_REAL_MODE barrier.
Signed-off-by: Cédric Le Goater <clg@kaod•org>
---
arch/powerpc/kernel/machine_kexec_64.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 49d34d7271e7..212ecb8e829c 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -230,16 +230,16 @@ static void kexec_prepare_cpus(void)
/* we are sure every CPU has IRQs off at this point */
kexec_all_irq_disabled = 1;
- /* after we tell the others to go down */
- if (ppc_md.kexec_cpu_down)
- ppc_md.kexec_cpu_down(0, 0);
-
/*
* Before removing MMU mappings make sure all CPUs have entered real
* mode:
*/
kexec_prepare_cpus_wait(KEXEC_STATE_REAL_MODE);
+ /* after we tell the others to go down */
+ if (ppc_md.kexec_cpu_down)
+ ppc_md.kexec_cpu_down(0, 0);
+
put_cpu();
}
--
2.13.6
next prev parent reply other threads:[~2018-04-03 8:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 7:15 [PATCH 0/4] powerpc/xive: add support for H_INT_RESET Cédric Le Goater
2018-04-03 7:15 ` Cédric Le Goater [this message]
2018-05-04 10:41 ` [PATCH 1/4] powerpc/64/kexec: fix race in kexec when XIVE is shutdowned Michael Ellerman
2018-05-04 11:13 ` Cédric Le Goater
2018-05-04 11:36 ` Cédric Le Goater
2018-04-03 7:15 ` [PATCH 2/4] powerpc/xive: fix hcall H_INT_RESET to support long busy delays Cédric Le Goater
2018-05-04 10:41 ` Michael Ellerman
2018-05-04 11:27 ` Cédric Le Goater
2018-04-03 7:15 ` [PATCH 3/4] powerpc/xive: shutdown XIVE when kexec or kdump is performed Cédric Le Goater
2018-05-04 10:42 ` Michael Ellerman
2018-05-04 11:42 ` Cédric Le Goater
2018-04-03 7:15 ` [PATCH 4/4] powerpc/xive: prepare all hcalls to support long busy delays Cédric Le Goater
2018-05-04 10:42 ` Michael Ellerman
2018-05-04 11:49 ` Cédric Le Goater
2018-05-04 22:29 ` Benjamin Herrenschmidt
2018-05-07 2:30 ` Michael Ellerman
2018-05-07 7:32 ` Cédric Le Goater
2018-04-30 16:21 ` [PATCH 0/4] powerpc/xive: add support for H_INT_RESET Cédric Le Goater
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=20180403071548.19829-2-clg@kaod.org \
--to=clg@kaod$(echo .)org \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mpe@ellerman$(echo .)id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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