stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 3.16-stable 74/87] ARM: 8383/1: nommu: avoid deprecated source register on mov
Date: Fri,  5 May 2017 21:47:32 +0200	[thread overview]
Message-ID: <20170505194745.3627137-75-arnd@arndb.de> (raw)
In-Reply-To: <20170505194745.3627137-1-arnd@arndb.de>

From: Stefan Agner <stefan@agner.ch>

commit 970d96f9a81b0dd83ddd8bce0e5e1ba31881c5f5 upstream.

In Thumb2 mode, the stack register r13 is deprecated if the
destination register is the program counter (r15). Similar to
head.S, head-nommu.S uses r13 to store the return address used
after configuring the CPU's CP15 register. However, since we do
not enable a MMU, there will be no address switch and it is
possible to use branch with link instruction to call
__after_proc_init.

Avoid using r13 completely by using bl to call __after_proc_init
and get rid of __secondary_switched.

Beside removing unnecessary complexity, this also fixes a
compiler warning when compiling a !MMU kernel:
Warning: Use of r13 as a source register is deprecated when r15
is the destination register.

Tested-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/kernel/head-nommu.S | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 716249cc2ee1..db0c82f4a99b 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -77,13 +77,12 @@ ENTRY(stext)
 	orr	r6, r6, #(1 << MPU_RSR_EN)	@ Set region enabled bit
 	bl	__setup_mpu
 #endif
