From owner-freebsd-current@FreeBSD.ORG Tue Aug 25 04:53:47 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06DE2106568B for ; Tue, 25 Aug 2009 04:53:47 +0000 (UTC) (envelope-from james-freebsd-current@jrv.org) Received: from mail.jrv.org (rrcs-24-73-246-106.sw.biz.rr.com [24.73.246.106]) by mx1.freebsd.org (Postfix) with ESMTP id C2BF18FC0C for ; Tue, 25 Aug 2009 04:53:46 +0000 (UTC) Received: from kremvax.housenet.jrv (kremvax.housenet.jrv [192.168.3.124]) by mail.jrv.org (8.14.3/8.14.3) with ESMTP id n7P4rj8D032779 for ; Mon, 24 Aug 2009 23:53:45 -0500 (CDT) (envelope-from james-freebsd-current@jrv.org) Authentication-Results: mail.jrv.org; domainkeys=pass (testing) header.from=james-freebsd-current@jrv.org DomainKey-Signature: a=rsa-sha1; s=enigma; d=jrv.org; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: references:in-reply-to:content-type:content-transfer-encoding; b=dbNn12YG3OqprI9ceZLw4Wf9BhxXKOIKupOt8de1ZmcKAeMUKWa/AMY6O7lQNx+RM LumJvCPYE1CZzvyfZUyJIjgKOy4OfEZteYGE3z2WH4KDZQ3e8BOj1jr0YzHYGUirJ7X My2r919MoHU1xwfFuVmWgShOVcka4ePQ37gTYAk= Message-ID: <4A936E59.5020804@jrv.org> Date: Mon, 24 Aug 2009 23:53:45 -0500 From: "James R. Van Artsdalen" User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: FreeBSD Current References: <4A933859.1080907@jrv.org> In-Reply-To: <4A933859.1080907@jrv.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: FreeBSD doesn't handle SMAP: amd64 machdep.c typo & bug X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 04:53:47 -0000 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?