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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cyrill Gorcunov
Date: Monday, January 21, 2008 - 10:24 am

[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@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;
|  }

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

		- Cyrill -
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: disable_mtrr_trim only need for x86_64, Yinghai Lu, (Sat Jan 19, 9:45 pm)
Re: [PATCH] x86: disable_mtrr_trim only need for x86_64, H. Peter Anvin, (Sat Jan 19, 10:37 pm)
[PATCH] x86_32: trim memory by updating e820, Yinghai Lu, (Sun Jan 20, 10:44 pm)
[PATCH] x86_64: check if Tom2 is enabled, Yinghai Lu, (Sun Jan 20, 11:57 pm)
Re: [PATCH] x86_64: check if Tom2 is enabled, Cyrill Gorcunov, (Mon Jan 21, 10:24 am)
Re: [PATCH] x86_64: check if Tom2 is enabled, H. Peter Anvin, (Mon Jan 21, 10:39 am)
Re: [PATCH] x86_64: check if Tom2 is enabled, Cyrill Gorcunov, (Mon Jan 21, 10:49 am)
Re: [PATCH] x86_64: check if Tom2 is enabled, Andi Kleen, (Mon Jan 21, 11:03 am)
Re: [PATCH] x86_64: check if Tom2 is enabled, Cyrill Gorcunov, (Mon Jan 21, 11:09 am)
Re: [PATCH] x86_64: check if Tom2 is enabled, H. Peter Anvin, (Mon Jan 21, 11:15 am)
Re: [PATCH] x86_64: check if Tom2 is enabled, Andi Kleen, (Mon Jan 21, 11:46 am)