Re: [PATCH] x86_64: check if Tom2 is enabled

From: Cyrill Gorcunov
Date: Mon Jan 21 2008 - 12:25:37 EST


[Yinghai Lu - Sun, Jan 20, 2008 at 10:57:46PM -0800]
| [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@xxxxxxx>
|
| 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;
| }

is it possible to change 'l' and 'h' to 'low' and 'high'?
'cause 'l' does look like '1' (one) number...

- Cyrill -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/