All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] frv: fix build failure
@ 2017-11-21 22:10 Sudip Mukherjee
  2017-11-23 17:17   ` Alexey Brodkin
  2017-11-27 18:49 ` Geert Uytterhoeven
  0 siblings, 2 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-11-21 22:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Sudip Mukherjee

The frv defconfig build is failing with the error:
lib/mpi/mpih-div.o: In function `mpihelp_divrem':
mpih-div.c:(.text+0x30c): undefined reference to `abort'

The function 'abort' was never defined for the frv architecture.
Create 'abort' as is done in other arch like 'arm' and 'unicore32'.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---

The build log of next-20171121 is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/305076731

 arch/frv/kernel/traps.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index fb08ebe..70f4387 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -633,6 +633,15 @@ void show_backtrace(struct pt_regs *frame, unsigned long sp)
 
 } /* end show_backtrace() */
 
+void abort(void)
+{
+	BUG();
+
+	/* if that doesn't kill us, halt */
+	panic("Oops failed to kill thread");
+}
+EXPORT_SYMBOL(abort);
+
 /*****************************************************************************/
 /*
  * initialise traps
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-11-21 22:10 [PATCH] frv: fix build failure Sudip Mukherjee
@ 2017-11-23 17:17   ` Alexey Brodkin
  2017-11-27 18:49 ` Geert Uytterhoeven
  1 sibling, 0 replies; 18+ messages in thread
From: Alexey Brodkin @ 2017-11-23 17:17 UTC (permalink / raw)
  To: sudipm.mukherjee; +Cc: linux-kernel, Vineet Gupta, akpm, linux-snps-arc

Hi Sudip,

On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
> The frv defconfig build is failing with the error:
> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> mpih-div.c:(.text+0x30c): undefined reference to `abort'
> 
> The function 'abort' was never defined for the frv architecture.
> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
> 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---

I'm seeing the same issue building for ARC from today's Linus' tree.
Maybe it worth implementing abort() as a weak function for every arch/platform
that doesn't have it explicitly defined? Otherwise we'll end-up with
useless code duplication.

-Alexey

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] frv: fix build failure
@ 2017-11-23 17:17   ` Alexey Brodkin
  0 siblings, 0 replies; 18+ messages in thread
From: Alexey Brodkin @ 2017-11-23 17:17 UTC (permalink / raw)
  To: linux-snps-arc

Hi Sudip,

On Tue, 2017-11-21@22:10 +0000, Sudip Mukherjee wrote:
> The frv defconfig build is failing with the error:
> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> mpih-div.c:(.text+0x30c): undefined reference to `abort'
> 
> The function 'abort' was never defined for the frv architecture.
> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
> 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> ---

I'm seeing the same issue building for ARC from today's Linus' tree.
Maybe it worth implementing abort() as a weak function for every arch/platform
that doesn't have it explicitly defined? Otherwise we'll end-up with
useless code duplication.

-Alexey

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-11-23 17:17   ` Alexey Brodkin
@ 2017-11-23 23:01     ` Sudip Mukherjee
  -1 siblings, 0 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-11-23 23:01 UTC (permalink / raw)
  To: Alexey Brodkin; +Cc: linux-kernel, Vineet Gupta, akpm, linux-snps-arc

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

Hi Alexey,

On Thu, Nov 23, 2017 at 05:17:19PM +0000, Alexey Brodkin wrote:
> Hi Sudip,
> 
> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
> > The frv defconfig build is failing with the error:
> > lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> > mpih-div.c:(.text+0x30c): undefined reference to `abort'
> > 
> > The function 'abort' was never defined for the frv architecture.
> > Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
> > 
> > Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> > ---
> 
> I'm seeing the same issue building for ARC from today's Linus' tree.
> Maybe it worth implementing abort() as a weak function for every arch/platform
> that doesn't have it explicitly defined? Otherwise we'll end-up with
> useless code duplication.

Do you mean define it for every arch or define it in a common place so
that all arch can use it?

I did a quick try with the attached patch on two different arch, one of
them (m32r) has the 'abort' defined and the other (frv) was failing due
to lack of abort, and they both built without any warnings or errors.
But I am not sure if 'kernel/exit.c' is the right place for it.
Any suggestion?

--
Regards
Sudip

[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 242 bytes --]

diff --git a/kernel/exit.c b/kernel/exit.c
index af6c245..75ae35a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1759,3 +1759,7 @@ COMPAT_SYSCALL_DEFINE5(waitid,
 	return -EFAULT;
 }
 #endif
+
+__weak void abort(void) {
+       BUG();
+}

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] frv: fix build failure
@ 2017-11-23 23:01     ` Sudip Mukherjee
  0 siblings, 0 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-11-23 23:01 UTC (permalink / raw)
  To: linux-snps-arc

Hi Alexey,

On Thu, Nov 23, 2017@05:17:19PM +0000, Alexey Brodkin wrote:
> Hi Sudip,
> 
> On Tue, 2017-11-21@22:10 +0000, Sudip Mukherjee wrote:
> > The frv defconfig build is failing with the error:
> > lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> > mpih-div.c:(.text+0x30c): undefined reference to `abort'
> > 
> > The function 'abort' was never defined for the frv architecture.
> > Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
> > 
> > Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> > ---
> 
> I'm seeing the same issue building for ARC from today's Linus' tree.
> Maybe it worth implementing abort() as a weak function for every arch/platform
> that doesn't have it explicitly defined? Otherwise we'll end-up with
> useless code duplication.

Do you mean define it for every arch or define it in a common place so
that all arch can use it?

I did a quick try with the attached patch on two different arch, one of
them (m32r) has the 'abort' defined and the other (frv) was failing due
to lack of abort, and they both built without any warnings or errors.
But I am not sure if 'kernel/exit.c' is the right place for it.
Any suggestion?

--
Regards
Sudip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-diff
Size: 242 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20171123/53be03c2/attachment.bin>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-11-23 23:01     ` Sudip Mukherjee
@ 2017-11-24  5:02       ` Alexey Brodkin
  -1 siblings, 0 replies; 18+ messages in thread
From: Alexey Brodkin @ 2017-11-24  5:02 UTC (permalink / raw)
  To: sudipm.mukherjee; +Cc: linux-kernel, Vineet.Gupta1, akpm, linux-snps-arc

Hi Sudip,

On Thu, 2017-11-23 at 23:01 +0000, Sudip Mukherjee wrote:
> Hi Alexey,
> 
> On Thu, Nov 23, 2017 at 05:17:19PM +0000, Alexey Brodkin wrote:
> > 
> > Hi Sudip,
> > 
> > On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
> > > 
> > > The frv defconfig build is failing with the error:
> > > lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> > > mpih-div.c:(.text+0x30c): undefined reference to `abort'
> > > 
> > > The function 'abort' was never defined for the frv architecture.
> > > Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
> > > 
> > > Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> > > ---
> > 
> > I'm seeing the same issue building for ARC from today's Linus' tree.
> > Maybe it worth implementing abort() as a weak function for every arch/platform
> > that doesn't have it explicitly defined? Otherwise we'll end-up with
> > useless code duplication.
> 
> Do you mean define it for every arch or define it in a common place so
> that all arch can use it?

Essentially I'd prefer to have just 1 instance of this function.
In fact I'd even remove existing implementations in ARM, Unicore32 and M32R
and have a generic implementation as this function obviously has nothing arch-specific.

> I did a quick try with the attached patch on two different arch, one of
> them (m32r) has the 'abort' defined and the other (frv) was failing due
> to lack of abort, and they both built without any warnings or errors.

Well maybe add  call to panic() there as well as it is done for ARM, unicore32 and M32R?

> But I am not sure if 'kernel/exit.c' is the right place for it.
> Any suggestion?

I guess it should be indeed something in "kernel/" and maybe your existing choice
of "kernel/exit.c" is not bad. Just send a patch to LKML and you'll get much better
guidance on that I guess :)

Anyways thanks for looking at this one.

-Alexey

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] frv: fix build failure
@ 2017-11-24  5:02       ` Alexey Brodkin
  0 siblings, 0 replies; 18+ messages in thread
From: Alexey Brodkin @ 2017-11-24  5:02 UTC (permalink / raw)
  To: linux-snps-arc

Hi Sudip,

On Thu, 2017-11-23@23:01 +0000, Sudip Mukherjee wrote:
> Hi Alexey,
> 
> On Thu, Nov 23, 2017@05:17:19PM +0000, Alexey Brodkin wrote:
> > 
> > Hi Sudip,
> > 
> > On Tue, 2017-11-21@22:10 +0000, Sudip Mukherjee wrote:
> > > 
> > > The frv defconfig build is failing with the error:
> > > lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> > > mpih-div.c:(.text+0x30c): undefined reference to `abort'
> > > 
> > > The function 'abort' was never defined for the frv architecture.
> > > Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
> > > 
> > > Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> > > ---
> > 
> > I'm seeing the same issue building for ARC from today's Linus' tree.
> > Maybe it worth implementing abort() as a weak function for every arch/platform
> > that doesn't have it explicitly defined? Otherwise we'll end-up with
> > useless code duplication.
> 
> Do you mean define it for every arch or define it in a common place so
> that all arch can use it?

Essentially I'd prefer to have just 1 instance of this function.
In fact I'd even remove existing implementations in ARM, Unicore32 and M32R
and have a generic implementation as this function obviously has nothing arch-specific.

> I did a quick try with the attached patch on two different arch, one of
> them (m32r) has the 'abort' defined and the other (frv) was failing due
> to lack of abort, and they both built without any warnings or errors.

Well maybe add ?call to panic() there as well as it is done for ARM, unicore32?and M32R?

> But I am not sure if 'kernel/exit.c' is the right place for it.
> Any suggestion?

I guess it should be indeed something in "kernel/" and maybe your existing choice
of "kernel/exit.c" is not bad. Just send a patch to LKML and you'll get much better
guidance on that I guess :)

Anyways thanks for looking at this one.

-Alexey

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-11-23 17:17   ` Alexey Brodkin
  (?)
@ 2017-11-27 18:25     ` Vineet Gupta
  -1 siblings, 0 replies; 18+ messages in thread
From: Vineet Gupta @ 2017-11-27 18:25 UTC (permalink / raw)
  To: Alexey Brodkin, sudipm.mukherjee
  Cc: linux-kernel, Vineet Gupta, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

+CC linux-arch, Arnd

On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> Hi Sudip,
> 
> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
>> The frv defconfig build is failing with the error:
>> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
>> mpih-div.c:(.text+0x30c): undefined reference to `abort'
>>
>> The function 'abort' was never defined for the frv architecture.
>> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
>>
>> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
>> ---
> 
> I'm seeing the same issue building for ARC from today's Linus' tree.

With which compiler ? Claudiu implemented __builtin_trap recently so ARC builds 
should not get abort() but a trap 5 instruction instead.

> Maybe it worth implementing abort() as a weak function for every arch/platform
> that doesn't have it explicitly defined? Otherwise we'll end-up with
> useless code duplication.

I understand the case/need for adding a weak/common abort() as a quick fix for 
handling such cases, but perhaps we should not and instead fix the rootcause. In 
this specific case, Claudiu mentioned that gcc was generating abort due to 
something like this (flagging a possible divide by zero due to 
-fno-isolate-erroneous-paths-dereference.

a;

fn1() {
   switch (a)
   case 0:
   return 1 / a;
}

Sudeep can you confirm that removing this hacking FRV build to not have this 
toggle fixes the abort issue.

So the offending code needs to be fixed as in the end when that code path is taken 
system is hosed.

-Vineet

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
@ 2017-11-27 18:25     ` Vineet Gupta
  0 siblings, 0 replies; 18+ messages in thread
From: Vineet Gupta @ 2017-11-27 18:25 UTC (permalink / raw)
  To: Alexey Brodkin, sudipm.mukherjee
  Cc: linux-kernel, Vineet Gupta, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

+CC linux-arch, Arnd

On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> Hi Sudip,
> 
> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
>> The frv defconfig build is failing with the error:
>> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
>> mpih-div.c:(.text+0x30c): undefined reference to `abort'
>>
>> The function 'abort' was never defined for the frv architecture.
>> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
>>
>> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
>> ---
> 
> I'm seeing the same issue building for ARC from today's Linus' tree.

With which compiler ? Claudiu implemented __builtin_trap recently so ARC builds 
should not get abort() but a trap 5 instruction instead.

> Maybe it worth implementing abort() as a weak function for every arch/platform
> that doesn't have it explicitly defined? Otherwise we'll end-up with
> useless code duplication.

I understand the case/need for adding a weak/common abort() as a quick fix for 
handling such cases, but perhaps we should not and instead fix the rootcause. In 
this specific case, Claudiu mentioned that gcc was generating abort due to 
something like this (flagging a possible divide by zero due to 
-fno-isolate-erroneous-paths-dereference.

a;

fn1() {
   switch (a)
   case 0:
   return 1 / a;
}

Sudeep can you confirm that removing this hacking FRV build to not have this 
toggle fixes the abort issue.

So the offending code needs to be fixed as in the end when that code path is taken 
system is hosed.

-Vineet

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] frv: fix build failure
@ 2017-11-27 18:25     ` Vineet Gupta
  0 siblings, 0 replies; 18+ messages in thread
From: Vineet Gupta @ 2017-11-27 18:25 UTC (permalink / raw)
  To: linux-snps-arc

+CC linux-arch, Arnd

On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> Hi Sudip,
> 
> On Tue, 2017-11-21@22:10 +0000, Sudip Mukherjee wrote:
>> The frv defconfig build is failing with the error:
>> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
>> mpih-div.c:(.text+0x30c): undefined reference to `abort'
>>
>> The function 'abort' was never defined for the frv architecture.
>> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
>>
>> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
>> ---
> 
> I'm seeing the same issue building for ARC from today's Linus' tree.

With which compiler ? Claudiu implemented __builtin_trap recently so ARC builds 
should not get abort() but a trap 5 instruction instead.

> Maybe it worth implementing abort() as a weak function for every arch/platform
> that doesn't have it explicitly defined? Otherwise we'll end-up with
> useless code duplication.

I understand the case/need for adding a weak/common abort() as a quick fix for 
handling such cases, but perhaps we should not and instead fix the rootcause. In 
this specific case, Claudiu mentioned that gcc was generating abort due to 
something like this (flagging a possible divide by zero due to 
-fno-isolate-erroneous-paths-dereference.

a;

fn1() {
   switch (a)
   case 0:
   return 1 / a;
}

Sudeep can you confirm that removing this hacking FRV build to not have this 
toggle fixes the abort issue.

So the offending code needs to be fixed as in the end when that code path is taken 
system is hosed.

-Vineet

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-11-21 22:10 [PATCH] frv: fix build failure Sudip Mukherjee
  2017-11-23 17:17   ` Alexey Brodkin
@ 2017-11-27 18:49 ` Geert Uytterhoeven
  1 sibling, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2017-11-27 18:49 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Andrew Morton, linux-kernel

Hi Sudip,

On Tue, Nov 21, 2017 at 11:10 PM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> The frv defconfig build is failing with the error:
> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
> mpih-div.c:(.text+0x30c): undefined reference to `abort'
>
> The function 'abort' was never defined for the frv architecture.
> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.

Which code needs abort()? When was this build failure introduced?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-11-27 18:25     ` Vineet Gupta
  (?)
  (?)
@ 2017-12-03 22:32       ` Sudip Mukherjee
  -1 siblings, 0 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw)
  To: Geert Uytterhoeven, Vineet Gupta
  Cc: Alexey Brodkin, linux-kernel, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
> +CC linux-arch, Arnd
> 
> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> >Hi Sudip,
> >
> >On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:

<snip>

> I understand the case/need for adding a weak/common abort() as a
> quick fix for handling such cases, but perhaps we should not and
> instead fix the rootcause. In this specific case, Claudiu mentioned
> that gcc was generating abort due to something like this (flagging a
> possible divide by zero due to
> -fno-isolate-erroneous-paths-dereference.
> 
> a;
> 
> fn1() {
>   switch (a)
>   case 0:
>   return 1 / a;
> }
> 
> Sudeep can you confirm that removing this hacking FRV build to not
> have this toggle fixes the abort issue.
> 
> So the offending code needs to be fixed as in the end when that code
> path is taken system is hosed.

The above case that you mentioned is indeed the case here.
mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.

So, what should be the actual fix here?

--
Regards
Sudip

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
@ 2017-12-03 22:32       ` Sudip Mukherjee
  0 siblings, 0 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw)
  To: Geert Uytterhoeven, Vineet Gupta
  Cc: Alexey Brodkin, linux-kernel, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
> +CC linux-arch, Arnd
> 
> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> >Hi Sudip,
> >
> >On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:

<snip>

> I understand the case/need for adding a weak/common abort() as a
> quick fix for handling such cases, but perhaps we should not and
> instead fix the rootcause. In this specific case, Claudiu mentioned
> that gcc was generating abort due to something like this (flagging a
> possible divide by zero due to
> -fno-isolate-erroneous-paths-dereference.
> 
> a;
> 
> fn1() {
>   switch (a)
>   case 0:
>   return 1 / a;
> }
> 
> Sudeep can you confirm that removing this hacking FRV build to not
> have this toggle fixes the abort issue.
> 
> So the offending code needs to be fixed as in the end when that code
> path is taken system is hosed.

The above case that you mentioned is indeed the case here.
mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.

So, what should be the actual fix here?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
@ 2017-12-03 22:32       ` Sudip Mukherjee
  0 siblings, 0 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw)
  To: Geert Uytterhoeven, Vineet Gupta
  Cc: Alexey Brodkin, linux-kernel, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
> +CC linux-arch, Arnd
> 
> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> >Hi Sudip,
> >
> >On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:

<snip>

> I understand the case/need for adding a weak/common abort() as a
> quick fix for handling such cases, but perhaps we should not and
> instead fix the rootcause. In this specific case, Claudiu mentioned
> that gcc was generating abort due to something like this (flagging a
> possible divide by zero due to
> -fno-isolate-erroneous-paths-dereference.
> 
> a;
> 
> fn1() {
>   switch (a)
>   case 0:
>   return 1 / a;
> }
> 
> Sudeep can you confirm that removing this hacking FRV build to not
> have this toggle fixes the abort issue.
> 
> So the offending code needs to be fixed as in the end when that code
> path is taken system is hosed.

The above case that you mentioned is indeed the case here.
mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.

So, what should be the actual fix here?

--
Regards
Sudip

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] frv: fix build failure
@ 2017-12-03 22:32       ` Sudip Mukherjee
  0 siblings, 0 replies; 18+ messages in thread
From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw)
  To: linux-snps-arc

On Mon, Nov 27, 2017@10:25:16AM -0800, Vineet Gupta wrote:
> +CC linux-arch, Arnd
> 
> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> >Hi Sudip,
> >
> >On Tue, 2017-11-21@22:10 +0000, Sudip Mukherjee wrote:

<snip>

> I understand the case/need for adding a weak/common abort() as a
> quick fix for handling such cases, but perhaps we should not and
> instead fix the rootcause. In this specific case, Claudiu mentioned
> that gcc was generating abort due to something like this (flagging a
> possible divide by zero due to
> -fno-isolate-erroneous-paths-dereference.
> 
> a;
> 
> fn1() {
>   switch (a)
>   case 0:
>   return 1 / a;
> }
> 
> Sudeep can you confirm that removing this hacking FRV build to not
> have this toggle fixes the abort issue.
> 
> So the offending code needs to be fixed as in the end when that code
> path is taken system is hosed.

The above case that you mentioned is indeed the case here.
mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.

So, what should be the actual fix here?

--
Regards
Sudip

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
  2017-12-03 22:32       ` Sudip Mukherjee
  (?)
@ 2017-12-06 22:00         ` Vineet Gupta
  -1 siblings, 0 replies; 18+ messages in thread
From: Vineet Gupta @ 2017-12-06 22:00 UTC (permalink / raw)
  To: Sudip Mukherjee, Geert Uytterhoeven, Vineet Gupta
  Cc: Alexey Brodkin, linux-kernel, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

On 12/03/2017 02:32 PM, Sudip Mukherjee wrote:
> On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
>> +CC linux-arch, Arnd
>>
>> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
>>> Hi Sudip,
>>>
>>> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
> 
> <snip>
> 
>> I understand the case/need for adding a weak/common abort() as a
>> quick fix for handling such cases, but perhaps we should not and
>> instead fix the rootcause. In this specific case, Claudiu mentioned
>> that gcc was generating abort due to something like this (flagging a
>> possible divide by zero due to
>> -fno-isolate-erroneous-paths-dereference.
>>
>> a;
>>
>> fn1() {
>>    switch (a)
>>    case 0:
>>    return 1 / a;
>> }
>>
>> Sudeep can you confirm that removing this hacking FRV build to not
>> have this toggle fixes the abort issue.
>>
>> So the offending code needs to be fixed as in the end when that code
>> path is taken system is hosed.
> 
> The above case that you mentioned is indeed the case here.
> mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.
> 
> So, what should be the actual fix here?

To remove the divide by zero.

Or atleast have a __weak abort() defined in common code so all arches benefit from 
it !

-Vineet

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] frv: fix build failure
@ 2017-12-06 22:00         ` Vineet Gupta
  0 siblings, 0 replies; 18+ messages in thread
From: Vineet Gupta @ 2017-12-06 22:00 UTC (permalink / raw)
  To: Sudip Mukherjee, Geert Uytterhoeven, Vineet Gupta
  Cc: Alexey Brodkin, linux-kernel, akpm, linux-snps-arc, linux-arch,
	Arnd Bergmann

On 12/03/2017 02:32 PM, Sudip Mukherjee wrote:
> On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
>> +CC linux-arch, Arnd
>>
>> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
>>> Hi Sudip,
>>>
>>> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
> 
> <snip>
> 
>> I understand the case/need for adding a weak/common abort() as a
>> quick fix for handling such cases, but perhaps we should not and
>> instead fix the rootcause. In this specific case, Claudiu mentioned
>> that gcc was generating abort due to something like this (flagging a
>> possible divide by zero due to
>> -fno-isolate-erroneous-paths-dereference.
>>
>> a;
>>
>> fn1() {
>>    switch (a)
>>    case 0:
>>    return 1 / a;
>> }
>>
>> Sudeep can you confirm that removing this hacking FRV build to not
>> have this toggle fixes the abort issue.
>>
>> So the offending code needs to be fixed as in the end when that code
>> path is taken system is hosed.
> 
> The above case that you mentioned is indeed the case here.
> mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.
> 
> So, what should be the actual fix here?

To remove the divide by zero.

Or atleast have a __weak abort() defined in common code so all arches benefit from 
it !

-Vineet

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] frv: fix build failure
@ 2017-12-06 22:00         ` Vineet Gupta
  0 siblings, 0 replies; 18+ messages in thread
From: Vineet Gupta @ 2017-12-06 22:00 UTC (permalink / raw)
  To: linux-snps-arc

On 12/03/2017 02:32 PM, Sudip Mukherjee wrote:
> On Mon, Nov 27, 2017@10:25:16AM -0800, Vineet Gupta wrote:
>> +CC linux-arch, Arnd
>>
>> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
>>> Hi Sudip,
>>>
>>> On Tue, 2017-11-21@22:10 +0000, Sudip Mukherjee wrote:
> 
> <snip>
> 
>> I understand the case/need for adding a weak/common abort() as a
>> quick fix for handling such cases, but perhaps we should not and
>> instead fix the rootcause. In this specific case, Claudiu mentioned
>> that gcc was generating abort due to something like this (flagging a
>> possible divide by zero due to
>> -fno-isolate-erroneous-paths-dereference.
>>
>> a;
>>
>> fn1() {
>>    switch (a)
>>    case 0:
>>    return 1 / a;
>> }
>>
>> Sudeep can you confirm that removing this hacking FRV build to not
>> have this toggle fixes the abort issue.
>>
>> So the offending code needs to be fixed as in the end when that code
>> path is taken system is hosed.
> 
> The above case that you mentioned is indeed the case here.
> mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.
> 
> So, what should be the actual fix here?

To remove the divide by zero.

Or atleast have a __weak abort() defined in common code so all arches benefit from 
it !

-Vineet

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-12-06 22:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-21 22:10 [PATCH] frv: fix build failure Sudip Mukherjee
2017-11-23 17:17 ` Alexey Brodkin
2017-11-23 17:17   ` Alexey Brodkin
2017-11-23 23:01   ` Sudip Mukherjee
2017-11-23 23:01     ` Sudip Mukherjee
2017-11-24  5:02     ` Alexey Brodkin
2017-11-24  5:02       ` Alexey Brodkin
2017-11-27 18:25   ` Vineet Gupta
2017-11-27 18:25     ` Vineet Gupta
2017-11-27 18:25     ` Vineet Gupta
2017-12-03 22:32     ` Sudip Mukherjee
2017-12-03 22:32       ` Sudip Mukherjee
2017-12-03 22:32       ` Sudip Mukherjee
2017-12-03 22:32       ` Sudip Mukherjee
2017-12-06 22:00       ` Vineet Gupta
2017-12-06 22:00         ` Vineet Gupta
2017-12-06 22:00         ` Vineet Gupta
2017-11-27 18:49 ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.