Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbdHaKi4 (ORCPT ); Thu, 31 Aug 2017 06:38:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54078 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbdHaKiy (ORCPT ); Thu, 31 Aug 2017 06:38:54 -0400 Subject: Re: [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte To: =?UTF-8?Q?Lothar_Wa=c3=9fmann?= Cc: Masahiro Yamada , Rob Herring , Arnd Bergmann , Marc Zyngier , Catalin Marinas , Will Deacon , Russell King , linux-kernel@vger.kernel.org, Olof Johansson , linux-arm-kernel@lists.infradead.org References: <1504173383-8367-1-git-send-email-yamada.masahiro@socionext.com> <20170831122328.2334a4de@karo-electronics.de> From: Robin Murphy Message-ID: Date: Thu, 31 Aug 2017 11:38:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170831122328.2334a4de@karo-electronics.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1862 Lines: 65 On 31/08/17 11:23, Lothar Waßmann wrote: > Hi, > > On Thu, 31 Aug 2017 18:56:23 +0900 Masahiro Yamada wrote: >> Aarch64 instructions must be word aligned. The current 16 byte >> alignment is more than enough. Relax it into 4 byte alignment. >> >> Signed-off-by: Masahiro Yamada >> --- >> >> I do not know why arm64 Linux requires 16 byte alignment. >> >> I dug git-history of arch/arm64/include/asm/linkage.h >> and the only commit I see is: >> >> commit aeed41a9371ee02257b608eb06a9058507a7d0f4 >> Author: Marc Zyngier >> Date: Fri Oct 19 17:33:27 2012 +0100 >> >> arm64: fix alignment padding in assembly code >> >> It just opt out of the asm-generic variant to remove 0x90. >> So, the amount of alignment might not be not optimized yet. >> >> Please correct me if I am missing something. >> >> >> arch/arm64/include/asm/linkage.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h >> index 636c1bc..1b26629 100644 >> --- a/arch/arm64/include/asm/linkage.h >> +++ b/arch/arm64/include/asm/linkage.h >> @@ -1,7 +1,7 @@ >> #ifndef __ASM_LINKAGE_H >> #define __ASM_LINKAGE_H >> >> -#define __ALIGN .align 4 >> -#define __ALIGN_STR ".align 4" >> +#define __ALIGN .align 2 >> +#define __ALIGN_STR ".align 2" >> >> #endif >> > My math tells me, that 2 is one half of 4 but 4 is one fourth of 16, so > this change doesn't line up with your commit message, or am I missing > something? 2^4 = 16 2^2 = 4 The ARM behaviour of the .align directive is a bit funky... Robin. > > > Lothar Waßmann > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >