x86: change_page_attr_clear fix
PATCH 1/5 x86: change_page_attr_clear fix
This patch replaces __change_page_attr_set_clr() with change_page_attr_set_clr() in change_page_attr_clear() to flush the TLB/cache properly.
--- arch/x86/mm/pageattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/mm/pageattr.c +1 -2
@@ -426,8 +426,7 @@ static inline int change_page_attr_set(ustatic inline int change_page_attr_clear (unsigned long addr,int numpages,pgprot_t mask) { -return __change_page_attr_set_clr (addr, numpages,__pgprot (0 ), mask); - +return change_page_attr_set_clr (addr, numpages,__pgprot (0 ), mask); }int set_memory_uc (unsigned long addr,int numpages)
Quoted 3 lines · Ying
This patch replaces
__change_page_attr_set_clr()withchange_page_attr_set_clr()inchange_page_attr_clear()to flush the TLB/cache properly.
Good catch :-) It actually only needs to flush TLBs not caches in this case.
-Andi
Quoted 7 lines · Andi Kleen
Quoted 3 lines · Ying
This patch replaces
__change_page_attr_set_clr()withchange_page_attr_set_clr()inchange_page_attr_clear()to flush the TLB/cache properly.Good catch :-) It actually only needs to flush TLBs not caches in this case.
That's one of the items on our optimizations todo list already. There are more low hanging fruits, but we need to make sure that the non optimized version is bullet proof first.
Thanks,
tglx
Quoted 7 lines · On Thursday 31 January 2008 13:38:45 Thomas Gleixner wrote:
Quoted 5 lines · Andi Kleen
Quoted 3 lines · Ying
This patch replaces
__change_page_attr_set_clr()withchange_page_attr_set_clr()inchange_page_attr_clear()to flush the TLB/cache properly.
Quoted 6 lines
Quoted 2 lines
Good catch :-) It actually only needs to flush TLBs not caches in this case.
That's one of the items on our optimizations todo list already. There are more low hanging fruits, but we need to make sure that the non optimized version is bullet proof first.
I actually ported it already forward from my old patchkit (together with some other improvements). Will post later.
-Andi
Ingo Molnar
AppliedQuoted 3 lines · Huang, Ying
This patch replaces
__change_page_attr_set_clr()withchange_page_attr_set_clr()inchange_page_attr_clear()to flush the TLB/cache properly.
thanks, applied. Thomas just found this bug today too :-)
Ingo