lkml.org 
[lkml]   [2023]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/13] x86/CPU/AMD: Move the DIV0 bug detection to the Zen1 init function
    Date
    From: "Borislav Petkov (AMD)" <bp@alien8.de>

    No functional changes.

    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    ---
    arch/x86/kernel/cpu/amd.c | 11 ++---------
    1 file changed, 2 insertions(+), 9 deletions(-)

    diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
    index 7cbb108afaf4..43d6a6da7591 100644
    --- a/arch/x86/kernel/cpu/amd.c
    +++ b/arch/x86/kernel/cpu/amd.c
    @@ -70,10 +70,6 @@ static const int amd_erratum_383[] =
    static const int amd_erratum_1054[] =
    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf));

    -static const int amd_div0[] =
    - AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0x00, 0x0, 0x2f, 0xf),
    - AMD_MODEL_RANGE(0x17, 0x50, 0x0, 0x5f, 0xf));
    -
    static const int amd_erratum_1485[] =
    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x19, 0x10, 0x0, 0x1f, 0xf),
    AMD_MODEL_RANGE(0x19, 0x60, 0x0, 0xaf, 0xf));
    @@ -1031,6 +1027,8 @@ static void init_amd_zen(struct cpuinfo_x86 *c)
    set_cpu_cap(c, X86_FEATURE_CPB);
    }

    + pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protection.\n");
    + setup_force_cpu_bug(X86_BUG_DIV0);
    }

    static bool cpu_has_zenbleed_microcode(void)
    @@ -1219,11 +1217,6 @@ static void init_amd(struct cpuinfo_x86 *c)
    cpu_has(c, X86_FEATURE_AUTOIBRS))
    WARN_ON_ONCE(msr_set_bit(MSR_EFER, _EFER_AUTOIBRS));

    - if (cpu_has_amd_erratum(c, amd_div0)) {
    - pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protection.\n");
    - setup_force_cpu_bug(X86_BUG_DIV0);
    - }
    -
    if (!cpu_has(c, X86_FEATURE_HYPERVISOR) &&
    cpu_has_amd_erratum(c, amd_erratum_1485))
    msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT);
    --
    2.42.0.rc0.25.ga82fb66fed25
    \
     
     \ /
      Last update: 2023-11-20 14:05    [W:4.128 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site