From patchwork Wed Mar 22 10:22:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Oberhollenzer X-Patchwork-Id: 741954 X-Patchwork-Delegate: david.oberhollenzer@sigma-star.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vp5Rd28Fxz9s7b for ; Wed, 22 Mar 2017 21:25:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jz4kSP/7"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=T1Ajceqazg6wbmh2YS03wvRF4h2V9IkMKF5gQUKxRuc=; b=jz4kSP/7U5FT7/ahAG3KWbis5S Zb2O5XJYw9XzJ1yoSn3IzRQ8REtUaZ2YXMoJ550rhXJDlxGDs+WsBg7uJS3nlhLN12tpa27qRgS3O Xsi/bI8L3wuWIoWZ3mXDYUzr+NIwpZO2Hf6hM1qWtbBLuGZUavvL4vdMCGHOeGEn0aHdguOWEGG0D mTZsHk4AXI/O+RHEJV9sssbVGqZTRFHuLAn6ORltdbhaVOoFkmwIUyIBbsOsQPXI6a0ynjoIKWRqs ubVv5casLVMFAk5vAK77JQoUaQcu8oj2EJaDSXlAEgHHnLOClL9zGl8MXP+U+0XobW25mZPJd0rpl 7iNr7McA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqdSL-0001SL-MC; Wed, 22 Mar 2017 10:25:29 +0000 Received: from mail.sigma-star.at ([95.130.255.111]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqdQm-0007BT-Ja for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 10:23:56 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sigma-star.at (Postfix) with ESMTP id 4565D24E0003; Wed, 22 Mar 2017 11:23:29 +0100 (CET) Received: from linux-4sv6.suse (unknown [82.150.214.13]) by mail.sigma-star.at (Postfix) with ESMTPSA id 9C57524E0001; Wed, 22 Mar 2017 11:23:28 +0100 (CET) From: David Oberhollenzer To: linux-mtd@lists.infradead.org Subject: [PATCH 1/5] Fix alignment trap triggered by NEON instructions Date: Wed, 22 Mar 2017 11:22:53 +0100 Message-Id: <20170322102257.7605-2-david.oberhollenzer@sigma-star.at> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170322102257.7605-1-david.oberhollenzer@sigma-star.at> References: <20170322102257.7605-1-david.oberhollenzer@sigma-star.at> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_032352_875389_5BA64F12 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yuanjie.Huang@windriver.com, raj.khem@gmail.com, David Oberhollenzer MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Yuanjie Huang 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 Signed-off-by: David Oberhollenzer --- ubifs-utils/mkfs.ubifs/key.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h index 39379fd..118858b 100644 --- a/ubifs-utils/mkfs.ubifs/key.h +++ b/ubifs-utils/mkfs.ubifs/key.h @@ -159,10 +159,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); } @@ -174,10 +176,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); } /**