Skip to content

Commit

Permalink
[ARM] 3101/1: ARM EABI: slab memory must be 64-bit aligned
Browse files Browse the repository at this point in the history
Patch from Nicolas Pitre

Although ARM is still using 32-bit pointers, version 5 and later
versions of the ARM architecture introduced the ldrd and strd
instructions to move 64-bit data which must be 64-bit aligned in memory,
and the EABI includes new constraints on structure data alignment to
allow for the compiler to use those instructions. This means that any
slab allocation must start on a 64-bit boundary which is not equivalent
to BYTES_PER_WORD, especially on those architecture versions that
implements the ldrd/strd instructions.

Overriding the default alignment disables some slab debug features. If
those debug features are really needed then the kernel will have to be
compiled for version 4 of the ARM architecture.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Nicolas Pitre authored and Russell King committed Jan 14, 2006
1 parent fa0fe48 commit da2b1cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/asm-arm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ extern pmd_t *top_pmd;
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)

/*
* With EABI on ARMv5 and above we must have 64-bit aligned slab pointers.
*/
#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
#define ARCH_SLAB_MINALIGN 8
#endif

#endif /* __KERNEL__ */

#include <asm-generic/page.h>
Expand Down

0 comments on commit da2b1cd

Please sign in to comment.