diff options
-rw-r--r-- | arch/x86/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/svm.c | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index eebdc1fde3d1..d85637bb9505 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -1029,6 +1029,7 @@ unsigned long calc_aperfmperf_ratio(struct aperfmperf *old, | |||
1029 | * AMD errata checking | 1029 | * AMD errata checking |
1030 | */ | 1030 | */ |
1031 | #ifdef CONFIG_CPU_SUP_AMD | 1031 | #ifdef CONFIG_CPU_SUP_AMD |
1032 | extern const int amd_erratum_383[]; | ||
1032 | extern const int amd_erratum_400[]; | 1033 | extern const int amd_erratum_400[]; |
1033 | extern bool cpu_has_amd_erratum(const int *); | 1034 | extern bool cpu_has_amd_erratum(const int *); |
1034 | 1035 | ||
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index a62a4ae7a11a..30f30dcbdb82 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -632,6 +632,8 @@ const int amd_erratum_400[] = | |||
632 | AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), | 632 | AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), |
633 | AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf)); | 633 | AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf)); |
634 | 634 | ||
635 | const int amd_erratum_383[] = | ||
636 | AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf)); | ||
635 | 637 | ||
636 | bool cpu_has_amd_erratum(const int *erratum) | 638 | bool cpu_has_amd_erratum(const int *erratum) |
637 | { | 639 | { |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index ce438e0fdd26..03b534b34ee9 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -383,8 +383,7 @@ static void svm_init_erratum_383(void) | |||
383 | int err; | 383 | int err; |
384 | u64 val; | 384 | u64 val; |
385 | 385 | ||
386 | /* Only Fam10h is affected */ | 386 | if (!cpu_has_amd_erratum(amd_erratum_383)) |
387 | if (boot_cpu_data.x86 != 0x10) | ||
388 | return; | 387 | return; |
389 | 388 | ||
390 | /* Use _safe variants to not break nested virtualization */ | 389 | /* Use _safe variants to not break nested virtualization */ |