Skip to content

Commit c19fa94

Browse files
author
James Hogan
committed
Add HAVE_64BIT_ALIGNED_ACCESS
On 64 bit architectures with no efficient unaligned access, padding and explicit alignment must be added in various places to prevent unaligned 64bit accesses (such as taskstats and trace ring buffer). However this also needs to apply to 32 bit architectures with 64 bit accesses requiring alignment such as metag. This is solved by adding a new Kconfig symbol HAVE_64BIT_ALIGNED_ACCESS which defaults to 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS, and can be explicitly selected by METAG and any other relevant architectures. This can be used in various places to determine whether 64bit alignment is required. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Ingo Molnar <mingo@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Eric Paris <eparis@redhat.com> Cc: Will Drewry <wad@chromium.org>
1 parent c07380b commit c19fa94

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎arch/Kconfig‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ config UPROBES
9494

9595
If in doubt, say "N".
9696

97+
config HAVE_64BIT_ALIGNED_ACCESS
98+
def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
99+
help
100+
Some architectures require 64 bit accesses to be 64 bit
101+
aligned, which also requires structs containing 64 bit values
102+
to be 64 bit aligned too. This includes some 32 bit
103+
architectures which can do 64 bit accesses, as well as 64 bit
104+
architectures without unaligned access.
105+
106+
This symbol should be selected by an architecture if 64 bit
107+
accesses are required to be 64 bit aligned in this way even
108+
though it is not a 64 bit architecture.
109+
110+
See Documentation/unaligned-memory-access.txt for more
111+
information on the topic of unaligned memory accesses.
112+
97113
config HAVE_EFFICIENT_UNALIGNED_ACCESS
98114
bool
99115
help

0 commit comments

Comments
 (0)