Commit 1be85a6d authored by Hans Rosenfeld's avatar Hans Rosenfeld Committed by H. Peter Anvin

x86, cpu: Use AMD errata checking framework for erratum 383

Use the AMD errata checking framework instead of open-coding the test.
Signed-off-by: default avatarHans Rosenfeld <hans.rosenfeld@amd.com>
LKML-Reference: <1280336972-865982-3-git-send-email-hans.rosenfeld@amd.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 9d8888c2
...@@ -1029,6 +1029,7 @@ unsigned long calc_aperfmperf_ratio(struct aperfmperf *old, ...@@ -1029,6 +1029,7 @@ unsigned long calc_aperfmperf_ratio(struct aperfmperf *old,
* AMD errata checking * AMD errata checking
*/ */
#ifdef CONFIG_CPU_SUP_AMD #ifdef CONFIG_CPU_SUP_AMD
extern const int amd_erratum_383[];
extern const int amd_erratum_400[]; extern const int amd_erratum_400[];
extern bool cpu_has_amd_erratum(const int *); extern bool cpu_has_amd_erratum(const int *);
......
...@@ -632,6 +632,8 @@ const int amd_erratum_400[] = ...@@ -632,6 +632,8 @@ const int amd_erratum_400[] =
AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf),
AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf)); AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf));
const int amd_erratum_383[] =
AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf));
bool cpu_has_amd_erratum(const int *erratum) bool cpu_has_amd_erratum(const int *erratum)
{ {
......
...@@ -383,8 +383,7 @@ static void svm_init_erratum_383(void) ...@@ -383,8 +383,7 @@ static void svm_init_erratum_383(void)
int err; int err;
u64 val; u64 val;
/* Only Fam10h is affected */ if (!cpu_has_amd_erratum(amd_erratum_383))
if (boot_cpu_data.x86 != 0x10)
return; return;
/* Use _safe variants to not break nested virtualization */ /* Use _safe variants to not break nested virtualization */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment