2008-01-31 07:36:40

by Huang, Ying

[permalink] [raw]
Subject: [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.

Signed-off-by: Huang Ying <[email protected]>

---
arch/x86/mm/pageattr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -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)


2008-01-31 07:44:00

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH 1/5] x86: change_page_attr_clear fix

On Thursday 31 January 2008 08:35:59 Huang, Ying wrote:
> 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

2008-01-31 12:11:21

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 1/5] x86: change_page_attr_clear fix


* Huang, Ying <[email protected]> wrote:

> 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

2008-01-31 12:39:23

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 1/5] x86: change_page_attr_clear fix

On Thu, 31 Jan 2008, Andi Kleen wrote:

> On Thursday 31 January 2008 08:35:59 Huang, Ying wrote:
> > 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

2008-01-31 12:53:29

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH 1/5] x86: change_page_attr_clear fix

On Thursday 31 January 2008 13:38:45 Thomas Gleixner wrote:
> On Thu, 31 Jan 2008, Andi Kleen wrote:
>
> > On Thursday 31 January 2008 08:35:59 Huang, Ying wrote:
> > > 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.

I actually ported it already forward from my old patchkit (together
with some other improvements). Will post later.

-Andi