linux/arch
Michel Lespinasse 7d02505965 mm: fix cache coloring on x86_64 architecture
Fix the x86-64 cache alignment code to take pgoff into account.  Use the
x86 and MIPS cache alignment code as the basis for a generic cache
alignment function.

The old x86 code will always align the mmap to aliasing boundaries,
even if the program mmaps the file with a non-zero pgoff.

If program A mmaps the file with pgoff 0, and program B mmaps the file
with pgoff 1.  The old code would align the mmaps, resulting in misaligned
pages:

  A:  0123
  B:  123

After this patch, they are aligned so the pages line up:

  A: 0123
  B:  123

Proposed by Rik van Riel.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-11 17:22:25 -08:00
..
alpha mm: support more pagesizes for MAP_HUGETLB/SHM_HUGETLB 2012-12-11 17:22:25 -08:00
arm Device tree changes for v3.8 2012-12-11 11:30:41 -08:00
arm64 Device tree changes for v3.8 2012-12-11 11:30:41 -08:00
avr32 Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00
blackfin Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00
c6x Device tree changes for v3.8 2012-12-11 11:30:41 -08:00
cris Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00
frv frv: fix the broken preempt 2012-11-02 12:08:25 -04:00
h8300 h8300: add missing L1_CACHE_SHIFT 2012-11-09 06:41:47 +01:00
hexagon Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
ia64 revert "mm: fix-up zone present pages" 2012-11-16 14:33:04 -08:00
m32r Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00
m68k m68k: fix sigset_t accessor functions 2012-11-18 10:32:16 +01:00
microblaze Device tree changes for v3.8 2012-12-11 11:30:41 -08:00
mips mm: support more pagesizes for MAP_HUGETLB/SHM_HUGETLB 2012-12-11 17:22:25 -08:00
mn10300 UAPI: Make arch/mn10300/include/uapi/asm/setup.h non-empty 2012-10-17 12:32:35 +01:00
openrisc Device tree changes for v3.8 2012-12-11 11:30:41 -08:00
parisc mm: support more pagesizes for MAP_HUGETLB/SHM_HUGETLB 2012-12-11 17:22:25 -08:00
powerpc numa: convert static memory to dynamically allocated memory for per node device 2012-12-11 17:22:23 -08:00
s390 mm: add comment on storage key dirty bit semantics 2012-12-11 17:22:23 -08:00
score score: do_sigaltstack() expects a userland pointer... 2012-11-28 21:46:12 -05:00
sh sh64: fix altstack switching on sigreturn 2012-11-28 21:46:11 -05:00
sparc Device tree changes for v3.8 2012-12-11 11:30:41 -08:00
tile arch/tile: avoid build warnings from duplicate ELF_R_xxx #defines 2012-10-23 10:22:48 -04:00
um um: get_safe_registers() should be done in flush_thread(), not start_thread() 2012-11-28 21:46:03 -05:00
unicore32 arch/unicore32: remove CONFIG_EXPERIMENTAL 2012-11-09 17:30:10 +08:00
x86 mm: fix cache coloring on x86_64 architecture 2012-12-11 17:22:25 -08:00
xtensa mm: support more pagesizes for MAP_HUGETLB/SHM_HUGETLB 2012-12-11 17:22:25 -08:00
.gitignore
Kconfig Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00