Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1177068AbdDYJCd (ORCPT ); Tue, 25 Apr 2017 05:02:33 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:16562 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935350AbdDYJCW (ORCPT ); Tue, 25 Apr 2017 05:02:22 -0400 From: To: , , CC: , , , , Subject: [PATCH 1/1] ARM: compressed/head.S: fix __nop macro rept number for ARMv7M Date: Tue, 25 Apr 2017 11:01:33 +0200 Message-ID: <1493110893-21857-1-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-25_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1122 Lines: 36 From: Patrice Chotard In zImage, _magic_sig is located at offset 0x24. But for ARMv7M architecture which enable CPU_THUMBONLY and !EFI_STUB kernel flag, _magic_sig is located at offset 0x14 00000000 00 46 00 46 00 46 00 46 00 46 00 46 00 46 0f f2 |.F.F.F.F.F.F.F.ò| 00000010 15 0c 60 47 18 28 6f 01 00 00 00 00 28 5c 0e 00 |..`G.(o.....(\..| 00000020 01 02 03 04 0f 46 90 46 00 00 00 00 00 00 00 00 |.....F.F........| Reproduced with stm32_defconfig with XIP_KERNEL flag disabled. To restore correct _magic_sig offset at 0x24, we add 8 additional "mov r0, r0" instruction. Signed-off-by: Patrice Chotard --- arch/arm/boot/compressed/head.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 9150f97..5d9cda3 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -127,7 +127,8 @@ AR_CLASS( .arm ) start: .type start,#function - .rept 7 + ARM( .rept 7) + THUMB( .rept 15) __nop .endr ARM( mov r0, r0 ) -- 1.9.1