From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i1481-0006EG-TN for barebox@lists.infradead.org; Fri, 23 Aug 2019 07:36:59 +0000 Date: Fri, 23 Aug 2019 09:36:56 +0200 From: Sascha Hauer Message-ID: <20190823073656.6l2qzionxlbhxac4@pengutronix.de> References: <20190822061941.6093-1-ahmad@a3f.at> <20190822061941.6093-6-ahmad@a3f.at> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190822061941.6093-6-ahmad@a3f.at> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 5/5] commands: fix unaligned accesses of aliased commands on amd64 To: Ahmad Fatoum Cc: barebox@lists.infradead.org, afa@pengutronix.de On Thu, Aug 22, 2019 at 08:19:41AM +0200, Ahmad Fatoum wrote: > If a command has aliases (e.g. edit and sedit), register_command > allocates a new struct command for the alias. As struct command has a > alignment of 64 specified on __x86_64__, this new allocation needs to > observe the alignment lest unaligned access could occur. I don't think > it's likely that GCC would generate SIMD code here that expects a 64 byte > alignment, but heed UBSan's advice and use xmemalign with the appropriate > alignment. > > Fixes: 8c14b97758 ("svn_rev_477") > Signed-off-by: Ahmad Fatoum > --- > I am not sure about this, because I don't understand why there was a 64 > bit alignment in the x86_64 linker script in the first place. > The fix is trivial though, so even if it's only a theoretical, lets have > it? Have you tried removing the alignment? AFAIK without it we are not able to iterate over the commands array generated by the linker. I don't know if this issue is still present. There is no requirement to align a struct command to 64bit otherwise. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox