From owner-freebsd-mips@FreeBSD.ORG Thu Jan 12 00:24:34 2012 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 2E832106566B for ; Thu, 12 Jan 2012 00:24:34 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id B8C9D8FC13 for ; Thu, 12 Jan 2012 00:24:33 +0000 (UTC) Received: by wgbdr11 with SMTP id dr11so1470800wgb.31 for ; Wed, 11 Jan 2012 16:24:32 -0800 (PST) Received: by 10.180.79.10 with SMTP id f10mr14514265wix.0.1326326252205; Wed, 11 Jan 2012 15:57:32 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.208.210 with HTTP; Wed, 11 Jan 2012 15:57:11 -0800 (PST) In-Reply-To: <4F0E1965.6060808@freebsd.org> References: <4F0E1965.6060808@freebsd.org> From: Juli Mallett Date: Wed, 11 Jan 2012 15:57:11 -0800 X-Google-Sender-Auth: 5w14_ZSxPErEC7vzTOP0-vI2k_A Message-ID: To: Oleksandr Tymoshenko Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-mips@freebsd.org" , Alan Cox Subject: Re: MIPS64 modules 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: Thu, 12 Jan 2012 00:24:34 -0000 On Wed, Jan 11, 2012 at 15:21, Oleksandr Tymoshenko wro= te: > =C2=A0 =C2=A0Modules on MIPS use the same interface as AMD64 modules: > sys/kern/link_elf_obj.c. It works for MIPS32 but there is a problem > with MIPS64. sys/kern/link_elf_obj.c calls vm_map_find that uses > KERNBASE as a map base. As I told - it works for mips32 because > KERNBASE for mips32 is located before actual virtual memory area > (KERNBASE points to directly-mapped KSEG0 segment). But for MIPS64 > it's not the case - KERNBASE points to the very end of address space > and vm_map_find fails. It seems like the problem here must be because on 32-bit MIPS the direct-mapped region is less than kernel virtual mapped address space, and either some macro we provide or the VM code makes a wrong assumption about that relationship, since in 64-bit addressing, the direct-mapped region is much, much higher, and so we're not looking up something in the direct map when we ought to be? Or some other conditional is wrong? Is that right?