Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp860882pxb; Tue, 1 Feb 2022 11:58:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDKCAj+eEpGFzdKlfc1HkEfzA/oh3EdP7RhI5LHfcTn1ZfjE5VzvYyLxyF74pgxjutUslZ X-Received: by 2002:a65:5a8c:: with SMTP id c12mr21833924pgt.238.1643745504887; Tue, 01 Feb 2022 11:58:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745504; cv=none; d=google.com; s=arc-20160816; b=D3bX1Wa/LKc7b4x2ZNQ6IIDgn5YXoegyY6IcOV88RKRqxNBnSTjaiDGhrN9/91v1bc fcubI/sQuqqP0kCYGZsxSSvE1romqBKWwQL+EMYmZnVR4nSyIJ+ViFxCCIsD4dNIwcLt 47etYnjcK3BLC5lmNeFWobaw91JE5t8kc/3hX4q8Ykr9f0wgjP6D8oBtfyGAqu8t//DA fyNM1o7MzIphZwZeyU2eVaL+FpuM6+wdiZDK+5GjtUCRzLihccr1BkgOquCuulQZLfqn g8s9/gBjbSBanhhMQvnn2aTFW2z3v1cgwxUMPAg08F/Df0rZ/m7AxFRHmclPPIdRDpgg xJXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C6pYDQMX6AjNLj0eU7EOItxT2MJX2vD2hw2+htqVUVk=; b=ivbztseKF0EpetlGQBaShyrKOnJBG0slmc+ESfdYf3KyhPMhlvBxU/2wRY52TBQ2vm 97Jnp/G1hx+FLCsUomZfRn6k568n9unbofM0pDbqxmpMZIOKSP9hF/T89avromgUsrTJ mDobCZVupfrCiK4OtSp9vx3KZZbJ1n+1ZfLPf7fJDEdzD9GwYlx50HKv7LayUgIW1aif mV9hT2/I/3mOEbdUhovZqH+56Ui56BnaGLbVTXPsAQOJVbDdi0gPS25i6GHPhIv67/WD XmKouEGrbF0MnAj2LstkCzclMyEdKqcbw8/QW7fQDhFzmK2J9EJI4FEHBhp9pCXGI2rN 5SXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kkdL/Y8C"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si17970689pfc.253.2022.02.01.11.58.13; Tue, 01 Feb 2022 11:58:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kkdL/Y8C"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376346AbiAaLIQ (ORCPT + 99 others); Mon, 31 Jan 2022 06:08:16 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:52684 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348750AbiAaLEw (ORCPT ); Mon, 31 Jan 2022 06:04:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7740DB82A59; Mon, 31 Jan 2022 11:04:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31BE8C340E8; Mon, 31 Jan 2022 11:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627090; bh=Zy/7wJoEBkcy3hAg4JIzp40lgboP5C93DThdpp8EI0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kkdL/Y8C5n7J3f3adbd701pSXWzzW0OqG87RxEyciiw3ftpriWcHn1sJ7vzve+p3y V3JTx5KdOUjyH1CMJtBcNC3VZ+WWmNEV2DxiSO/00HsBUwh+1M72TcGcmNQbu3DkKp NoAiQST1UGOYDjYNf/mZEl4txK2KgdhgViAHsiNg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yazen Ghannam , Borislav Petkov Subject: [PATCH 5.10 038/100] x86/MCE/AMD: Allow thresholding interface updates after init Date: Mon, 31 Jan 2022 11:55:59 +0100 Message-Id: <20220131105221.726260203@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yazen Ghannam commit 1f52b0aba6fd37653416375cb8a1ca673acf8d5f upstream. Changes to the AMD Thresholding sysfs code prevents sysfs writes from updating the underlying registers once CPU init is completed, i.e. "threshold_banks" is set. Allow the registers to be updated if the thresholding interface is already initialized or if in the init path. Use the "set_lvt_off" value to indicate if running in the init path, since this value is only set during init. Fixes: a037f3ca0ea0 ("x86/mce/amd: Make threshold bank setting hotplug robust") Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220117161328.19148-1-yazen.ghannam@amd.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/mce/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -387,7 +387,7 @@ static void threshold_restart_bank(void u32 hi, lo; /* sysfs write might race against an offline operation */ - if (this_cpu_read(threshold_banks)) + if (!this_cpu_read(threshold_banks) && !tr->set_lvt_off) return; rdmsr(tr->b->address, lo, hi);