* [PATCH 1/2] ARC: uaccess: dont use "l" inline as constraint
@ 2017-12-08 19:12 Vineet Gupta
2017-12-08 19:12 ` [PATCH 2/2] ARC: provide for gcc "isolate path" induced generated abort calls Vineet Gupta
0 siblings, 1 reply; 2+ messages in thread
From: Vineet Gupta @ 2017-12-08 19:12 UTC (permalink / raw)
To: linux-snps-arc
This constraint has been removed from gcc
There was an earlier fix 3c7c7a2fc8811 which fixed this in delay.h but
somehow missed this one as gcc change had not made its way into
production toolchains
Cc: stable at vger.kernel.org
Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
---
arch/arc/include/asm/uaccess.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h
index f35974ee7264..c9173c02081c 100644
--- a/arch/arc/include/asm/uaccess.h
+++ b/arch/arc/include/asm/uaccess.h
@@ -668,6 +668,7 @@ __arc_strncpy_from_user(char *dst, const char __user *src, long count)
return 0;
__asm__ __volatile__(
+ " mov lp_count, %5 \n"
" lp 3f \n"
"1: ldb.ab %3, [%2, 1] \n"
" breq.d %3, 0, 3f \n"
@@ -684,8 +685,8 @@ __arc_strncpy_from_user(char *dst, const char __user *src, long count)
" .word 1b, 4b \n"
" .previous \n"
: "+r"(res), "+r"(dst), "+r"(src), "=r"(val)
- : "g"(-EFAULT), "l"(count)
- : "memory");
+ : "g"(-EFAULT), "r"(count)
+ : "lp_count", "lp_start", "lp_end", "memory");
return res;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] ARC: provide for gcc "isolate path" induced generated abort calls
2017-12-08 19:12 [PATCH 1/2] ARC: uaccess: dont use "l" inline as constraint Vineet Gupta
@ 2017-12-08 19:12 ` Vineet Gupta
0 siblings, 0 replies; 2+ messages in thread
From: Vineet Gupta @ 2017-12-08 19:12 UTC (permalink / raw)
To: linux-snps-arc
gcc toggle -fisolate-erroneous-paths-dereference (default at -O2
onwards) isolates faulty code paths such as null pointer access, divide
by zero etc. If gcc port doesnt implement __builtin_trap, an abort() is
generated which causes kernel link error hence this patch.
FWIW ARC gcc now has the builtin, but we need to handle this error for
older toolchains.
The code in question triggering gcc is in lib/mpi/mpih-div.o
Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
---
arch/arc/kernel/setup.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 9d27331fe69a..5e180090b17f 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -19,6 +19,7 @@
#include <linux/of_fdt.h>
#include <linux/of.h>
#include <linux/cache.h>
+#include <linux/reboot.h>
#include <asm/sections.h>
#include <asm/arcregs.h>
#include <asm/tlb.h>
@@ -637,3 +638,8 @@ static int __init topology_init(void)
}
subsys_initcall(topology_init);
+
+void __weak abort(void)
+{
+ machine_halt();
+}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-08 19:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-08 19:12 [PATCH 1/2] ARC: uaccess: dont use "l" inline as constraint Vineet Gupta
2017-12-08 19:12 ` [PATCH 2/2] ARC: provide for gcc "isolate path" induced generated abort calls Vineet Gupta
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).