Re: CVS commit: src/sys

2009-11-03 Thread Andreas Wrede

After this commit compiling amd64 kernels fails with:

/u2/netbsd-current/src/sys/arch/x86/x86/patch.c:40:26: error:  
opt_spldebug.h: No such file or directory



On Nov 3, 2009, at 0:23 , David Young wrote:


Module Name:src
Committed By:   dyoung
Date:   Tue Nov  3 05:23:28 UTC 2009

Modified Files:
src/sys/arch/i386/conf: files.i386
src/sys/arch/i386/i386: spl.S
src/sys/arch/x86/x86: patch.c
src/sys/arch/xen/conf: files.xen
src/sys/kern: init_main.c kern_stub.c subr_prf.c
src/sys/sys: systm.h
Added Files:
src/sys/kern: subr_spldebug.c
src/sys/sys: spldebug.h

Log Message:
Add a kernel configuration flag, SPLDEBUG, that activates a per-CPU  
log
of transitions to IPL_HIGH from lower IPLs.  SPLDEBUG is only  
available

on i386 and Xen kernels, today.

'options SPLDEBUG' adds instrumentation to spllower() and splraise()  
as
well as routines to start/stop debugging and to record IPL  
transitions:

spldebug_start(), spldebug_stop(), spldebug_raise(), spldebug_lower().


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/i386/i386/spl.S
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/patch.c
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.407 -r1.408 src/sys/kern/init_main.c
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/kern_stub.c
cvs rdiff -u -r1.136 -r1.137 src/sys/kern/subr_prf.c
cvs rdiff -u -r0 -r1.1 src/sys/kern/subr_spldebug.c
cvs rdiff -u -r0 -r1.1 src/sys/sys/spldebug.h
cvs rdiff -u -r1.236 -r1.237 src/sys/sys/systm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




--
aew



Re: CVS commit: src

2009-11-03 Thread David Laight
On Tue, Nov 03, 2009 at 05:08:19AM +, David Young wrote:
 Module Name:  src
 Committed By: dyoung
 Date: Tue Nov  3 05:08:19 UTC 2009
 
 Modified Files:
   src/sys/arch/i386/i386: copy.S
 Added Files:
   src/share/man/man9/man9.i386: return_address.9
   src/sys/arch/i386/include: return.h
 
 Log Message:
 Add return_address(9) for reading the Nth return address from the call
 stack.

And how is that supposed to be implementable 

If the kernel is compiled without a stack frame register (%ebp)
then finding return addresses further back is ~impossible.

I wouldn't want to assume that the kernel is always compiled
using %ebp as a frame pointer - x86 has few enough registers that
freeing %ebp is probably a performance gain!

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src

2009-11-03 Thread Jason Thorpe

On Nov 2, 2009, at 9:08 PM, David Young wrote:

 Module Name:  src
 Committed By: dyoung
 Date: Tue Nov  3 05:08:19 UTC 2009
 
 Modified Files:
   src/sys/arch/i386/i386: copy.S
 Added Files:
   src/share/man/man9/man9.i386: return_address.9
   src/sys/arch/i386/include: return.h
 
 Log Message:
 Add return_address(9) for reading the Nth return address from the call
 stack.

What's the intended usage?  How is __builtin_return_address() not sufficient?

 
 
 To generate a diff of this commit:
 cvs rdiff -u -r0 -r1.1 src/share/man/man9/man9.i386/return_address.9
 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/i386/copy.S
 cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/include/return.h
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

-- thorpej



Re: CVS commit: src/sys

2009-11-03 Thread David Young
On Tue, Nov 03, 2009 at 08:02:52AM +0100, Christoph Egger wrote:
 David Young wrote:
  Module Name:src
  Committed By:   dyoung
  Date:   Tue Nov  3 05:23:28 UTC 2009
  
  Modified Files:
  src/sys/arch/i386/conf: files.i386
  src/sys/arch/i386/i386: spl.S
  src/sys/arch/x86/x86: patch.c
  src/sys/arch/xen/conf: files.xen
  src/sys/kern: init_main.c kern_stub.c subr_prf.c
  src/sys/sys: systm.h
  Added Files:
  src/sys/kern: subr_spldebug.c
  src/sys/sys: spldebug.h
  
  Log Message:
  Add a kernel configuration flag, SPLDEBUG, that activates a per-CPU log
  of transitions to IPL_HIGH from lower IPLs.  SPLDEBUG is only available
  on i386 and Xen kernels, today.
 
 Does this include i386 Xen kernels or amd64 Xen kernels or both?

