Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7443043rwr; Tue, 25 Apr 2023 13:06:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZtP/RGcyhALsc3whrEOkecHHICSEfkNNpZU/OHNjODFm9hBwEypJYaSt2RGJVRBCZOp4la X-Received: by 2002:a05:6a00:1593:b0:63b:7ae0:fde9 with SMTP id u19-20020a056a00159300b0063b7ae0fde9mr24892173pfk.20.1682453200532; Tue, 25 Apr 2023 13:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682453200; cv=none; d=google.com; s=arc-20160816; b=p8pcxBlF8bQIsyL9sVIXPYcyvyHksHcT9LPW2Qfk46s2HCEKWaWAqEtT0UNZFFrxwX Gu+WWBj3Itv/1YUWSM3+RnT+ZeHCm1Xpg5UVOC3kG6ewAqf7ppY6fDF+fKQ6c7klqyTo 94KMjEO/S6jw2p2vPexZG53jVnaXEZ3AVpTE8gCb7uEBVK/nPrGN/7etBI5YssLai9HH HEst2UUpG7twFKRNtqekpppUDxmDie71hNlex5mJSO20Isevqv1IcQQZPDwpubnAss+n MTQIN7GoJg9ww2zFOfb3BvDOC00qFMLdv1Km2Hf0m563I82PE4Kie2JH0uqVayyUun7t iojQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3k3IYDoYHprHO1+JMcobe5UgduJ66PpYnRSl5hEtM68=; b=WYVHpU35lIuEHOaxhKrr0Bu6Vp2dkmDuWL9I5hqVAyACQYDLBvDlwQkQLyWRE7/0tz 3+6kAlLVJnut+FKSJYBLGCa5Kxj48fgZwdPzXm40RD/W16In+W6EMLcJRrp5UMtkS5rY kwwZM5K53Xhtpxksr1f1nd7g5y/naOFPMVG410m3Z/jiOW++78ahaztjAw2JD4vn0v5K 4Ir0vxd40uKRepv+hh/tvgcjdyk4Wi47tQVPY6isXsi+S7FgsEEiA7ZZeqw6sdpjtxwu xWFx0uTZZyp7pkY6eHgUDN2LF9u+S89Iz96tRlGqcz6ZS00rzpW0Nmfu4CcRuIm+Q2Ng CfPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DraTa1bS; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b188-20020a621bc5000000b0063b870bc579si1780034pfb.349.2023.04.25.13.06.17; Tue, 25 Apr 2023 13:06:40 -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=@intel.com header.s=Intel header.b=DraTa1bS; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236179AbjDYUDg (ORCPT + 99 others); Tue, 25 Apr 2023 16:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235087AbjDYUDe (ORCPT ); Tue, 25 Apr 2023 16:03:34 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B21A619A2 for ; Tue, 25 Apr 2023 13:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682453013; x=1713989013; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=reHRQOre2NO1+iT/Sg5jDcvNmur/+KiCLnVwPnJYHxI=; b=DraTa1bSjYxfH1NEfFfhpnx762mNwWNhucPX5vmJp4u4fgaLfpNUuEz4 f4c7A6JBNsVWYFDR/8s6dz5Qb9I+X35o/b6EpVpk9P0eyvXfVPvJC7QrT LbYxPjnm8zRQNeE3Qfjl1GbjgDPQAQj14m0lgd39PSF5gpSAQs3crYXVI e40ZSx4ma/n6JaXFDTV/LNfC1d+t194NaR2rUZYiabDJxzdmt8HriNZWQ 2wepXrm2RAw6vx/XyJwWbckMLls5bQUiSHykJzt8BwQ7Zhr7RyB/CXsTL WvQdaBZcTxs0/FXY7dMVgYgCyvTH1G8WYt6uQtX/SEsOdLngxpTAqrl8W A==; X-IronPort-AV: E=McAfee;i="6600,9927,10691"; a="374837854" X-IronPort-AV: E=Sophos;i="5.99,226,1677571200"; d="scan'208";a="374837854" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2023 13:03:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10691"; a="687604650" X-IronPort-AV: E=Sophos;i="5.99,226,1677571200"; d="scan'208";a="687604650" Received: from gchacko-mobl1.gar.corp.intel.com (HELO [10.215.145.52]) ([10.215.145.52]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2023 13:03:27 -0700 Message-ID: Date: Tue, 25 Apr 2023 13:03:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff Content-Language: en-US To: Tony Battersby , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H. Peter Anvin" , Mario Limonciello , Tom Lendacky , "linux-kernel@vger.kernel.org" References: <3817d810-e0f1-8ef8-0bbd-663b919ca49b@cybernetics.com> From: Dave Hansen In-Reply-To: <3817d810-e0f1-8ef8-0bbd-663b919ca49b@cybernetics.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,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 4/25/23 12:26, Tony Battersby wrote: > - if (cpuid_eax(0x8000001f) & BIT(0)) > + if (c->extended_cpuid_level >= 0x8000001f && > + (cpuid_eax(0x8000001f) & BIT(0))) > native_wbinvd(); Oh, so the existing code is running into the > If a value entered for CPUID.EAX is higher than the maximum input > value for basic or extended function for that processor then the data > for the highest basic information leaf is returned behavior. It's basically looking at BIT(0) of some random extended leaf. Probably 0x80000008 based on your 'cpuid -r' output.