diff options
author | Yuanjie Huang <Yuanjie.Huang@windriver.com> | 2014-10-22 04:47:57 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-04 10:19:53 +0000 |
commit | a31080021ad3ecfb92220dcb8c717928db268f1e (patch) | |
tree | 2d164c1d459dbbd4716a620add2a9e3471a88c8e /meta/recipes-devtools/mtd | |
parent | 9f2398a0ff42389052155d971f136a37c5dc80da (diff) | |
download | openembedded-core-a31080021ad3ecfb92220dcb8c717928db268f1e.tar.gz openembedded-core-a31080021ad3ecfb92220dcb8c717928db268f1e.tar.bz2 openembedded-core-a31080021ad3ecfb92220dcb8c717928db268f1e.zip |
mtd-utils: Fix alignment trap triggered by NEON instructions
NEON instruction VLD1.64 was used to copy 64 bits data after type
casting, and they will trigger alignment trap.
This patch uses memcpy to avoid alignment problem.
Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-devtools/mtd')
-rw-r--r-- | meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch | 44 | ||||
-rw-r--r-- | meta/recipes-devtools/mtd/mtd-utils_git.bb | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch new file mode 100644 index 0000000000..05f1629d58 --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch @@ -0,0 +1,44 @@ +Upstream-Status: Pending + +NEON instruction VLD1.64 was used to copy 64 bits data after type +casting, and they will trigger alignment trap. +This patch uses memcpy to avoid alignment problem. + +Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com> + +diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h +index d3a02d4..e7e9218 100644 +--- a/mkfs.ubifs/key.h ++++ b/mkfs.ubifs/key.h +@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum, + */ + static inline void key_write(const union ubifs_key *from, void *to) + { +- union ubifs_key *t = to; ++ __le32 x[2]; + +- t->j32[0] = cpu_to_le32(from->u32[0]); +- t->j32[1] = cpu_to_le32(from->u32[1]); ++ x[0] = cpu_to_le32(from->u32[0]); ++ x[1] = cpu_to_le32(from->u32[1]); ++ ++ memcpy(to, &x, 8); + memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8); + } + +@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to) + */ + static inline void key_write_idx(const union ubifs_key *from, void *to) + { +- union ubifs_key *t = to; ++ __le32 x[2]; ++ ++ x[0] = cpu_to_le32(from->u32[0]); ++ x[1] = cpu_to_le32(from->u32[1]); + +- t->j32[0] = cpu_to_le32(from->u32[0]); +- t->j32[1] = cpu_to_le32(from->u32[1]); ++ memcpy(to, &x, 8); + } + + /** diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb index f78bc7e7f9..52297c63ba 100644 --- a/meta/recipes-devtools/mtd/mtd-utils_git.bb +++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb @@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b" SRC_URI = "git://git.infradead.org/mtd-utils.git \ file://add-exclusion-to-mkfs-jffs2-git-2.patch \ + file://fix-armv7-neon-alignment.patch \ " PV = "1.5.1+git${SRCPV}" |