svn commit: r190105 - head/sys/sparc64/sparc64

Marius Strobl marius at alchemy.franken.de
Fri Mar 20 09:34:24 PDT 2009


On Fri, Mar 20, 2009 at 08:31:39AM -0700, Marcel Moolenaar wrote:
> 
> On Mar 20, 2009, at 6:36 AM, Marius Strobl wrote:
> 
> >>>Log:
> >>>There's no need to wrap kdb_enter() in #ifdef KDB as it's always
> >>>available.
> >>
> >>That's not quite how it works.
> >>
> >>option KDB is used to build the kernel with debugging features
> >>that could impact performance, security and/or functionality.
> >>In this case it's not so much a matter of whether kdb_enter()
> >>is defined or not, but rather whether the kernel should respect
> >>-d.
> >>
> >
> >That's generally true but the places where I removed
> >#ifdef KDB don't have an impact on security, performance
> >doesn't matter and -d still does nothing if there's no
> >debugger available (which in turn would require options
> >KDB, at least according to documentation). I'm not sure
> >what your're actually trying to say; following your
> >logic strictly would mean that subr_kdb.c shouldn't be
> >standard but only compiled in when options KDB is
> >present.
> 
> The functions in subr_kdb.c have been made standard (i.e
> non-optional) so that they can actually be used safely
> from modules without having to worry about whether the
> kernel has some option enabled. So, option KDB doesn't
> control their visibility.
> 
> A debugger is present when either DDB or GDB is defined.
> So, option KDB doesn't control that either.
> 
> Option KDB doesn't do much. For the most part it guards
> code that results in entry into the debugger.

Okay, I now see why you objected to r190105. My point
is that in this case the code in question doesn't
need such protection (just as a module not using KDB
wouldn't have) as there's no relevant impact on
functionality, performance or security here but
especially in r190106 removing it improves readability.
It's not my intention to unconditionally remove every
#ifdef KDB around references of parts of subr_kdb.c
as the commit messages might imply.

> For serial
> consoles it changes the behaviour of the driver when a
> serial break is detected. It also enabled the checking
> for the alternate break sequence. Both you may not want
> to do in production.
> 
> Granted there's no granularity. You want different
> options for different cases so that you can enable or
> disable code independently. That we never could do
> before KDB, and we never did afterwards...
> 

Marius



More information about the svn-src-all mailing list