Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 2008 14:27:37 -0700
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        Peter Grehan <grehan@freebsd.org>
Cc:        freebsd-ppc@freebsd.org
Subject:   Re: kernel stacks [eas: Re: G5 Bridge-mode MMU]
Message-ID:  <8D15A3AC-BEF7-46DF-9166-C1D44BFD32EE@mac.com>
In-Reply-To: <9F6F2C83-79F1-4463-B9FF-4BBEB55B95B2@mac.com>
References:  <4804AE13.2060600@uchicago.edu> <4804C9E9.6010303@freebsd.org> <5CC81F06-7B59-4163-9AB8-2ACE4235A5AA@mac.com> <4804DD02.10304@freebsd.org> <058EEFE3-09D7-447A-93AB-3E90EC59ECDC@mac.com> <48053E46.4090700@freebsd.org> <E42FE735-C13E-44F8-A333-7F103E332C7E@mac.com> <48054DE6.10508@freebsd.org> <9F6F2C83-79F1-4463-B9FF-4BBEB55B95B2@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Follow-up...

On Apr 15, 2008, at 10:54 PM, Marcel Moolenaar wrote:
>
> On Apr 15, 2008, at 5:52 PM, Peter Grehan wrote:
>> Hi Marcel,
>>
>>>> Are you sure it isn't a genuine stack overflow ?
>>> Positive. The panic happens after 4KB of stack has been used.
>>>> You may be able to tell by bumping the size of tmpstk on a non- 
>>>> kstack0 boot and see how far up it's been used.
>>> The backtrace also shows that. From inner-most to out-most  
>>> function in
>>> the backtrace the stack pointers are roughly 4KB apart.
>>
>> Can you send the code snippet that you're using to set up the  
>> stack ? I can desk-check that, and then use it for my testing so we  
>> have the exact same setup.

*snip*

>> usb0: USB revision 1.0
> [thread pid 0 tid 100000 ]
> Stopped at      0x3e9cc0:       stwux   r0, r1, r9,
> db> bt
> Tracing pid 0 tid 100000 td 0x4cb340
> 0xd00040f0: at usbd_transfer+0xb0

*snip*

Found the problem: moea_rkva_alloc().

The first 4 pages of KVA are reserved for page zeroing and other
special purpose uses. This was not accounted for in the original
moea_bootstrap() code when the kernel stack was allocated, so the
kernel stack overlapped with the pages returned by moea_rkva_alloc().

This is easily fixed...

-- 
Marcel Moolenaar
xcllnt@mac.com





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8D15A3AC-BEF7-46DF-9166-C1D44BFD32EE>