[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1259237724-21260-1-git-send-email-dfeng@redhat.com>
Date: Thu, 26 Nov 2009 20:15:24 +0800
From: Xiaotian Feng <dfeng@...hat.com>
To: x86@...nel.org
Cc: linux-kernel@...r.kernel.org, Xiaotian Feng <dfeng@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Suresh Siddha <suresh.b.siddha@...el.com>,
Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Subject: [RFC PATCH -tip] x86/pat: fix pat_x_mtrr_type to its essentials
Due to the IA-32 SDM vol 3a "Effective Memory Type" tables, the PAT
and mtrr relations should be:
| UC UC- WC WB [PAT]
--------+--------------------------------------
UC | UC UC(UC-) WC UC(UC-)
WC | UC WC(UC-) WC WC(UC-)
WB | UC UC(UC-) WC WB
[MTRR]
* In () is the current return value.
So, commit b6ff32, Fix pat_x_mtrr_type() to use UC_MINUS when the
mtrr type return UC. But it also made mtrr type WC use UC_MINUS.
This is not reasonable.
Signed-off-by: Xiaotian Feng <dfeng@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
---
arch/x86/mm/pat.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index c37fd51..92e9627 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -228,10 +228,11 @@ static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type)
u8 mtrr_type;
mtrr_type = mtrr_type_lookup(start, end);
- if (mtrr_type != MTRR_TYPE_WRBACK)
- return _PAGE_CACHE_UC_MINUS;
-
- return _PAGE_CACHE_WB;
+ if (mtrr_type == MTRR_TYPE_WRBACK)
+ return _PAGE_CACHE_WB;
+ else if (mtrr_type == MTRR_TYPE_WRCOMB)
+ return _PAGE_CACHE_WC;
+ return _PAGE_CACHE_UC_MINUS;
}
return req_type;
--
1.6.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists