Subject: Re: AMD Geode GX reboot workaround
To: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
From: Allen Briggs <briggs@netbsd.org>
List: tech-kern
Date: 06/26/2007 16:21:37
On Tue, Jun 26, 2007 at 02:09:54PM -0600, Michael L. Hitch wrote:
>   I would think you want a region that starts on a page boundary and
> the size should be a multiple of the page size.

Hmmm...  The start is rounded and the end is truncated in
add_mem_cluster, but that only works if the segment is at
least a page in size.  In fact, the combination of < NBPG
and a non-page-boundary start is what can really nail us
here -- given seg_start 0x06fff800 and seg_end 0x06fffc00:

        seg_start = round_page(seg_start);	// 0x07000000
        seg_end = trunc_page(seg_end);		// 0x06fff000

        if (seg_start == seg_end)	// They're not ==
                return;

        mem_clusters[mem_cluster_cnt].start = seg_start;
        mem_clusters[mem_cluster_cnt].size =
            seg_end - seg_start;		// Ouch!

Perhaps it would be better to change that test to >= instead
of checking for at least NBPG size.

What are the ramifications of these small regions not being
entered in the iomem_ex extent?

-allen

-- 
Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com