linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Paul Burton <paul.burton@imgtec.com>,
	"Maciej W. Rozycki" <macro@imgtec.com>,
	linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 3.18 26/38] MIPS: End asm function prologue macros with .insn
Date: Sun, 19 Nov 2017 15:29:42 +0100	[thread overview]
Message-ID: <20171119142923.179912441@linuxfoundation.org> (raw)
In-Reply-To: <20171119142921.807414664@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paul Burton <paul.burton@imgtec.com>


[ Upstream commit 08889582b8aa0bbc01a1e5a0033b9f98d2e11caa ]

When building a kernel targeting a microMIPS ISA, recent GNU linkers
will fail the link if they cannot determine that the target of a branch
or jump is microMIPS code, with errors such as the following:

    mips-img-linux-gnu-ld: arch/mips/built-in.o: .text+0x542c:
    Unsupported jump between ISA modes; consider recompiling with
    interlinking enabled.
    mips-img-linux-gnu-ld: final link failed: Bad value

or:

    ./arch/mips/include/asm/uaccess.h:1017: warning: JALX to a
    non-word-aligned address

Placing anything other than an instruction at the start of a function
written in assembly appears to trigger such errors. In order to prepare
for allowing us to follow function prologue macros with an EXPORT_SYMBOL
invocation, end the prologue macros (LEAD, NESTED & FEXPORT) with a
.insn directive. This ensures that the start of the function is marked
as code, which always makes sense for functions & safely prevents us
from hitting the link errors described above.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14508/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/mips/include/asm/asm.h |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/arch/mips/include/asm/asm.h
+++ b/arch/mips/include/asm/asm.h
@@ -54,7 +54,8 @@
 		.align	2;				\
 		.type	symbol, @function;		\
 		.ent	symbol, 0;			\
-symbol:		.frame	sp, 0, ra
+symbol:		.frame	sp, 0, ra;			\
+		.insn
 
 /*
  * NESTED - declare nested routine entry point
@@ -63,8 +64,9 @@ symbol:		.frame	sp, 0, ra
 		.globl	symbol;				\
 		.align	2;				\
 		.type	symbol, @function;		\
-		.ent	symbol, 0;			 \
-symbol:		.frame	sp, framesize, rpc
+		.ent	symbol, 0;			\
+symbol:		.frame	sp, framesize, rpc;		\
+		.insn
 
 /*
  * END - mark end of function
@@ -86,7 +88,7 @@ symbol:
 #define FEXPORT(symbol)					\
 		.globl	symbol;				\
 		.type	symbol, @function;		\
-symbol:
+symbol:		.insn
 
 /*
  * ABS - export absolute symbol

  parent reply	other threads:[~2017-11-19 14:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 14:29 [PATCH 3.18 00/38] 3.18.83-stable review Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 01/38] media: imon: Fix null-ptr-deref in imon_probe Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 02/38] media: dib0700: fix invalid dvb_detach argument Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 03/38] iscsi-target: Fix iscsi_np reset hung task during parallel delete Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 04/38] extcon: palmas: Check the parent instance to prevent the NULL Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 05/38] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 06/38] ARM: dts: Fix omap3 off mode pull defines Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 07/38] ata: ATA_BMDMA should depend on HAS_DMA Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 08/38] ata: SATA_HIGHBANK " Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 09/38] ata: SATA_MV " Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 10/38] drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 11/38] igb: reset the PHY before reading the PHY ID Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 12/38] igb: close/suspend race in netif_device_detach Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 13/38] igb: Fix hw_dbg logging in igb_update_flash_i210 Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 14/38] staging: rtl8188eu: fix incorrect ERROR tags from logs Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 15/38] scsi: lpfc: Add missing memory barrier Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 16/38] scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 17/38] scsi: lpfc: Correct host name in symbolic_name field Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 18/38] scsi: lpfc: Correct issue leading to oops during link reset Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 19/38] ALSA: vx: Dont try to update capture stream before running Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 20/38] ALSA: vx: Fix possible transfer overflow Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 22/38] backlight: adp5520: Fix error handling in adp5520_bl_probe() Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 23/38] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 24/38] ixgbe: fix AER error handling Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 25/38] ixgbe: handle close/suspend race with netif_device_detach/present Greg Kroah-Hartman
2017-11-19 14:29 ` Greg Kroah-Hartman [this message]
2017-11-19 14:29 ` [PATCH 3.18 27/38] MIPS: init: Ensure reserved memory regions are not added to bootmem Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 29/38] Revert "crypto: xts - Add ECB dependency" Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 30/38] Revert "uapi: fix linux/rds.h userspace compilation errors" Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 31/38] uapi: fix linux/rds.h userspace compilation error Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 32/38] uapi: fix linux/rds.h userspace compilation errors Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 33/38] USB: usbfs: compute urb->actual_length for isochronous Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 34/38] USB: Add delay-init quirk for Corsair K70 LUX keyboards Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 35/38] USB: serial: qcserial: add pid/vid for Sierra Wireless EM7355 fw update Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 36/38] USB: serial: garmin_gps: fix memory leak on failed URB submit Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 37/38] USB: serial: garmin_gps: fix I/O after failed probe and remove Greg Kroah-Hartman
2017-11-19 14:29 ` [PATCH 3.18 38/38] USB: serial: garmin_gps: fix memory leak on probe errors Greg Kroah-Hartman
2017-11-20 14:06 ` [PATCH 3.18 00/38] 3.18.83-stable review Guenter Roeck
2017-11-20 14:48   ` Greg Kroah-Hartman
2017-11-20 15:41     ` Guenter Roeck
2017-11-20 16:25     ` Guenter Roeck
2017-11-20 19:17       ` Greg Kroah-Hartman
2017-11-20 21:15 ` Shuah Khan

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=20171119142923.179912441@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@verizon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=stable@vger.kernel.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).