diff options
author | Brian Behlendorf <[email protected]> | 2018-07-11 13:10:40 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2018-07-11 13:10:40 -0700 |
commit | 33a19e0fd9b22364d295351ea1bda57b80e39e85 (patch) | |
tree | 1a0bf9708376d1a00e64dd5f8e23eb3bbcb739b9 /lib | |
parent | 2dca37d8dc13e6faf92c5a095d49dffd480c5b2d (diff) |
Fix kernel unaligned access on sparc64
Update the SA_COPY_DATA macro to check if architecture supports
efficient unaligned memory accesses at compile time. Otherwise
fallback to using the sa_copy_data() function.
The kernel provided CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is
used to determine availability in kernel space. In user space
the x86_64, x86, powerpc, and sometimes arm architectures will
define the HAVE_EFFICIENT_UNALIGNED_ACCESS macro.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #7642
Closes #7684
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libspl/include/sys/isa_defs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libspl/include/sys/isa_defs.h b/lib/libspl/include/sys/isa_defs.h index a5bea0396..7a90e077e 100644 --- a/lib/libspl/include/sys/isa_defs.h +++ b/lib/libspl/include/sys/isa_defs.h @@ -55,6 +55,7 @@ extern "C" { #endif #define _SUNOS_VTOC_16 +#define HAVE_EFFICIENT_UNALIGNED_ACCESS /* i386 arch specific defines */ #elif defined(__i386) || defined(__i386__) @@ -76,6 +77,7 @@ extern "C" { #endif #define _SUNOS_VTOC_16 +#define HAVE_EFFICIENT_UNALIGNED_ACCESS /* powerpc arch specific defines */ #elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) @@ -99,6 +101,7 @@ extern "C" { #endif #define _SUNOS_VTOC_16 +#define HAVE_EFFICIENT_UNALIGNED_ACCESS /* arm arch specific defines */ #elif defined(__arm) || defined(__arm__) || defined(__aarch64__) @@ -129,6 +132,10 @@ extern "C" { #define _SUNOS_VTOC_16 +#if defined(__ARM_FEATURE_UNALIGNED) +#define HAVE_EFFICIENT_UNALIGNED_ACCESS +#endif + /* sparc arch specific defines */ #elif defined(__sparc) || defined(__sparc__) |