Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp380389pxb; Tue, 15 Feb 2022 16:01:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzNsHaYVR/KGYJ34mIdMlyfVjaMwejIPrkxUfBWpy9a606r+Es3VV2GllftdObfxS2A8CI X-Received: by 2002:a17:906:3588:b0:6a7:7ac1:cac8 with SMTP id o8-20020a170906358800b006a77ac1cac8mr332375ejb.342.1644969710631; Tue, 15 Feb 2022 16:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644969710; cv=none; d=google.com; s=arc-20160816; b=dqgKJMZlA4KsMCbKl0jQwkMfsUfV1cmvhzn7Lm4bCQuv2fjR6fweWbheJLha/kHkaA SmlNmw0/dCOp5ScUq1KX+mlN3yZsJZ2Wj5C609ZD7gnHkaxgGDFJZOcM7tkFHV1Y8cQO hAyL0qLoxwYC+q5Sxm45KIgcE1ZfDADLzFJp3lwSCMIyxlCXnWFK9wKbCah0oWuraXhp CDKTGKPb+aEI37mFUeN8Kir4drb4egyoXB/mEXwGlmTsUYcaZ0Ef4vi+6FwdX/14fI54 HJwDWuQ9HzH+LYv0iL/b3200A1H1s8sM9hUuxunz2rObA0PTKlxYrBn7DsUSlsK1bA11 GjzQ== 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=ThEJdE5Au5RB2nl7I/ZnuDoneNCPktwgRzcU7+x0BIs=; b=bOYYZYZ7Go3dR/kp94s7LH+g5esbUz7EaVicuZsF2lWd3+yY20TxmjspeMBAaHswL6 hpuVnorlxXBok5+L5tBHzZx3cSAlLGGD1Gpk0OabRiRsKfXlbO1ArT1JCoP5UtJLqCnL VOFMs4BCrOI9GUEtT9AbtH1gmnA8AAwXIYnn1gy93AEn3sDTB7y/CorkiBUFGX6gtonx nMPrsliUCP3NnBAbRyPuRTqpam4YmHDT00AoU5o3MspLDFRt/x6xwy/IhRaujtC15P6o mv6hXBBIa7T6Um5NfoYCVnmsAdW7aJGOqKsCwRd9In0KGT49C2Lm3XWbqazlKLhIG34+ H7mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W5YTAaFf; 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 ne21si25884638ejc.816.2022.02.15.16.01.23; Tue, 15 Feb 2022 16:01:50 -0800 (PST) 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=W5YTAaFf; 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 S243167AbiBOSnA (ORCPT + 99 others); Tue, 15 Feb 2022 13:43:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243171AbiBOSm7 (ORCPT ); Tue, 15 Feb 2022 13:42:59 -0500 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73DB927FEA for ; Tue, 15 Feb 2022 10:42: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=1644950566; x=1676486566; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Uq3mK2F4oBeJy49d6SR0mO9NdzovVt3JSrPgHEwNGYw=; b=W5YTAaFfp7s1FpSHaJ9WNGYT3P2ugleLxF6xKi8I8zrdGd5Vj8hX7AOe QxerCg3RQ3Vm37LVgzaFJBmG19y7NGIkqbZkPuemIep89kORBbrnHTTr3 8CougRYcS/lBM38SHVjwBzYrZ+A1+KSIw6qPaKTGtohR3UFgwFW1TrXWw NT+atc1II32rMbbFet12Hq21a0o484tWISodtRPkYZYfVRrRpwdZZz2DL wfAzkfk9tJxVfMIcmWtFzU0ZXZwQk/2A6dg91WQQOciZIXRZJ0MDbGe18 yOWXbed1HRZuRc3dF7VKzn4hnR9cPSkNylRa+72Fc+Kn+oLEARqOj+6y7 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="311167725" X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="311167725" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 10:42:43 -0800 X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="624957742" Received: from agluck-desk3.sc.intel.com ([172.25.222.60]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 10:42:43 -0800 Date: Tue, 15 Feb 2022 10:42: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: [PATCH] x86/mce: Add workaround for SKX/CLX/CPX spurious machine checks Message-ID: References: <20220208150945.266978-1-juew@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220208150945.266978-1-juew@google.com> X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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, Feb 08, 2022 at 07:09:45AM -0800, Jue Wang wrote: > +static bool quirk_skylake_repmov(void) > +{ > + u64 mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS); > + u64 misc_enable = __rdmsr(MSR_IA32_MISC_ENABLE); > + > + if ((mcgstatus & MCG_STATUS_LMCES) && > + unlikely(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) { > + u64 mc1_status = mce_rdmsrl(MSR_IA32_MCx_STATUS(1)); > + Needs a comment that this big blob of logic is checking for a software recoverable data fetch error. > + if ((mc1_status & > + (MCI_STATUS_VAL|MCI_STATUS_OVER|MCI_STATUS_UC|MCI_STATUS_EN| > + MCI_STATUS_ADDRV|MCI_STATUS_MISCV|MCI_STATUS_PCC| > + MCI_STATUS_AR|MCI_STATUS_S)) == > + (MCI_STATUS_VAL|MCI_STATUS_UC|MCI_STATUS_EN|MCI_STATUS_ADDRV| > + MCI_STATUS_MISCV|MCI_STATUS_AR|MCI_STATUS_S)) { > + 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_once("Errata detected, disable fast string copy instructions.\n"); > + return true; > + } > + } > + return false; > +} Otherwise: Reviewed-by: Tony Luck -Tony