linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/21] ARM: compressed/head.S: work around new binutils warning
Date: Tue, 23 Apr 2013 18:30:34 +0200	[thread overview]
Message-ID: <1366734653-488286-3-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1366734653-488286-1-git-send-email-arnd@arndb.de>

In August 2012, Matthew Gretton-Dann checked a change into binutils
labelled "Error on obsolete & warn on deprecated registers", apparently as
part of ARMv8 support. Apparently, this was supposed to emit the message
"Warning: This coprocessor register access is deprecated in ARMv8" when
using certain mcr/mrc instructions and building for ARMv8. Unfortunately,
the message that is actually emitted appears to be '(null)', which is
less helpful in comparison.

Even more unfortunately, this is biting us on every single kernel
build with a new gas, because arch/arm/boot/compressed/head.S and some
other files in that directory are built with -march=all since kernel
commit 80cec14a8 "[ARM] Add -march=all to assembly file build in
arch/arm/boot/compressed" back in v2.6.28.

This patch reverts Russell's nice solution and replaces it with a more
complex one that sprinkles .arch statements inside of the head.S file
in functions that are executed in different architecture levels, which
seems to solve the original problem just as well, and gets rid of the
new one, too.

Without this patch, building anything results in:

arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:565: Warning: (null)
arch/arm/boot/compressed/head.S:676: Warning: (null)
arch/arm/boot/compressed/head.S:698: Warning: (null)
arch/arm/boot/compressed/head.S:722: Warning: (null)
arch/arm/boot/compressed/head.S:726: Warning: (null)
arch/arm/boot/compressed/head.S:957: Warning: (null)
arch/arm/boot/compressed/head.S:996: Warning: (null)
arch/arm/boot/compressed/head.S:997: Warning: (null)
arch/arm/boot/compressed/head.S:1027: Warning: (null)
arch/arm/boot/compressed/head.S:1035: Warning: (null)
arch/arm/boot/compressed/head.S:1046: Warning: (null)
arch/arm/boot/compressed/head.S:1060: Warning: (null)
arch/arm/boot/compressed/head.S:1092: Warning: (null)
arch/arm/boot/compressed/head.S:1094: Warning: (null)
arch/arm/boot/compressed/head.S:1095: Warning: (null)
arch/arm/boot/compressed/head.S:1102: Warning: (null)
arch/arm/boot/compressed/head.S:1134: Warning: (null)

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/boot/compressed/Makefile |  2 +-
 arch/arm/boot/compressed/head.S   | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index afed28e..27f3604 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -121,7 +121,7 @@ KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
 endif
 
 ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
-asflags-y := -Wa,-march=all -DZIMAGE
+asflags-y := -DZIMAGE
 
 # Supply kernel BSS size to the decompressor via a linker symbol.
 KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index fe4d9c3..3b0b21a 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -548,6 +548,7 @@ cache_on:	mov	r3, #8			@ cache_on function
  * to cover all 32bit address and cacheable and bufferable.
  */
 __armv4_mpu_cache_on:
+		.arch armv4
 		mov	r0, #0x3f		@ 4G, the whole
 		mcr	p15, 0, r0, c6, c7, 0	@ PR7 Area Setting
 		mcr 	p15, 0, r0, c6, c7, 1
@@ -655,6 +656,7 @@ ENDPROC(__setup_mmu)
 @ Enable unaligned access on v6, to allow better code generation
 @ for the decompressor C code:
 __armv6_mmu_cache_on:
+		.arch armv6
 		mrc	p15, 0, r0, c1, c0, 0	@ read SCTLR
 		bic	r0, r0, #2		@ A (no unaligned access fault)
 		orr	r0, r0, #1 << 22	@ U (v6 unaligned access model)
@@ -663,11 +665,13 @@ __armv6_mmu_cache_on:
 
 __arm926ejs_mmu_cache_on:
 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+		.arch armv5
 		mov	r0, #4			@ put dcache in WT mode
 		mcr	p15, 7, r0, c15, c0, 0
 #endif
 
 __armv4_mmu_cache_on:
