From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 1/2] common/kexec: Prevent deadlock on reentry to the crash path. Date: Wed, 27 Nov 2013 10:27:11 +0000 Message-ID: <5295C8FF.3060204@cantab.net> References: <1384547567-17059-1-git-send-email-andrew.cooper3@citrix.com> <1384547567-17059-2-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384547567-17059-2-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Xen-devel Cc: Tim Deegan , Keir Fraser , David Vrabel , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 15/11/2013 20:32, Andrew Cooper wrote: > In some cases, such as suffering a queued-invalidation timeout while > performing an iommu_crash_shutdown(), Xen can end up reentering the crash > path. Previously, this would result in a deadlock in one_cpu_only(), as the > test_and_set_bit() would fail. > > The crash path is not reentrant, and even if it could be made to be so, it is > almost certain that we would fall over the same reentry condition again. > > The new code can distinguish a reentry case from multiple cpus racing down the > crash path. In the case that a reentry is detected, return back out to the > nested panic() call, which will maybe_reboot() on our behalf. This requires a > bit of return plumbing back up to kexec_crash(). > > While fixing this deadlock, also fix up an minor niggle seen recently from a > XenServer crash report. The report was from a Bank 8 MCE, which had managed > to crash on all cpus at once. The result was a lot of stack traces with cpus > in kexec_common_shutdown(), which was infact the inlined version of > one_cpu_only(). The kexec crash path is not a hotpath, so we can easily > afford to prevent inlining for the sake of clarity in the stack traces. > > Signed-off-by: Andrew Cooper > CC: Keir Fraser > CC: Jan Beulich > CC: Tim Deegan > CC: David Vrabel Reviewed-by: David Vrabel David