• Borislav Petkov's avatar
    x86, cpu, amd: Add workaround for family 16h, erratum 793 · 56a59c3e
    Borislav Petkov authored
    commit 3b564968 upstream.
    
    This adds the workaround for erratum 793 as a precaution in case not
    every BIOS implements it.  This addresses CVE-2013-6885.
    
    Erratum text:
    
    [Revision Guide for AMD Family 16h Models 00h-0Fh Processors,
    document 51810 Rev. 3.04 November 2013]
    
    793 Specific Combination of Writes to Write Combined Memory Types and
    Locked Instructions May Cause Core Hang
    
    Description
    
    Under a highly specific and detailed set of internal timing
    conditions, a locked instruction may trigger a timing sequence whereby
    the write to a write combined memory type is not flushed, causing the
    locked instruction to stall indefinitely.
    
    Potential Effect on System
    
    Processor core hang.
    
    Suggested Workaround
    
    BIOS should set MSR
    C001_1020[15] = 1b.
    
    Fix Planned
    
    No fix planned
    
    [ hpa: updated description, fixed typo in MSR name ]
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Link: http://lkml.kernel.org/r/20140114230711.GS29865@pd.tnicTested-by: default avatarAravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
    [bwh: Backported to 3.2:
     - Adjust filename
     - Venkatesh Srinivas pointed out we should use {rd,wr}msrl_safe() to
       avoid crashing on KVM.  This was fixed upstream by commit 8f86a737
       ("x86, AMD: Convert to the new bit access MSR accessors") but that's too
       much trouble to backport.  Here we must use {rd,wr}msrl_amd_safe().]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    Cc: Moritz Muehlenhoff <jmm@debian.org>
    Cc: Venkatesh Srinivas <venkateshs@google.com>
    Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
    56a59c3e
msr-index.h 16.7 KB