+		.arch armv4
 		mov	r12, lr
 #ifdef CONFIG_MMU
 		mov	r6, #CB_BITS | 0x12	@ U
@@ -688,6 +692,7 @@ __armv4_mmu_cache_on:
 		mov	pc, r12
 
 __armv7_mmu_cache_on:
+		.arch armv7-a
 		mov	r12, lr
 #ifdef CONFIG_MMU
 		mrc	p15, 0, r11, c0, c1, 4	@ read ID_MMFR0
@@ -1031,6 +1036,7 @@ cache_clean_flush:
 		mov	r3, #16
 		b	call_cache_fn
 
+		.arch armv4
 __armv4_mpu_cache_flush:
 		mov	r2, #1
 		mov	r3, #0
@@ -1056,6 +1062,7 @@ __fa526_cache_flush:
 		mov	pc, lr
 
 __armv6_mmu_cache_flush:
+		.arch armv6
 		mov	r1, #0
 		mcr	p15, 0, r1, c7, c14, 0	@ clean+invalidate D
 		mcr	p15, 0, r1, c7, c5, 0	@ invalidate I+BTB
@@ -1063,6 +1070,7 @@ __armv6_mmu_cache_flush:
 		mcr	p15, 0, r1, c7, c10, 4	@ drain WB
 		mov	pc, lr
 
+		.arch armv7-a
 __armv7_mmu_cache_flush:
 		mrc	p15, 0, r10, c0, c1, 5	@ read ID_MMFR1
 		tst	r10, #0xf << 16		@ hierarchical cache (ARMv7)
@@ -1123,6 +1131,7 @@ iflush:
 		mcr	p15, 0, r10, c7, c5, 4	@ ISB
 		mov	pc, lr
 
+		.arch armv5
 __armv5tej_mmu_cache_flush:
 1:		mrc	p15, 0, r15, c7, c14, 3	@ test,clean,invalidate D cache
 		bne	1b
@@ -1130,6 +1139,7 @@ __armv5tej_mmu_cache_flush:
 		mcr	p15, 0, r0, c7, c10, 4	@ drain WB
 		mov	pc, lr
 
+		.arch armv4
 __armv4_mmu_cache_flush:
 		mov	r2, #64*1024		@ default: 32K dcache size (*2)
 		mov	r11, #32		@ default: 32 byte line size
@@ -1168,6 +1178,8 @@ __armv3_mpu_cache_flush:
 		mcr	p15, 0, r1, c7, c0, 0	@ invalidate whole cache v3
 		mov	pc, lr
 
