Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7599630rwr; Tue, 25 Apr 2023 16:05:42 -0700 (PDT) X-Google-Smtp-Source: AKy350a5Nvwd2/EuAvbSFuWvtgmZhwy1uFp3J8u3CsVSgHr+W0yDZE6e4lK9zQYjdOsayjhuqXx8 X-Received: by 2002:a05:6a21:168b:b0:ec:7cc:2da6 with SMTP id np11-20020a056a21168b00b000ec07cc2da6mr20450599pzb.56.1682463942558; Tue, 25 Apr 2023 16:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682463942; cv=none; d=google.com; s=arc-20160816; b=HhAMXkgW6ML7lc7fEcOB0jwzZKByJt0lBZyP2gbhKu1HmfzVcZwv7blXQVhQqarYUi bCUfhC7vsmvy/sLYSd+4fShVNc77M/MrOMwQV2m/mnB/0I5HTwRz1VZqWkvVhgXnhp5q s8IvIil+mtdUPRGuw6XO+qrzd0OQ6+UB+cVF8YHwhMXdsG3tdlZks1tHK55p2++zrEik mJhs+/CEWEfT6at5KgskFFXNHE1H9Ogo+Jqinfw8u70WE22KIYGFYQzRfcrh74BMerx+ AJM05jKxdwiGM+IyO5Usd01geCG2p6XgebpLJElLdBqFLS3d9GPNPta5IfsBica/k6Go 4oSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=+xi1m4IlR6UmZMMi3ONfEx6qfukMjT8mnp8XWxnWtv0=; b=0iP1asiLWWeb8d37fLnaTAre5i46BiAezh8vSY2eSHY9K+5wTEwvNCZYGGmPf5DL3h lNosQVaYMmilGoZpGroBnLqvP77gp7gMKNTSugZ8Dx0fWOsj4UCuT4K3bRVLLfO8jORY v99ihc5UV+frVOZzHLXbJXUgQs5TJG69X4XWwThAZ+Y0E0rKYRq1Bl8LXNSE0a7A2XrB GsLV4OQWJnuHETAf8QCC+OFXxXpTYWD9zd3kHd7kW/yt8EL54XUPmtyaxIxxUSIEvWZK rZDp6m0/I7t6UsO3KXzjhSg9nk4dGuvr5CkZ3024fZPxvNr0BccA4brUIuIyEaMaNWZ+ aszQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ww1058Sh; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j16-20020a63e750000000b0051b631334f1si13890535pgk.764.2023.04.25.16.05.26; Tue, 25 Apr 2023 16:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ww1058Sh; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236176AbjDYXAi (ORCPT + 99 others); Tue, 25 Apr 2023 19:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjDYXAg (ORCPT ); Tue, 25 Apr 2023 19:00:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ED50AF22 for ; Tue, 25 Apr 2023 16:00:35 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682463632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+xi1m4IlR6UmZMMi3ONfEx6qfukMjT8mnp8XWxnWtv0=; b=ww1058Sh6ajk58vJ3U/YypFjA5A6rdVE4snPFJ4Nhzir65J/UKYkUM/pBW+z6CLCIxI+3j nDeAL1CatekP6AMzsSkaeat3B8eit04wGTYBlyGihPQM6UCqM98LRq79AHHM5B4/TJTEyG /GY8MS6/xavEMKpwa/uWbVaniGN7y8Xx7s5NO7ljZ7faiB77nPmCmlXcoLfGUpv8yvYvde xraPh3PRJPWkJgnIWZkzVyMWin4nHHCVDB4DrddqdDYhxHJXO8RpQ7YvxIcDX1XEYo2+Dx NXUYPWUtNz8lmyoDhseA0hiOqYGxAcP5aShWunw/mgKt5F0DUS6jfQkTE7J7DQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682463632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+xi1m4IlR6UmZMMi3ONfEx6qfukMjT8mnp8XWxnWtv0=; b=NnybxPpRjgTFCeqNEvNDMDMNbioY+kg5jNz+tMC31aFbqH5jOCed65NRlFzRdazmo1XxlM NJlbxWx1LJYqR0DQ== To: Dave Hansen , Tony Battersby , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H. Peter Anvin" , Mario Limonciello , Tom Lendacky , "linux-kernel@vger.kernel.org" , Andi Kleen Subject: Re: [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff In-Reply-To: References: <3817d810-e0f1-8ef8-0bbd-663b919ca49b@cybernetics.com> <87o7nbzn8w.ffs@tglx> Date: Wed, 26 Apr 2023 01:00:31 +0200 Message-ID: <87leifzhww.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25 2023 at 15:29, Dave Hansen wrote: > On 4/25/23 14:05, Thomas Gleixner wrote: >> The only consequence of looking at bit 0 of some random other leaf is >> that all CPUs which run stop_this_cpu() issue WBINVD in parallel, which >> is slow but should not be a fatal issue. >> >> Tony observed this is a 50% chance to hang, which means this is a timing >> issue. > > I _think_ the system in question is a dual-socket Westmere. I don't see > any obvious errata that we could pin this on: > >> https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-5600-specification-update.pdf > > Andi Kleen had an interesting theory. WBINVD is a pretty expensive > operation. It's possible that it has some degenerative behavior when > it's called on a *bunch* of CPUs all at once (which this path can do). > If the instruction takes too long, it could trigger one of the CPU's > internal lockup detectors and trigger a machine check. At that point, > all hell breaks loose. > > I don't know the cache coherency protocol well enough to say for sure, > but I wonder if there's a storm of cache coherency traffic as all those > lines get written back. One of the CPUs gets starved from making enough > forward progress and trips a CPU-internal watchdog. > > Andi also says that it _should_ log something in the machine check banks > when this happens so there should be at least some kind of breadcrumb. > > Either way, I'm hoping this hand waving satiates tglx's morbid curiosity > about hardware that came out from before I even worked at Intel. ;) No, it does not. :) There is no reason to believe that this is just a problem of CPUs which were released long time ago. If there is an issue with concurrent WBINVD then this needs to be addressed independently of Tony's observations. Aside of that the allowance for the control CPU to make progress based on the early clearing of the CPU online bit is still a possibility to explain the wreckage just based on timing. The reason why I insist on a proper analysis is definitely not morbid curiosity. The real reason is that I fundamentally hate problems being handwaved away. It's a matter of fact that all problems which are not root caused keep coming back and not necessarily in debuggable ways. Tony's 50% case is golden compared to the once in a blue moon issues. I outlined the debug options already. So just throw them at the problem instead of indulging in handwaing theories. Thanks, tglx