Just i386.

amd64  amd64+Xen should be covered by SPLDEBUG, but I don't have an
amd64 box handy for testing.

Dave

-- 
David Young OJC Technologies
dyo...@ojctech.com  Urbana, IL * (217) 278-3933


Re: CVS commit: src/sys

2009-11-03 Thread Christoph Egger
David Young wrote:
 On Tue, Nov 03, 2009 at 08:02:52AM +0100, Christoph Egger wrote:
 David Young wrote:
 Module Name:src
 Committed By:   dyoung
 Date:   Tue Nov  3 05:23:28 UTC 2009

 Modified Files:
 src/sys/arch/i386/conf: files.i386
 src/sys/arch/i386/i386: spl.S
 src/sys/arch/x86/x86: patch.c
 src/sys/arch/xen/conf: files.xen
 src/sys/kern: init_main.c kern_stub.c subr_prf.c
 src/sys/sys: systm.h
 Added Files:
 src/sys/kern: subr_spldebug.c
 src/sys/sys: spldebug.h

 Log Message:
 Add a kernel configuration flag, SPLDEBUG, that activates a per-CPU log
 of transitions to IPL_HIGH from lower IPLs.  SPLDEBUG is only available
 on i386 and Xen kernels, today.
 Does this include i386 Xen kernels or amd64 Xen kernels or both?
 
 Just i386.
 
 amd64  amd64+Xen should be covered by SPLDEBUG, but I don't have an
 amd64 box handy for testing.

That implies nobody else has an amd64 machine ?

Christoph


re: CVS commit: src

2009-11-03 Thread matthew green

   
   On Nov 2, 2009, at 9:08 PM, David Young wrote:
   
Module Name:   src
Committed By:  dyoung
Date:  Tue Nov  3 05:08:19 UTC 2009

Modified Files:
   src/sys/arch/i386/i386: copy.S
Added Files:
   src/share/man/man9/man9.i386: return_address.9
   src/sys/arch/i386/include: return.h

Log Message:
Add return_address(9) for reading the Nth return address from the call
stack.
   
   What's the intended usage?  How is __builtin_return_address() not sufficient?


it's also not well defined for N  0 in most use-cases.


.mrg.


Re: CVS commit: src/sys

2009-11-03 Thread David Young
On Tue, Nov 03, 2009 at 09:47:15AM -0500, Andreas Wrede wrote:
 After this commit compiling amd64 kernels fails with:
 
 /u2/netbsd-current/src/sys/arch/x86/x86/patch.c:40:26: error:
 opt_spldebug.h: No such file or directory

Sorry about that!  Try x86/x86/patch.c r1.20.

Dave

-- 
David Young OJC Technologies
dyo...@ojctech.com  Urbana, IL * (217) 278-3933


Re: CVS commit: src

2009-11-03 Thread David Young
On Tue, Nov 03, 2009 at 12:12:17PM -0800, Jason Thorpe wrote:
 
 On Nov 2, 2009, at 9:08 PM, David Young wrote:
 
  Module Name:src
  Committed By:   dyoung
  Date:   Tue Nov  3 05:08:19 UTC 2009
  
  Modified Files:
  src/sys/arch/i386/i386: copy.S
  Added Files:
  src/share/man/man9/man9.i386: return_address.9
  src/sys/arch/i386/include: return.h
  
  Log Message:
  Add return_address(9) for reading the Nth return address from the call
  stack.
 
 What's the intended usage?  How is __builtin_return_address() not sufficient?

'options SPLDEBUG' uses it to log the call stack when splraise(IPL_HIGH)
is raised.

Now that we have it, I will probably use it all over. :-)

I used to use __builtin_return_address(n), but for n  0 it can probe
arbitrary addresses, leading to supervisor page faults.  It happens in
software interrupts, especially.

Dave

-- 
David Young OJC Technologies
dyo...@ojctech.com  Urbana, IL * (217) 278-3933