From owner-freebsd-mips@FreeBSD.ORG Wed Jan 11 23:50:37 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 AC7371065672 for ; Wed, 11 Jan 2012 23:50:37 +0000 (UTC) (envelope-from gonzo@hq.bluezbox.com) Received: from hq.bluezbox.com (hq.bluezbox.com [70.38.37.145]) by mx1.freebsd.org (Postfix) with ESMTP id 4AEB38FC0C for ; Wed, 11 Jan 2012 23:50:37 +0000 (UTC) Received: from localhost ([127.0.0.1]) by hq.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.73 (FreeBSD)) (envelope-from ) id 1Rl7Td-000H2j-V9; Wed, 11 Jan 2012 15:21:06 -0800 Message-ID: <4F0E1965.6060808@freebsd.org> Date: Wed, 11 Jan 2012 15:21:09 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@hq.bluezbox.com X-Spam-Level: ---- X-Spam-Report: Spam detection software, running on the system "hq.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Modules 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. [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Cc: Alan Cox Subject: 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: Wed, 11 Jan 2012 23:50:37 -0000 Modules 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. Using VM_MIN_KERNEL_ADDRESS fixes this problem. So the question is - what should I do? Add #ifdef to link_elf_obj.c as in kmem_init in vm/vm_kern.c or change KERNBASE to VM_MIN_KERNEL_ADDRESS?