+		.arch armv4
+
 /*
  * Various debugging routines for printing hex characters and
  * memory, which again must be relocatable.
-- 
1.8.1.2

  parent reply	other threads:[~2013-04-23 16:30 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 16:30 [PATCH 00/21] ARM build fixes for 3.10 Arnd Bergmann
2013-04-23 16:30 ` [PATCH 01/21] Turn off -Wmaybe-uninitialized when building with -Os Arnd Bergmann
2013-04-23 16:30 ` Arnd Bergmann [this message]
2013-04-23 16:30 ` [PATCH 03/21] ARM: use optimized do_div only for EABI Arnd Bergmann
2013-04-23 16:30 ` [PATCH 04/21] ARM: kvm: define KVM_ARM_MAX_VCPUS unconditionally Arnd Bergmann
2013-04-23 17:29   ` Christoffer Dall
2013-04-23 17:32     ` Christoffer Dall
2013-04-23 16:30 ` [PATCH 05/21] ARM: OMAP2+: add dependencies on ARCH_MULTI_V6/V7 Arnd Bergmann
2013-04-23 18:01   ` Tony Lindgren
2013-04-23 19:31     ` Arnd Bergmann
2013-04-23 16:30 ` [PATCH 06/21] ARM: tegra: call cpu_do_idle from C code Arnd Bergmann
2013-04-24  2:55   ` Joseph Lo
2013-04-23 16:30 ` [PATCH 07/21] ARM: tegra: unify tegra_idle_device definitions Arnd Bergmann
2013-04-23 16:56   ` Daniel Lezcano
2013-04-23 18:57     ` Arnd Bergmann
2013-04-23 22:04       ` Daniel Lezcano
2013-04-24  2:56         ` Joseph Lo
2013-04-23 16:30 ` [PATCH 08/21] ASoC: ux500: forward declare msp_i2s_platform_data Arnd Bergmann
2013-04-23 18:25   ` Mark Brown
2013-04-23 16:30 ` [PATCH 09/21] spi/sirf: fix MODULE_DEVICE_TABLE Arnd Bergmann
2013-04-23 18:27   ` Mark Brown
2013-04-23 16:30 ` [PATCH 10/21] ssb: fix alignment of struct bcma_device_id Arnd Bergmann
2013-04-23 16:30 ` [PATCH 11/21] drm/tilcdc: use only a single module device table Arnd Bergmann
2013-04-25 17:39   ` Rob Clark
2013-04-23 16:30 ` [PATCH 12/21] mmc: sdhci-tegra: fix MODULE_DEVICE_TABLE Arnd Bergmann
2013-04-23 16:46   ` Chris Ball
2013-04-23 18:55     ` Arnd Bergmann
2013-04-23 19:07       ` Chris Ball
2013-04-23 16:30 ` [PATCH 13/21] misc: mark spear13xx-pcie-gadget as broken Arnd Bergmann
2013-04-24  3:20   ` Viresh Kumar
2013-04-23 16:30 ` [PATCH 14/21] staging: nvec: allow modular build Arnd Bergmann
2013-04-23 19:21   ` Marc Dietrich
2013-04-23 19:41     ` Arnd Bergmann
2013-04-23 19:55       ` Marc Dietrich
2013-04-23 20:05         ` Greg Kroah-Hartman
2013-04-23 20:14         ` Arnd Bergmann
2013-04-23 20:21           ` Marc Dietrich
2013-04-23 16:30 ` [PATCH 15/21] staging: comedi/dawboard2000: use mdelay for large delays Arnd Bergmann
2013-04-23 16:46   ` H Hartley Sweeten
2013-04-23 16:30 ` [PATCH 16/21] staging/zsmalloc: don't use pgtable-mapping from modules Arnd Bergmann
2013-04-23 16:30 ` [PATCH 17/21] tty/serial/sirf: fix MODULE_DEVICE_TABLE Arnd Bergmann
2013-04-23 16:30 ` [PATCH 18/21] usb: phy: tegra: don't call into tegra-ehci directly Arnd Bergmann
2013-04-23 16:42   ` Alan Stern
2013-04-23 19:02     ` Arnd Bergmann
2013-04-23 17:17   ` Greg Kroah-Hartman
2013-04-23 19:05     ` [PATCH v2] " Arnd Bergmann
2013-04-23 16:30 ` [PATCH 19/21] usb: phy: don't mark usb_bind_phy as __init Arnd Bergmann
2013-04-23 17:17   ` Greg Kroah-Hartman
2013-04-23 19:07     ` [PATCH v2] " Arnd Bergmann
2013-04-23 19:30       ` Felipe Balbi
2013-04-23 19:46         ` Arnd Bergmann
2013-04-23 16:30 ` [PATCH 20/21] MFD: ab8500: export ab8500_gpadc_sw_hw_convert properly Arnd Bergmann
2013-04-26  8:13   ` Linus Walleij
2013-04-26  9:23   ` Samuel Ortiz
2013-04-23 16:30 ` [PATCH 21/21] mtd: omap2: allow bulding as a module Arnd Bergmann
2013-04-23 18:03   ` Tony Lindgren
2013-04-24  5:34     ` Gupta, Pekon
2013-04-29 13:34       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366734653-488286-3-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).