Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1635120pxb; Wed, 9 Feb 2022 00:44:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIPDmSRyEGLvqp6rZY0Uu8qfFmjN/glQKrCjHYB6kDppHR/M1h6FeGA1PqF9Qyq/hG1L/9 X-Received: by 2002:a17:90b:30c:: with SMTP id ay12mr2239423pjb.57.1644396244604; Wed, 09 Feb 2022 00:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644396244; cv=none; d=google.com; s=arc-20160816; b=WsDsOMvnpQF3yIgeIFMJ8AF79UaRVO3M/7t8tt+SysuXD8N5bK+gq8kTYkKioIkLZx v1olntrsSlAN66SQMGO9eSvNswZWVI+4ZbmkhOqm9cLBXrGVICZfFJYCF5/OOhck1kDg DTxCA35SRBFGhE6sjD+0whe3Lppp45sJTgaVpXRRvw5vlLNr55GpoK9LshBgqDq4Fzm1 stC/vsaec2LXk3oH5qchQE7Nl5leCLapsrt3TOsx3WP1fvC5HzfNTnnK4yhbrQyM8q+D 3j+ctIseA9+J8P/jWz3jrpsga8E3V/A0f9duR6UzwVhVCBrRHcBUUsn6qHOnRb8qQaR/ fzMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vGVp3zsjPiW1BqlDFfDqoH+yDO8CHwU/Wda3k2aztH4=; b=ZrODpCDJvpBy6u1EGW/+a/dnHpOAK1gjtB771HP0BfL3gI8qMJ/QwsDMi4aNhK4Cgj Ih3YJAFKYHAJMmy6W+SwmA+9pWHNhfYMh0l8QZkaQZSKUV37c4K1EUW376v2Fj48+KeP cgN91Pp2VY2z+25aeVot1U9/wW/6AeZwOnb5/TISxocX5PIay7qvXV6yxpW7RFHAbMJD KKRdE2qCbF5uw1cw1hfoP4zyIWv2MD6dTmeBaWEIqtL0gGTFH06E6mjbYT9sGiT/7dJH SkID/x4i5YoqVMhbUFVDI+vfKDUgKkXO5k+LOhqgSuMg4F8JFfiyJxKmJtQnMDN6uoj0 7OPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OtMqY5kN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bc15si14872059pgb.180.2022.02.09.00.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 00:44:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OtMqY5kN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D63AC050CC8; Wed, 9 Feb 2022 00:41:06 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237354AbiBGSbg (ORCPT + 99 others); Mon, 7 Feb 2022 13:31:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239636AbiBGSYr (ORCPT ); Mon, 7 Feb 2022 13:24:47 -0500 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 07 Feb 2022 10:24:47 PST Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D8EC0401D9 for ; Mon, 7 Feb 2022 10:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644258287; x=1675794287; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=iEthWzhLhgfla9mBgcMk3I3im8SSm2ybD3uCeC+OHOg=; b=OtMqY5kNuqY1LJR4rRnx1fu94LZo54QwNyslFN8+zh+BXH5G5Wx+vdn9 JE3zxPDZD9yXrN8TqRRJZiWUWUIN+tkEahoOyG54njaJFMJhnbaRE1fg/ Iww7aU22VAr6Tpul7zLI0w6bAuhnO0J0aX+EtsapqYUE/xrTBBleRpYCL bKkYup7mAblW9fLvQ47FsUQioQN7+14h7EXUh3Tz4XbOUAwpqnOnHxvut +Zqa3zJRd8UoP2xwfxL8bYaTJ9P4JxkLyadWkqGvB8Q/KjUMnG85Y/xHE 69y9pM9KsZL2CVSBbuvZxIbYw0vHUly2LYvD77HcgaMdeaRlOpLrvEn2t g==; X-IronPort-AV: E=McAfee;i="6200,9189,10250"; a="229427855" X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="229427855" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 10:23:44 -0800 X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="484514992" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.146]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 10:23:43 -0800 Date: Mon, 7 Feb 2022 10:23:42 -0800 From: "Luck, Tony" To: Jue Wang Cc: Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [RFC] x86/mce: Add workaround for SKX/CLX/CPX spurious machine checks Message-ID: References: <20220207043640.2829295-1-juew@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220207043640.2829295-1-juew@google.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Sun, Feb 06, 2022 at 08:36:40PM -0800, Jue Wang wrote: > +static bool quirk_skylake_repmov(void) > +{ > + /* > + * State that represents if an SRAR MCE has already signaled on the DCU bank. > + */ > + static DEFINE_PER_CPU(bool, srar_dcu_signaled); > + > + if (unlikely(!__this_cpu_read(srar_dcu_signaled))) { > + u64 mc1_status = mce_rdmsrl(MSR_IA32_MCx_STATUS(1)); Jue, When I reviewed this for you off-list, I didn't notice that you dropped the test for mcgstatus & MCG_STATUS_LMCES as part of moving to a helper function and expanding the test for more bits in mc1_status. I think that test still is still important ... knowing that this is a *local* machine check before making decision based on just what this CPU observes makes this a bit more robust. > + > + if (is_intel_srar(mc1_status)) { > + __this_cpu_write(srar_dcu_signaled, true); > + msr_clear_bit(MSR_IA32_MISC_ENABLE, > + MSR_IA32_MISC_ENABLE_FAST_STRING_BIT); > + mce_wrmsrl(MSR_IA32_MCG_STATUS, 0); > + mce_wrmsrl(MSR_IA32_MCx_STATUS(1), 0); > + pr_err("First SRAR MCE on DCU, CPU: %d, disable fast string copy.\n", > + smp_processor_id()); > + return true; > + } > + } > + return false; > +} -Tony