Skip to content

Commit 05f5f73

Browse files
committed
x86/CPU/AMD: Drop now unused CPU erratum checking function
Bye bye. Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Nikolay Borisov <[email protected]> Link: http://lore.kernel.org/r/[email protected]
1 parent 794c68b commit 05f5f73

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -34,62 +34,6 @@
3434
*/
3535
static u32 nodes_per_socket = 1;
3636

37-
/*
38-
* AMD errata checking
39-
*
40-
* Errata are defined as arrays of ints using the AMD_LEGACY_ERRATUM() or
41-
* AMD_OSVW_ERRATUM() macros. The latter is intended for newer errata that
42-
* have an OSVW id assigned, which it takes as first argument. Both take a
43-
* variable number of family-specific model-stepping ranges created by
44-
* AMD_MODEL_RANGE().
45-
*
46-
* Example:
47-
*
48-
* const int amd_erratum_319[] =
49-
* AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0x4, 0x2),
50-
* AMD_MODEL_RANGE(0x10, 0x8, 0x0, 0x8, 0x0),
51-
* AMD_MODEL_RANGE(0x10, 0x9, 0x0, 0x9, 0x0));
52-
*/
53-
54-
#define AMD_LEGACY_ERRATUM(...) { -1, __VA_ARGS__, 0 }
55-
#define AMD_OSVW_ERRATUM(osvw_id, ...) { osvw_id, __VA_ARGS__, 0 }
56-
#define AMD_MODEL_RANGE(f, m_start, s_start, m_end, s_end) \
57-
((f << 24) | (m_start << 16) | (s_start << 12) | (m_end << 4) | (s_end))
58-
#define AMD_MODEL_RANGE_FAMILY(range) (((range) >> 24) & 0xff)
59-
#define AMD_MODEL_RANGE_START(range) (((range) >> 12) & 0xfff)
60-
#define AMD_MODEL_RANGE_END(range) ((range) & 0xfff)
61-
62-
static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
63-
{
64-
int osvw_id = *erratum++;
65-
u32 range;
66-
u32 ms;
67-
68-
if (osvw_id >= 0 && osvw_id < 65536 &&
69-
cpu_has(cpu, X86_FEATURE_OSVW)) {
70-
u64 osvw_len;
71-
72-
rdmsrl(MSR_AMD64_OSVW_ID_LENGTH, osvw_len);
73-
if (osvw_id < osvw_len) {
74-
u64 osvw_bits;
75-
76-
rdmsrl(MSR_AMD64_OSVW_STATUS + (osvw_id >> 6),
77-
osvw_bits);
78-
return osvw_bits & (1ULL << (osvw_id & 0x3f));
79-
}
80-
}
81-
82-
/* OSVW unavailable or ID unknown, match family-model-stepping range */
83-
ms = (cpu->x86_model << 4) | cpu->x86_stepping;
84-
while ((range = *erratum++))
85-
if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
86-
(ms >= AMD_MODEL_RANGE_START(range)) &&
87-
(ms <= AMD_MODEL_RANGE_END(range)))
88-
return true;
89-
90-
return false;
91-
}
92-
9337
static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)
9438
{
9539
u32 gprs[8] = { 0 };

0 commit comments

Comments
 (0)