mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* SDIV / UDIV  Question
@ 2013-10-09  7:08 Wang, Yalin
  2013-10-09 10:53 ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Yalin @ 2013-10-09  7:08 UTC (permalink / raw)
  To: 'Will Deacon'
  Cc: 'linux-arm-msm-owner@vger.kernel.org', linux-kernel

Hi  Will

I have a question about sdiv/ udiv  instructions :
In  armv7 A/R  TRM, it said sdiv/udiv will cause 
Divide by zero as undefined exception or just return zero
(decided by implementation) .

So  in kernel ,  should we need register a undef hook to 
Get this undef exception and send SIGFPE to user space
Process ?  


Thanks 




Yalin.Wang
Software Engineer 
OS Kernel&Graphics
 
Sony Mobile Communications
Tel: +86 10 5966 9819
Phone: 18610323092
Address: No.16 Guangshun South Street, Chaoyang, Beijing, P.R.C.

sonymobile.com
  
 



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

* Re: SDIV / UDIV  Question
  2013-10-09  7:08 SDIV / UDIV Question Wang, Yalin
@ 2013-10-09 10:53 ` Will Deacon
  2013-10-10  5:04   ` Wang, Yalin
  0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2013-10-09 10:53 UTC (permalink / raw)
  To: Wang, Yalin; +Cc: 'linux-arm-msm-owner@vger.kernel.org', linux-kernel

On Wed, Oct 09, 2013 at 08:08:05AM +0100, Wang, Yalin wrote:
> I have a question about sdiv/ udiv  instructions :
> In  armv7 A/R  TRM, it said sdiv/udiv will cause 
> Divide by zero as undefined exception or just return zero
> (decided by implementation) .
> 
> So  in kernel ,  should we need register a undef hook to 
> Get this undef exception and send SIGFPE to user space
> Process ?  

As far as I can see, this can only happen for R-class cores,
based on SCTLR.DZ.

Will

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

* RE: SDIV / UDIV  Question
  2013-10-09 10:53 ` Will Deacon
@ 2013-10-10  5:04   ` Wang, Yalin
  2013-10-10  9:21     ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Yalin @ 2013-10-10  5:04 UTC (permalink / raw)
  To: 'Will Deacon'
  Cc: 'linux-arm-msm-owner@vger.kernel.org', linux-kernel

Hi  Will ,


Oh ,  I see ,
Thanks for your clarification !
So R-class cores will not run linux ?
This means we don't  need  care about this .
Am I right ?

Thank you .

-----Original Message-----
From: Will Deacon [mailto:will.deacon@arm.com] 
Sent: Wednesday, October 09, 2013 6:54 PM
To: Wang, Yalin
Cc: 'linux-arm-msm-owner@vger.kernel.org'; linux-kernel@vger.kernel.org
Subject: Re: SDIV / UDIV Question

On Wed, Oct 09, 2013 at 08:08:05AM +0100, Wang, Yalin wrote:
> I have a question about sdiv/ udiv  instructions :
> In  armv7 A/R  TRM, it said sdiv/udiv will cause Divide by zero as 
> undefined exception or just return zero (decided by implementation) .
> 
> So  in kernel ,  should we need register a undef hook to Get this 
> undef exception and send SIGFPE to user space Process ?

As far as I can see, this can only happen for R-class cores, based on SCTLR.DZ.

Will

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

* Re: SDIV / UDIV  Question
  2013-10-10  5:04   ` Wang, Yalin
@ 2013-10-10  9:21     ` Will Deacon
  0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2013-10-10  9:21 UTC (permalink / raw)
  To: Wang, Yalin
  Cc: 'linux-arm-msm-owner@vger.kernel.org',
	linux-kernel, jonathan.austin

[Adding Jonny]

On Thu, Oct 10, 2013 at 06:04:41AM +0100, Wang, Yalin wrote:
> Oh ,  I see ,
> Thanks for your clarification !
> So R-class cores will not run linux ?

R-class cores can run Linux, but I don't reckon we touch SCTLR.DZ. I've
added Jonny, so he can clarify the behaviour here. (I'm also not sure which
cores have these instructions either).

Will

> -----Original Message-----
> From: Will Deacon [mailto:will.deacon@arm.com] 
> Sent: Wednesday, October 09, 2013 6:54 PM
> To: Wang, Yalin
> Cc: 'linux-arm-msm-owner@vger.kernel.org'; linux-kernel@vger.kernel.org
> Subject: Re: SDIV / UDIV Question
> 
> On Wed, Oct 09, 2013 at 08:08:05AM +0100, Wang, Yalin wrote:
> > I have a question about sdiv/ udiv  instructions :
> > In  armv7 A/R  TRM, it said sdiv/udiv will cause Divide by zero as 
> > undefined exception or just return zero (decided by implementation) .
> > 
> > So  in kernel ,  should we need register a undef hook to Get this 
> > undef exception and send SIGFPE to user space Process ?
> 
> As far as I can see, this can only happen for R-class cores, based on SCTLR.DZ.
> 
> Will
> 

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

end of thread, other threads:[~2013-10-10  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09  7:08 SDIV / UDIV Question Wang, Yalin
2013-10-09 10:53 ` Will Deacon
2013-10-10  5:04   ` Wang, Yalin
2013-10-10  9:21     ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®