Skip to content

Commit fa526d0

Browse files
Jack SteinerH. Peter Anvin
authored andcommitted
x86, pat: Fix cacheflush address in change_page_attr_set_clr()
Fix address passed to cpa_flush_range() when changing page attributes from WB to UC. The address (*addr) is modified by __change_page_attr_set_clr(). The result is that the pages being flushed start at the _end_ of the changed range instead of the beginning. This should be considered for 2.6.30-stable and 2.6.31-stable. Signed-off-by: Jack Steiner <steiner@sgi.com> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Stable team <stable@kernel.org>
1 parent a269cca commit fa526d0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/mm/pageattr.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
822822
{
823823
struct cpa_data cpa;
824824
int ret, cache, checkalias;
825+
unsigned long baddr = 0;
825826

826827
/*
827828
* Check, if we are requested to change a not supported
@@ -853,6 +854,11 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
853854
*/
854855
WARN_ON_ONCE(1);
855856
}
857+
/*
858+
* Save address for cache flush. *addr is modified in the call
859+
* to __change_page_attr_set_clr() below.
860+
*/
861+
baddr = *addr;
856862
}
857863

858864
/* Must avoid aliasing mappings in the highmem code */
@@ -900,7 +906,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
900906
cpa_flush_array(addr, numpages, cache,
901907
cpa.flags, pages);
902908
} else
903-
cpa_flush_range(*addr, numpages, cache);
909+
cpa_flush_range(baddr, numpages, cache);
904910
} else
905911
cpa_flush_all(cache);
906912

0 commit comments

Comments
 (0)