From patchwork Tue Apr 25 09:01:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 9697751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 067EC60224 for ; Tue, 25 Apr 2017 09:06:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFDB028418 for ; Tue, 25 Apr 2017 09:06:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4655284E5; Tue, 25 Apr 2017 09:06:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 81A2C28418 for ; Tue, 25 Apr 2017 09:06:01 +0000 (UTC) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=N7FAdLMDo+2wlf/zH76CDYJDUULC0moMjeEIi/YxcAo=; b=DA09/grG9MBGSf Iz4RdBW1azactt+uc1xpS1zR02i3FEt1uvunzmWrt2xZU58d+AikeqAUsFRfNm3zjiukjvhAK0sDO qz4h5HK3nM2uJXZQ3u9BomhKVg6xrdXa5I36W5M35swNyx+PJX0Y8s600CpvXIYteCI4oJMWHD6RY SI1bEsvmkYO0PfVT4nIRmXElIOJCH//POT+Vpxb5rEKxTztAYI6B1xlj2IrqTJit3FAglqacM4wVC PeBq+0K8rqQSnrQLPnBUd0lCNX364oPUw9+Vl3Ufwm8jWPhb3/yj0kt+OhmPR4H9Zw1PLHPtI+d03 SMGOC4LdA7La545UjJhw==; 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 1d2wQ2-0003te-Fl; Tue, 25 Apr 2017 09:05:58 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2wMT-0001kD-VT for linux-arm-kernel@lists.infradead.org; Tue, 25 Apr 2017 09:02:20 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by m0046037.ppops.net (8.16.0.11/8.16.0.11) with SMTP id v3P8xQh6020802; Tue, 25 Apr 2017 11:01:45 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-.pphosted.com with ESMTP id 29yvxr9k6g-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 25 Apr 2017 11:01:45 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7384D38; Tue, 25 Apr 2017 09:01:44 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 475BD119D; Tue, 25 Apr 2017 09:01:44 +0000 (GMT) Received: from localhost (10.75.127.45) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 25 Apr 2017 11:01:43 +0200 From: To: , , 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170425_020218_352502_7E1AB6A0 X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: christophe.priouzeau@st.com, christophe.kerello@st.com, vikas.manocha@st.com, patrick.delaunay@st.com, patrice.chotard@st.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 )