-	ldr	r13, =__mmap_switched		@ address to jump to after
-						@ initialising sctlr
 	adr	lr, BSYM(1f)			@ return (PIC) address
  ARM(	add	pc, r10, #PROCINFO_INITFUNC	)
  THUMB(	add	r12, r10, #PROCINFO_INITFUNC	)
  THUMB(	mov	pc, r12				)
- 1:	b	__after_proc_init
+1:	bl	__after_proc_init
+	b	__mmap_switched
 ENDPROC(stext)
 
 #ifdef CONFIG_SMP
@@ -106,8 +105,7 @@ ENTRY(secondary_startup)
 	movs	r10, r5				@ invalid processor?
 	beq	__error_p			@ yes, error 'p'
 
-	adr	r4, __secondary_data
-	ldmia	r4, {r7, r12}
+	ldr	r7, __secondary_data
 
 #ifdef CONFIG_ARM_MPU
 	/* Use MPU region info supplied by __cpu_up */
@@ -115,23 +113,19 @@ ENTRY(secondary_startup)
 	bl      __setup_mpu			@ Initialize the MPU
 #endif
 
-	adr	lr, BSYM(__after_proc_init)	@ return address
-	mov	r13, r12			@ __secondary_switched address
+	adr	lr, BSYM(1f)			@ return (PIC) address
  ARM(	add	pc, r10, #PROCINFO_INITFUNC	)
  THUMB(	add	r12, r10, #PROCINFO_INITFUNC	)
  THUMB(	mov	pc, r12				)
-ENDPROC(secondary_startup)
-
-ENTRY(__secondary_switched)
+1:	bl	__after_proc_init
 	ldr	sp, [r7, #8]			@ set up the stack pointer
 	mov	fp, #0
 	b	secondary_start_kernel
-ENDPROC(__secondary_switched)
+ENDPROC(secondary_startup)
 
 	.type	__secondary_data, %object
 __secondary_data:
 	.long	secondary_data
-	.long	__secondary_switched
 #endif /* CONFIG_SMP */
 
 /*
@@ -164,7 +158,11 @@ __after_proc_init:
 #endif
 	mcr	p15, 0, r0, c1, c0, 0		@ write control reg
 #endif /* CONFIG_CPU_CP15 */
+<<<<<<< HEAD
 	mov	pc, r13
+=======
+	ret	lr
+>>>>>>> 12ebe5ca67dc... ARM: 8383/1: nommu: avoid deprecated source register on mov
 ENDPROC(__after_proc_init)
 	.ltorg
 
-- 
2.9.0

  parent reply	other threads:[~2017-05-05 19:48 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 19:46 [PATCH 3.16-stable 00/87] build warnings and errors Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 01/87] mm/init: fix zone boundary creation Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 02/87] Disable "frame-address" warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 03/87] modpost: expand pattern matching to support substring matches Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 04/87] modpost: don't emit section mismatch warnings for compiler optimizations Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 05/87] module: fix types of device tables aliases Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 06/87] MODULE_DEVICE_TABLE: fix some callsites Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 07/87] mm/hugetlb: improve locking in dissolve_free_huge_pages() Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 08/87] cpumask_set_cpu_local_first => cpumask_local_spread, lament Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 09/87] gfs2: avoid uninitialized variable warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 10/87] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 11/87] iio: fix printk format string warning Arnd Bergmann
2017-11-06 16:55   ` Ben Hutchings
2017-05-05 19:46 ` [PATCH 3.16-stable 12/87] iio: adc: fix building on 64-bit Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 13/87] infiniband: mlx5: avoid a compile-time warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 14/87] power/reset: xgene-reset: Fix prototype of xgene_restart() Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 15/87] mfd: arizona: Rid data size incompatibility warn when building for 64bit Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 16/87] Input: joystick - use get_cycles on ARMv8 Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 17/87] dma: pl08x: Use correct specifier for size_t values Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 18/87] gpio: drop retval check enforcing from gpiochip_remove() Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 19/87] ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk() Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 20/87] ASoC: imx-audmux: Use uintptr_t for port numbers Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 21/87] ASoC: fsl_sai: Set SYNC bit of TCR2 to Asynchronous Mode Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 22/87] ASoC: adau1977: Fix truncation warning on 64 bit architectures Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 23/87] ALSA: oxygen: Fix logical-not-parentheses warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 24/87] ata: hpt366: fix constant cast warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 25/87] clk/efm32gg: fix dt init prototype Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 26/87] spi: rspi: Remove unused variable in rspi_rz_transfer_one() Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 27/87] spi/atmel: Fix pointer to int conversion warnings on 64 bit builds Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 28/87] spi/pl022: Explicitly truncate large bitmask Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 29/87] tty: nozomi: avoid a harmless gcc warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 30/87] tty/isicom: fix big-endian compile warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 31/87] i2o: hide unsafe ioctl on 64-bit Arnd Bergmann
2017-05-05 20:07   ` Patch "[PATCH 3.16-stable 31/87] i2o: hide unsafe ioctl on 64-bit" has been added to the 3.18-stable tree gregkh
2017-05-05 19:46 ` [PATCH 3.16-stable 32/87] dm bufio: hide bogus warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 33/87] scsi-tgt: fix type conversion warning Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 34/87] ips: remove pointless #warning Arnd Bergmann
2017-11-06 17:31   ` Ben Hutchings
2017-05-05 19:46 ` [PATCH 3.16-stable 35/87] scsi: advansys: remove #warning message Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 36/87] bfa: Fix indentation Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 37/87] fnic: assign FIP_ALL_FCF_MACS to fcoe_all_fcfs Arnd Bergmann
2017-11-06 17:41   ` Ben Hutchings
2017-05-05 19:46 ` [PATCH 3.16-stable 38/87] be2iscsi: Fix bogus WARN_ON length check Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 39/87] mvsas: fix misleading indentation Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 40/87] paride: fix the "verbose" module param Arnd Bergmann
2017-05-05 19:46 ` [PATCH 3.16-stable 41/87] aic94xx: Skip reading user settings if flash is not found Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 42/87] mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 43/87] mtd: maps: rbtx4939-flash: delete an unused variable in rbtx4939_flash_remove Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 44/87] xilinx: Fix compiler warning Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 45/87] i40e: Reduce stack in i40e_dbg_dump_desc Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 46/87] mlx5: avoid build warnings on 32-bit Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 47/87] mISDN: avoid arch specific __builtin_return_address call Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 48/87] cpmac: remove hopeless #warning Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 49/87] net: caif: fix misleading indentation Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 50/87] net: am2150: fix nmclan_cs.c shared interrupt handling Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 51/87] am2150: Update nmclan_cs.c to use update PCMCIA API Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 52/87] net: tulip: turn compile-time warning into dev_warn() Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 53/87] net: vxge: avoid unused function warnings Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 54/87] ethernet: amd: fix pci device ids Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 55/87] drivers/net/ethernet/dec/tulip/uli526x.c: fix misleading indentation in uli526x_timer Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 56/87] hostap: avoid uninitialized variable use in hfa384x_get_rid Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 57/87] iwlegacy: avoid warning about missing braces Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 58/87] brcmfmac: avoid gcc-5.1 warning Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 59/87] netfilter: Fix switch statement warnings with recent gcc Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 60/87] netfilter; Add some missing default cases to switch statements in nft_reject Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 61/87] drm/i915: cleanup some indenting Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 62/87] video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 63/87] staging: bcm: add 32-bit host dependency Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 64/87] staging: imx-drm: fix indentation warning Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 65/87] staging: vt6655: fix overly large stack usage Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 66/87] Staging: iio: adc: fix indent on break statement Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 67/87] Staging: lustre: missing curly braces in ll_setattr_raw() Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 68/87] staging: rtl8723au: core: rtw_wlan_util: fix misleading indentation Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 69/87] Staging: wlan-ng: fix sparse warning in prism2fw.c Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 70/87] staging: dgnc: Fix frame size is larger than 1024B Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 71/87] x86/xen: fix upper bound of pmd loop in xen_cleanhighmap() Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 72/87] x86/boot: Add CONFIG_PARAVIRT_SPINLOCKS quirk to arch/x86/boot/compressed/misc.h Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 73/87] ARM: cns3xxx: shut up frame size warning Arnd Bergmann
2017-05-05 19:47 ` Arnd Bergmann [this message]
2017-05-06  9:45   ` [PATCH 3.16-stable 74/87] ARM: 8383/1: nommu: avoid deprecated source register on mov Arnd Bergmann
2017-05-06 10:06     ` Russell King - ARM Linux
2017-05-08 19:53       ` Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 75/87] ARM: 8221/1: PJ4: allow building in Thumb-2 mode Arnd Bergmann
2017-05-06  7:42   ` Ard Biesheuvel
2017-05-08 19:47     ` Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 76/87] ARM: OMAP: Fix Kconfig warning for omap1 Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 77/87] ARM: 8160/1: drop warning about return_address not using unwind tables Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 78/87] ARM: 8296/1: cache-l2x0: clean up aurora cache handling Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 79/87] arm64: add missing data types in smp_load_acquire/smp_store_release Arnd Bergmann
2017-11-06 18:56   ` Ben Hutchings
2017-11-06 20:24     ` Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 80/87] MIPS: BMIPS: Fix ".previous without corresponding .section" warnings Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 81/87] MIPS: DEC: Avoid la pseudo-instruction in delay slots Arnd Bergmann
2017-11-06 19:05   ` Ben Hutchings
2017-05-05 19:47 ` [PATCH 3.16-stable 82/87] MIPS: ip27: Disable qlge driver in defconfig Arnd Bergmann
2017-11-06 19:08   ` Ben Hutchings
2017-05-05 19:47 ` [PATCH 3.16-stable 83/87] MIPS: ip22: Fix ip28 build for modern gcc Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 84/87] MIPS: MSP71xx: remove odd locking in PCI config space access code Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 85/87] MIPS: Fix the build on jz4740 after removing the custom gpio.h Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 86/87] MIPS: TXx9: Delete an unused variable in tx4927_pcibios_setup Arnd Bergmann
2017-05-05 19:47 ` [PATCH 3.16-stable 87/87] MIPS: elf2ecoff: Fix warning due to dead code Arnd Bergmann
2017-11-06 19:14 ` [PATCH 3.16-stable 00/87] build warnings and errors Ben Hutchings

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=20170505194745.3627137-75-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=ben@decadent.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=stable@vger.kernel.org \
    --cc=stefan@agner.ch \
    /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).