Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp120021ybg; Mon, 8 Jun 2020 18:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqimoFdxzKuWik4PJpLsB6+pt3yXVJJpKVR+BCWAcdz5/7E0xlv+/ynnyAEB613s2VSvw1 X-Received: by 2002:a17:906:a889:: with SMTP id ha9mr24200166ejb.429.1591665015181; Mon, 08 Jun 2020 18:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591665015; cv=none; d=google.com; s=arc-20160816; b=G8W4l6JP1rK10gyxtyfoQkwdrdRqT9ct1LFM0fza5shsPxn2e2mFAEOKwu2u1bI3Hr bmcdoXWgajVXuc5UQffSDTWMkdzJa3ZXG9BV5zyS4EHi2+Tg7AND4/tCz+SLXL4G6WYq X/ECpOsR6O84IbYGO7F0AjPJ5BWjCDrj8viR7n58CYHjZFg7pBuk5rparDZRHhTPi1q0 4nG7bkOCGv35s1fbZqH9O/MvU4CyT2RYq7AUUDsNaxsQIV6V+hUPCXOa4aUv41+cikiy wi5ywSpAnjJLAbCMCPtUz65Spmtxtq3I+X0ECpCfVaqAFHswPI/x4nykXJcN4MMldJtY Moog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5UEkwzueauvYV0UZc1CmJ4LKUKrUkhbVDkiTw9P17X0=; b=tpTXC0ghgWgI+dt4HZ7t3Jg/GEtpTIfqbAEeUWbY4SPM/LMm/Dm0lF2NCkyVpvAN5U Iuxc7ML7ZRNdPiVrWOLOx64FVTrJyowdkc9c/QmoTnxVonbOQiJ6wY4KzGL3MQ2+W2Oo m9/XNvQV0ZoOx7BT44AmY2/O8iSaQciRfKfUT2/eBPcky7ioYXqufUeY9v5xGF/DUq0q 1xt7l8QRCE8xpeN3prIoP04ZfUsfvx59SMgOMf8hVIxmthio2mWfdF0BGZLFuDKcSWvF G5vAruSaKYVzlUSJTNBM2twHbinicfR2WfAjAqiNKJCRtMG1PSZOCJ1lPsx+E8LVGWIG KjQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D9JHUwC0; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si9369603ejr.261.2020.06.08.18.09.52; Mon, 08 Jun 2020 18:10:15 -0700 (PDT) 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=@kernel.org header.s=default header.b=D9JHUwC0; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388154AbgFIBHm (ORCPT + 99 others); Mon, 8 Jun 2020 21:07:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbgFHXGz (ORCPT ); Mon, 8 Jun 2020 19:06:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2655F2083E; Mon, 8 Jun 2020 23:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657614; bh=rBWiZvWqsDNBGLOZcEsUl4b/4HinwzVnrDOhaM190ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9JHUwC0UPtNPPNiMfx7OYY6ulqaJh6pTPAUPDIBg/l9HCXJQFy1f12Z2XB20qOBp aLhRU/BAILIuRCIudhgBAQvgnWE03wzPtuvzQU2lk970LoExNuYkeIyN5Wrzkv1pML u9g3zMX0D0AbA6ctY2opmswA6qULR8pOCqCIeeDk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kim Phillips , Andrew Cooper , Borislav Petkov , Sasha Levin Subject: [PATCH AUTOSEL 5.7 037/274] x86/cpu/amd: Make erratum #1054 a legacy erratum Date: Mon, 8 Jun 2020 19:02:10 -0400 Message-Id: <20200608230607.3361041-37-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kim Phillips [ Upstream commit e2abfc0448a46d8a137505aa180caf14070ec535 ] Commit 21b5ee59ef18 ("x86/cpu/amd: Enable the fixed Instructions Retired counter IRPERF") mistakenly added erratum #1054 as an OS Visible Workaround (OSVW) ID 0. Erratum #1054 is not OSVW ID 0 [1], so make it a legacy erratum. There would never have been a false positive on older hardware that has OSVW bit 0 set, since the IRPERF feature was not available. However, save a couple of RDMSR executions per thread, on modern system configurations that correctly set non-zero values in their OSVW_ID_Length MSRs. [1] Revision Guide for AMD Family 17h Models 00h-0Fh Processors. The revision guide is available from the bugzilla link below. Fixes: 21b5ee59ef18 ("x86/cpu/amd: Enable the fixed Instructions Retired counter IRPERF") Reported-by: Andrew Cooper Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200417143356.26054-1-kim.phillips@amd.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/amd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 547ad7bbf0e0..8a1bdda895a4 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1142,8 +1142,7 @@ static const int amd_erratum_383[] = /* #1054: Instructions Retired Performance Counter May Be Inaccurate */ static const int amd_erratum_1054[] = - AMD_OSVW_ERRATUM(0, AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf)); - + AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf)); static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) { -- 2.25.1