From owner-freebsd-mips@FreeBSD.ORG Fri Sep 10 07:42:32 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7D2106566C; Fri, 10 Sep 2010 07:42:32 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9D88FC19; Fri, 10 Sep 2010 07:42:32 +0000 (UTC) Received: by gyg4 with SMTP id 4so1193443gyg.13 for ; Fri, 10 Sep 2010 00:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pNUFq8CKKxz9F+dVdQJmd+1siEpZfwY1NbEjaCRFSEM=; b=pLuuCqPxA+VngHHlUde3wIaUZns2VzQ2zjw1NVwrSi+S7cGkkNPDIuo3UulsuCvTaF 9O1xdqq8BtJyjo53fYm+t1VUm3Rz4XR2CSGP9S7UIdGdIIIfi3HcZ225R60Lc0P8qHUG 8peL9TBMUTdRORAygf/NQDDUWdoUvbNIYgQzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=r8Wi0ubjt8hBT1MgpEw4XMhlNm3VVSN+LoTD33Hhed30rP8d9Khl/9EQkhgP0K+zcw ij/XoS2yHKLqBS7IhnGoeDD3JkMAyZChk72rt2YFsjicEJI84y25USCUaz2TpA9V9mHG H1L3oYdmrowQpOpETa1Uw4x3m8ImCqI81bKeU= MIME-Version: 1.0 Received: by 10.151.138.13 with SMTP id q13mr391009ybn.189.1284104551312; Fri, 10 Sep 2010 00:42:31 -0700 (PDT) Received: by 10.150.136.10 with HTTP; Fri, 10 Sep 2010 00:42:31 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Sep 2010 13:12:31 +0530 Message-ID: From: "Jayachandran C." To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 07:42:32 -0000 On Fri, Sep 10, 2010 at 12:36 PM, Juli Mallett wrote= : > On Fri, Sep 10, 2010 at 00:00, Jayachandran C. = wrote: >> On Fri, Sep 10, 2010 at 11:22 AM, Neel Natu wrote: >>> This assumes that pmap_mapdev() always returns an uncached mapping >>> which is true for n64 kernels but not for o32 kernels with memory >>> beyond 512MB. >> >> I think my original patch was incorrect, pmap_mapdev() should not be >> used to map physical memory uncached. It may be just for mapping >> device address space uncached, and that may be why it checks if the >> physical address is cacheable. > > I think that's a wrong inference from the brokenness of pmap_mapdev > because of using the general-purpose pmap_kenter. =A0pmap_mapdev is > implicitly uncacheable -- check i386 pmap for confirmation. =A0Neel's > patch is right. Ok. My point was using pmap_mapdev() on physical memory to remap it uncached may not be its intended usage - and I did not notice this when I used it in busdma_machdep.c. But looks like it is the easiest way of doing this. My suggestion of using pmap_kenter_attr() in busdma_machdep.c would imply duplicating the whole pmap_mapdev code there, which is not good either. So as it stands, all I can say is that a comment in busdma_machdep.c on pmap_mapdev() use would be useful :) JC.