Subject: Re: kernel stack overflow detection
To: None <eeh@netbsd.org, yamt@mwd.biglobe.ne.jp>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 06/26/2002 17:14:16
| > | KSTACK_CHECK_MAGIC scans kernel stack on each context switch.
| > | so it affects performance too much.
| > |
| > | KSTACK_CHECK_DR0 uses a debug register exclusively, so
| > | people that want to use it for other purposes will not want to
| > | enable it.
| > 
| > Why are you changing MI code?  Can't it be done all in MD code?
|
| there're 2 things. (sorry for confusing)
|
| KSTACK_CHECK_MAGIC is (intended to be) MI.
| KSTACK_CHECK_DR0 is i386-specific.

So, does KSTACK_CHECK_MAGIC work without any MD changes?
If not, what MD changes are needed?

Why do you also need KSTACK_CHECK_DR0 if KSTACK_CHECK_MAGIC
should do the job in a MI manner?

Or, if you need MD code and it can all be done in MD code,
why is there a need for an MI version, which you have admitted
does have noticeable performance impact?  Do you expect anyone
to actually use the MI code?

From a very quick code perusal:

sparc already has kernel stack redzone code.
sparc64 already has kernel stack redzone code.
vax already has kernel stack redzone code.
hppa already has stack redzine code.

Do we really need a MI version?

Eduardo