lkml.org 
[lkml]   [2008]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] x86_64: check if Tom2 is enabled
    [PATCH] x86_64: check if Tom2 is enabled

    need to applied after andi's amd special tom2 wb check patch

    in amd_special_default_mtrr need to check if TOM2 is enabled

    Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>

    diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
    index 289ba1a..26eed57 100644
    --- a/arch/x86/kernel/cpu/mtrr/main.c
    +++ b/arch/x86/kernel/cpu/mtrr/main.c
    @@ -641,6 +641,7 @@ early_param("disable_mtrr_trim", disable_mtrr_trim_setup);
    * Note this won't check if the MTRRs < 4GB where the magic bit doesn't
    * apply to are wrong, but so far we don't know of any such case in the wild.
    */
    +#define Tom2Enabled (1U << 21)
    #define Tom2ForceMemTypeWB (1U << 22)

    static __init int amd_special_default_mtrr(void)
    @@ -661,7 +662,8 @@ static __init int amd_special_default_mtrr(void)
    * Memory between 4GB and top of mem is forced WB by this magic bit.
    * Reserved before K8RevF, but should be zero there.
    */
    - if (l & Tom2ForceMemTypeWB)
    + if ((l & (Tom2Enabled | Tom2ForceMemTypeWB)) ==
    + (Tom2Enabled | Tom2ForceMemTypeWB))
    return 1;
    return 0;
    }

    \
     
     \ /
      Last update: 2008-01-21 07:55    [W:0.022 / U:30.436 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site