linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/cpu/amd: Make erratum #1054 a legacy erratum
@ 2020-04-17 14:33 Kim Phillips
  2020-05-06 17:27 ` [tip: x86/cpu] " tip-bot2 for Kim Phillips
  2020-05-07 15:51 ` tip-bot2 for Kim Phillips
  0 siblings, 2 replies; 3+ messages in thread
From: Kim Phillips @ 2020-04-17 14:33 UTC (permalink / raw)
  To: Borislav Petkov, Borislav Petkov, Peter Zijlstra, Ingo Molnar,
	Ingo Molnar, Thomas Gleixner, kim.phillips
  Cc: Andrew Cooper, H. Peter Anvin, Andi Kleen, Tom Lendacky,
	Matt Fleming, Josh Poimboeuf, Frank van der Linden, x86,
	linux-kernel

Commit

  21b5ee59ef18 ("x86/cpu/amd: Enable the fixed Instructions Retired
		 counter IRPERF")

mistakenly added erratum #1054 as OS Visible Work-around (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.

We do however save a couple of rdmsrs 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 <andrew.cooper3@citrix.com>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
Cc: Borislav Petkov <bp@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Frank van der Linden <fllinden@amazon.com>
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/x86/kernel/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 1f875fbe1384..8caf29706eac 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1111,7 +1111,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.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip: x86/cpu] x86/cpu/amd: Make erratum #1054 a legacy erratum
  2020-04-17 14:33 [PATCH] x86/cpu/amd: Make erratum #1054 a legacy erratum Kim Phillips
@ 2020-05-06 17:27 ` tip-bot2 for Kim Phillips
  2020-05-07 15:51 ` tip-bot2 for Kim Phillips
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Kim Phillips @ 2020-05-06 17:27 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Andrew Cooper, Kim Phillips, Borislav Petkov, x86, LKML

The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     3e2c1fd2022ccce96b6a05a6ab519d65769ee320
Gitweb:        https://git.kernel.org/tip/3e2c1fd2022ccce96b6a05a6ab519d65769ee320
Author:        Kim Phillips <kim.phillips@amd.com>
AuthorDate:    Fri, 17 Apr 2020 09:33:56 -05:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 06 May 2020 19:18:24 +02:00

x86/cpu/amd: Make erratum #1054 a legacy erratum

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 <andrew.cooper3@citrix.com>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200417143356.26054-1-kim.phillips@amd.com
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
---
 arch/x86/kernel/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 547ad7b..6437381 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1142,7 +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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip: x86/cpu] x86/cpu/amd: Make erratum #1054 a legacy erratum
  2020-04-17 14:33 [PATCH] x86/cpu/amd: Make erratum #1054 a legacy erratum Kim Phillips
  2020-05-06 17:27 ` [tip: x86/cpu] " tip-bot2 for Kim Phillips
@ 2020-05-07 15:51 ` tip-bot2 for Kim Phillips
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Kim Phillips @ 2020-05-07 15:51 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Andrew Cooper, Kim Phillips, Borislav Petkov, x86, LKML

The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     e2abfc0448a46d8a137505aa180caf14070ec535
Gitweb:        https://git.kernel.org/tip/e2abfc0448a46d8a137505aa180caf14070ec535
Author:        Kim Phillips <kim.phillips@amd.com>
AuthorDate:    Fri, 17 Apr 2020 09:33:56 -05:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Thu, 07 May 2020 17:30:14 +02:00

x86/cpu/amd: Make erratum #1054 a legacy erratum

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 <andrew.cooper3@citrix.com>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200417143356.26054-1-kim.phillips@amd.com
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
---
 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 547ad7b..8a1bdda 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)
 {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-07 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 14:33 [PATCH] x86/cpu/amd: Make erratum #1054 a legacy erratum Kim Phillips
2020-05-06 17:27 ` [tip: x86/cpu] " tip-bot2 for Kim Phillips
2020-05-07 15:51 ` tip-bot2 for Kim Phillips

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).