Subject: Re: GCC3.3.1 switch coming soon.
To: Chuck Silvers <chuq@chuq.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 09/23/2003 22:48:51
>> okay...here's what (i think) is happening.
>> 
>> since the permissions of the stack changed (from rwx to rw- when we
>> got the w^x code), there's a greater possibility of things getting
>> merged with the stack (the merge code is eager to merge stuff that can
>> be merged), but with the way that stack faults (ie, attempts to write
>> to unmapped pages) are handled, attempting to write to something at
>> the "top" (ie, the lowest address) of the stack, not incurring page
>> faults in an orderly manner makes you die.
>
>what's the actual problem with the fault handler if stack vm_map entries
>are merged with non-stack ones?  it would seem better to just remove
>assumptions about vm_map layout from the fault-handler code, then
>merging stack and non-stack entries would be fine.  I'd rather not
>special-case this if it's not necessary.

actually, there are two things wrong here.

(1) i didn't mean to imply there was anything *wrong* with merging
stack entries with non-stack entries, but it seems cleaner to avoid it
if possible.  it's not much cost to manage either.  an extra flag
here, another simple check there...

(2) the fault handler isn't different for stack stuff, though admit
that i temporarily mixed up some fuzzy recollections of stuff in order
to make it seem so.  stack stuff is subject to the amap chunking code
on faults, which is what makes it break up.

so it's sort of back to square one for me for a moment...

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."