Skip to contentSkip to conversation

x86: change_page_attr_clear fix

PATCH Applied Huang, Ying 4 participants 5 messages Jan 31, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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(u
 static 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)
#1 lore raw
Quoted 3 lines · Ying

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.

Good catch :-) It actually only needs to flush TLBs not caches in this case.

-Andi

#2 lore raw
Quoted 7 lines · Andi Kleen
Quoted 3 lines · Ying

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.

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

#3 lore raw
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() with change_page_attr_set_clr() in change_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

Applied
#4 lore raw
In reply to Huang, Ying
Quoted 3 lines · Huang, Ying

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.

thanks, applied. Thomas just found this bug today too :-)

Ingo