From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40hZlw5f7TzF2Ch for ; Fri, 11 May 2018 00:06:52 +1000 (AEST) In-Reply-To: <20180508070517.947-2-clg@kaod.org> To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , linuxppc-dev@lists.ozlabs.org From: Michael Ellerman Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: Re: [v2, 1/4] powerpc/64/kexec: fix race in kexec when XIVE is shutdown Message-Id: <40hZlp6plSz9s1B@ozlabs.org> Date: Fri, 11 May 2018 00:06:44 +1000 (AEST) List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2018-05-08 at 07:05:14 UTC, =?utf-8?q?C=C3=A9dric_Le_Goater?= wrote: > 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 shutdown 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. > > This change of the ending sequence of kexec is mostly useful on the > pseries platform but it impacts also the powernv, ps3 and 85xx > platforms. powernv can be easily tested and fixed but some caution is > required for the other two. > > Signed-off-by: Cédric Le Goater Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/d2b04b0c78881ef1c051cc3a4a2c61 cheers