Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2009 23:53:45 -0500
From:      "James R. Van Artsdalen" <james-freebsd-current@jrv.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: FreeBSD doesn't handle SMAP: amd64 machdep.c typo & bug
Message-ID:  <4A936E59.5020804@jrv.org>
In-Reply-To: <4A933859.1080907@jrv.org>
References:  <4A933859.1080907@jrv.org>

next in thread | previous in thread | raw e-mail | index | archive | help
James R. Van Artsdalen wrote:
> This code seems to be suspect
> sys/amd64/amd64/machdep.c:
>
>                 for (i = 0; i <= physmap_idx; i += 2) {
>                         if (smap->base < physmap[i + 1]) {
>                 if (boothowto & RB_VERBOSE)
>                                     printf(
>         "Overlapping or non-monotonic memory region, ignoring second
> region\n");
>                                 continue;
>             }
>             }
>   

The first-order problem is a typo: that "continue" isn't doing
anything.  Fixing it (to make physmap non-descending) improves things.
Code elsewhere apparently assumes that the upper bound in the last
physmap entry is the maximum of all physmap upper bounds.

But there is still the incorrect assumption that smap is
non-descending.  Perhaps just sort() smap on the base address?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A936E59.5020804>