From owner-freebsd-mips@FreeBSD.ORG Mon Jan 9 11:07:08 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 A7DAA1065677 for ; Mon, 9 Jan 2012 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8908FC1E for ; Mon, 9 Jan 2012 11:07:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q09B780c042238 for ; Mon, 9 Jan 2012 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q09B77uI042236 for freebsd-mips@FreeBSD.org; Mon, 9 Jan 2012 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 9 Jan 2012 11:07:07 GMT Message-Id: <201201091107.q09B77uI042236@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-mips@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-mips@FreeBSD.org 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: Mon, 09 Jan 2012 11:07:08 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/163670 mips [mips][arge] arge can't allocate ring buffer on multip 1 problem total. From owner-freebsd-mips@FreeBSD.ORG Tue Jan 10 21:32:01 2012 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F128106564A; Tue, 10 Jan 2012 21:32:01 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 09E6B8FC15; Tue, 10 Jan 2012 21:32:00 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.5/8.14.4) with ESMTP id q0ALW06v046258; Tue, 10 Jan 2012 16:32:00 -0500 (EST) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.5/8.14.4/Submit) id q0ALW0mZ046241; Tue, 10 Jan 2012 21:32:00 GMT (envelope-from tinderbox@freebsd.org) Date: Tue, 10 Jan 2012 21:32:00 GMT Message-Id: <201201102132.q0ALW0mZ046241@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:32:01 -0000 TB --- 2012-01-10 21:11:12 - tinderbox 2.8 running on freebsd-current.sentex.ca TB --- 2012-01-10 21:11:12 - starting HEAD tinderbox run for mips/mips TB --- 2012-01-10 21:11:12 - cleaning the object tree TB --- 2012-01-10 21:11:19 - cvsupping the source tree TB --- 2012-01-10 21:11:19 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/mips/mips/supfile TB --- 2012-01-10 21:11:32 - building world TB --- 2012-01-10 21:11:32 - CROSS_BUILD_TESTING=YES TB --- 2012-01-10 21:11:32 - MAKEOBJDIRPREFIX=/obj TB --- 2012-01-10 21:11:32 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2012-01-10 21:11:32 - SRCCONF=/dev/null TB --- 2012-01-10 21:11:32 - TARGET=mips TB --- 2012-01-10 21:11:32 - TARGET_ARCH=mips TB --- 2012-01-10 21:11:32 - TZ=UTC TB --- 2012-01-10 21:11:32 - __MAKE_CONF=/dev/null TB --- 2012-01-10 21:11:32 - cd /src TB --- 2012-01-10 21:11:32 - /usr/bin/make -B buildworld >>> World build started on Tue Jan 10 21:11:32 UTC 2012 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] cc -O -pipe -G0 -DLIBC_SCCS -DINET6 -I/src/lib/libutil -I/src/lib/libutil/../libc/gen/ -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/lib/libutil/login_class.c -o login_class.o cc -O -pipe -G0 -DLIBC_SCCS -DINET6 -I/src/lib/libutil -I/src/lib/libutil/../libc/gen/ -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/lib/libutil/login_crypt.c -o login_crypt.o cc -O -pipe -G0 -DLIBC_SCCS -DINET6 -I/src/lib/libutil -I/src/lib/libutil/../libc/gen/ -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/lib/libutil/login_ok.c -o login_ok.o cc -O -pipe -G0 -DLIBC_SCCS -DINET6 -I/src/lib/libutil -I/src/lib/libutil/../libc/gen/ -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/lib/libutil/login_times.c -o login_times.o cc -O -pipe -G0 -DLIBC_SCCS -DINET6 -I/src/lib/libutil -I/src/lib/libutil/../libc/gen/ -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/lib/libutil/login_tty.c -o login_tty.o cc -O -pipe -G0 -DLIBC_SCCS -DINET6 -I/src/lib/libutil -I/src/lib/libutil/../libc/gen/ -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/lib/libutil/pidfile.c -o pidfile.o cc1: warnings being treated as errors /src/lib/libutil/pidfile.c:272: warning: no previous prototype for 'pidfile_fileno' *** Error code 1 Stop in /src/lib/libutil. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2012-01-10 21:32:00 - WARNING: /usr/bin/make returned exit code 1 TB --- 2012-01-10 21:32:00 - ERROR: failed to build world TB --- 2012-01-10 21:32:00 - 878.45 user 251.62 system 1248.00 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full 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? 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? From owner-freebsd-mips@FreeBSD.ORG Thu Jan 12 08:13:19 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 D718A106566C; Thu, 12 Jan 2012 08:13:19 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 444B98FC0C; Thu, 12 Jan 2012 08:13:18 +0000 (UTC) Received: by werb13 with SMTP id b13so1851044wer.13 for ; Thu, 12 Jan 2012 00:13:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7RgJDNsCPttjOXPV11aDUQv6yQMsHvIIthd75nmULJQ=; b=AqypW9674v0zvfuw9CYmvPebBNdbMRoj+fsxaOBVryw0bXY41aCOagOMCx9WkqtwIM ow3DoI9KicQqgNSNNkVrW3YXDN6RIArlfs3upSih1wwJR0DPPG4awdDxWIJh+Vnzb4xG aoPEis/4/J8cQrHP8Y6fLh5k4ZL4C+flZnZzY= MIME-Version: 1.0 Received: by 10.180.105.129 with SMTP id gm1mr19086978wib.1.1326354648832; Wed, 11 Jan 2012 23:50:48 -0800 (PST) Received: by 10.216.54.15 with HTTP; Wed, 11 Jan 2012 23:50:48 -0800 (PST) In-Reply-To: <4F0E1965.6060808@freebsd.org> References: <4F0E1965.6060808@freebsd.org> Date: Thu, 12 Jan 2012 13:20:48 +0530 Message-ID: From: "Jayachandran C." To: Oleksandr Tymoshenko Content-Type: text/plain; charset=ISO-8859-1 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 08:13:19 -0000 On Thu, Jan 12, 2012 at 4:51 AM, Oleksandr Tymoshenko w= rote: > =A0 =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. > > 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? This is probably the right fix for both 32 and 64-bit mips. Using a KSEG0 address as argument for vm_map_find is not correct as the kernel map does not include that region for mips. This reminds me of another issue I had seen in kern/link_elf.c, the value of linker_kernel_file->address is also set to KERNBASE, but this really should be KERNLOADADDR (used in our conf files) for mips. JC. From owner-freebsd-mips@FreeBSD.ORG Thu Jan 12 08:47:45 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 54FB4106566B; Thu, 12 Jan 2012 08:47:45 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by mx1.freebsd.org (Postfix) with ESMTP id 191E38FC08; Thu, 12 Jan 2012 08:47:44 +0000 (UTC) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 832F3291FE5; Thu, 12 Jan 2012 02:30:43 -0600 (CST) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 72C2F297607; Thu, 12 Jan 2012 02:30:43 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id FZWvmp1eL6sH; Thu, 12 Jan 2012 02:30:43 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id EA138291FE5; Thu, 12 Jan 2012 02:30:42 -0600 (CST) Message-ID: <4F0E9A31.5070401@rice.edu> Date: Thu, 12 Jan 2012 02:30:41 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: "Jayachandran C." References: <4F0E1965.6060808@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Oleksandr Tymoshenko , "freebsd-mips@freebsd.org" 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 08:47:45 -0000 On 01/12/2012 01:50, Jayachandran C. wrote: > On Thu, Jan 12, 2012 at 4:51 AM, Oleksandr Tymoshenko wrote: >> 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? > This is probably the right fix for both 32 and 64-bit mips. Using a > KSEG0 address as argument for vm_map_find is not correct as the kernel > map does not include that region for mips. > > This reminds me of another issue I had seen in kern/link_elf.c, the > value of linker_kernel_file->address is also set to KERNBASE, but this > really should be KERNLOADADDR (used in our conf files) for mips. I was somewhat surprised to find that KERNBASE points to the direct map. What is the virtual address range for a running kernel's code and data segments? In other words, are the kernel code and data segments accessed through the direct map even after initialization? Alan From owner-freebsd-mips@FreeBSD.ORG Thu Jan 12 10:28:17 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 29D2F1065670; Thu, 12 Jan 2012 10:28:17 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id BC3F88FC13; Thu, 12 Jan 2012 10:28:16 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so2035654vcb.13 for ; Thu, 12 Jan 2012 02:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=3VBc07NL0wKaW+oKjUjbs9DejCmdh0XzzAOYVZTNpfw=; b=xEbbGyaH0EbcIbBbOF0PURMnXCqsW4CQEOqNyPhP48L0MPq7Pl3RQiDxAqwIhDts97 9v+cBRO/UlOH7AisP/nJwojGalczk5wfXSDb7nldXV3aO++5ZbBz67Zm55/dlH5uC/Rq yvE6a+o5ddtU6nUD50sq6Nqylbl8obpGN+R1w= MIME-Version: 1.0 Received: by 10.220.155.5 with SMTP id q5mr1770215vcw.4.1326364096095; Thu, 12 Jan 2012 02:28:16 -0800 (PST) Received: by 10.52.88.83 with HTTP; Thu, 12 Jan 2012 02:28:16 -0800 (PST) In-Reply-To: <4F0E9A31.5070401@rice.edu> References: <4F0E1965.6060808@freebsd.org> <4F0E9A31.5070401@rice.edu> Date: Thu, 12 Jan 2012 15:58:16 +0530 Message-ID: From: "Jayachandran C." To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Oleksandr Tymoshenko , "freebsd-mips@freebsd.org" 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 10:28:17 -0000 On Thu, Jan 12, 2012 at 2:00 PM, Alan Cox wrote: > On 01/12/2012 01:50, Jayachandran C. wrote: >> >> On Thu, Jan 12, 2012 at 4:51 AM, Oleksandr Tymoshenko >> =A0wrote: >>> >>> =A0 =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. >>> >>> 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? >> >> This is probably the right fix for both 32 and 64-bit mips. Using a >> KSEG0 address as argument for vm_map_find is not correct as the kernel >> map does not include that region for mips. >> >> This reminds me of another issue I had seen in kern/link_elf.c, the >> value of linker_kernel_file->address is also set to KERNBASE, but this >> really should be KERNLOADADDR (used in our conf files) for mips. > > I was somewhat surprised to find that KERNBASE points to the direct map. > =A0What is the virtual address range for a running kernel's code and data > segments? =A0In other words, are the kernel code and data segments access= ed > through the direct map even after initialization? Yes, this direct map (KSEG0 in 32bit and CKSEG0 in 64bit) maps the first 512MB physical memory and is outside the VM_MIN_KERNEL_ADDRESS - VM_MAX_KERNEL_ADDRESS range. KERNBASE points to the start of this direct map. In 64 bit, there are a few more direct maps (XKPHYS) which maps the whole physical memory (location depends on the caching needed). We use this when we need a direct mapped pointer (by MIPS_PHYS_TO_DIRECT) in 64 bit. This is also outside the kernel min and max vm. JC. From owner-freebsd-mips@FreeBSD.ORG Thu Jan 12 15:18:47 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 EDB59106564A; Thu, 12 Jan 2012 15:18:46 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh8.mail.rice.edu (mh8.mail.rice.edu [128.42.201.24]) by mx1.freebsd.org (Postfix) with ESMTP id B1A3C8FC0C; Thu, 12 Jan 2012 15:18:46 +0000 (UTC) Received: from mh8.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh8.mail.rice.edu (Postfix) with ESMTP id 5ECCA291D57; Thu, 12 Jan 2012 09:18:45 -0600 (CST) Received: from mh8.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh8.mail.rice.edu (Postfix) with ESMTP id 50246297624; Thu, 12 Jan 2012 09:18:45 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh8.mail.rice.edu, auth channel Received: from mh8.mail.rice.edu ([127.0.0.1]) by mh8.mail.rice.edu (mh8.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id vLSXkCL-2V0U; Thu, 12 Jan 2012 09:18:45 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh8.mail.rice.edu (Postfix) with ESMTPSA id BAE24291D25; Thu, 12 Jan 2012 09:18:44 -0600 (CST) Message-ID: <4F0EF9D3.5030907@rice.edu> Date: Thu, 12 Jan 2012 09:18:43 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Juli Mallett References: <4F0E1965.6060808@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Oleksandr Tymoshenko , "freebsd-mips@freebsd.org" 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 15:18:47 -0000 On 01/11/2012 17:57, Juli Mallett wrote: > On Wed, Jan 11, 2012 at 15:21, Oleksandr Tymoshenko wrote: >> 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. > 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? > On amd64, the direct map is also beneath the kernel map (or kernel virtual address space). The difference with respect to mips is that the kernel is not executed through the direct map. The kernel code and data segments are also mapped into the upper region of the kernel map, and the kernel is executed via this mapping. On both amd64 and mips, KERNBASE is roughly the starting virtual address of the kernel code segment. The essential difference is whether or not this address falls within the kernel map (between VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS). On 32-bit mips, KERNBASE winds up below the kernel map, and on 64-bit mips, it winds up above the kernel map. This explains why link_elf_obj.c works on 32-bit mips and fails on 64-bit mips. The value passed to vm_map_find() defines the starting point for finding a free virtual address within the kernel map. If that starting point is above the entire kernel map, then no satisfying address can be found. On amd64, link_elf_obj.c must specify KERNBASE rather than VM_MIN_KERNEL_ADDRESS to vm_map_find() because kernel loadable modules must be mapped for execution in the same upper region of the kernel map as the kernel code and data segments. In other words, specifying KERNBASE in link_elf_obj.c reflects (1) an architectural peculiarity of amd64 and (2) the fact that this code was previously only used by amd64. In the general case, which would include mips, any address within the kernel map can be used to map a kernel loadable module. amd64 is really the exception. So, it makes sense for link_elf_obj.c to use the same #ifdef as kmem_init() and pass VM_MIN_KERNEL_ADDRESS to vm_map_find() when we are not compiling for amd64. Alan From owner-freebsd-mips@FreeBSD.ORG Thu Jan 12 18:01:43 2012 Return-Path: Delivered-To: mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 534D5106564A; Thu, 12 Jan 2012 18:01:43 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id E300B8FC13; Thu, 12 Jan 2012 18:01:42 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 260AF2A28CD6; Thu, 12 Jan 2012 19:01:42 +0100 (CET) Date: Thu, 12 Jan 2012 19:01:42 +0100 From: Ed Schouten To: mips@FreeBSD.org, sparc64@FreeBSD.org Message-ID: <20120112180142.GI5300@hoeg.nl> References: <20111227231243.GB1895@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X9OP1fpbq0KufMFh" Content-Disposition: inline In-Reply-To: <20111227231243.GB1895@hoeg.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: [Last call] (Finally) migrate MIPS and SPARC64 to libcompiler_rt 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 18:01:43 -0000 --X9OP1fpbq0KufMFh Content-Type: multipart/mixed; boundary="MO4t1VgQTCtsHhID" Content-Disposition: inline --MO4t1VgQTCtsHhID Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Florian did some quite some testing for me and he can confirm that the patches make libcompiler_rt functional on SPARC64. As far as I know, the ctz/clz issue is also what prevented MIPS64 from working, so I am not aware of any issues that prevent us from switching to libcompiler_rt exclusively. If there are any objections against me committing the following patch, please speak up now! --=20 Ed Schouten WWW: http://80386.nl/ --MO4t1VgQTCtsHhID-- --X9OP1fpbq0KufMFh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPDyAFAAoJEG5e2P40kaK7XXYQAIqEPgv9JL2MARl8b9y9lIrM 0MsYMAjBM6TzNBEZbkSgS6A68VxHi2sdY/n8bwLP3/M5SNJaPCg+Deg5/g48olik I8E4M0aDs7lRicQytzkoGeWmZRaA9N5Qn19C7JbaHhPaPNHUcCo1IBYs2E274Kgg 9cSjwZisXizXve3pG90EUU0zomtWT9Lu6hRp0mXIdkH16RcqdyzT5/EAde8TF9Rq KO+JL3Zh3hHiZK+WvrnFy3+cC0C5ADYCbBqhc1jqmMsEwd0unlxf0+6fldC6tcX/ cdea9qgtmlCMdwlieVACW7hKHqqFcO3NU1pWN7k/eS7yTY9/eyUKCDxY7Nibdlii fw2uR1z87/Op9AUcUalTdlfcYEY+gDYwT1q0c+qU9+M7qZQkUFKU8kNvpsRFyb/l 2t+C4KP2gZVi31MqNxtG2w1M79T2mXwkf2dlox5Etq2PHD7Z1tsZ9v55tmAY4CPc ptsx86toTX5KFsy1oKyUfSdCUClWr4DFTE/DvxgCieJWKj1LM/jWZqgja7v435Hf dWU4PBXnJcXYDs1V+j2PSldFmApUf9MSileEVfzRHDYKQjJoMblP32VW+9nbMbu7 u6+I0yK25KVrOovjwPvWv8wvIJNnz5S2bbocpe3/lHxfEHdy6b3rACyrUHUaWK/V alRfOoZ1aYGOMwCpyGR9 =bvPy -----END PGP SIGNATURE----- --X9OP1fpbq0KufMFh-- From owner-freebsd-mips@FreeBSD.ORG Fri Jan 13 12:27:01 2012 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A2EB106566B; Fri, 13 Jan 2012 12:27:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 964758FC08; Fri, 13 Jan 2012 12:27:00 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 722F32A28CED; Fri, 13 Jan 2012 13:26:56 +0100 (CET) Date: Fri, 13 Jan 2012 13:26:56 +0100 From: Ed Schouten To: "Jayachandran C." Message-ID: <20120113122656.GN5300@hoeg.nl> References: <20111227231243.GB1895@hoeg.nl> <20120112180142.GI5300@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p+IlF8Xh9KY56wTg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: mips@freebsd.org, sparc64@freebsd.org Subject: Re: [Last call] (Finally) migrate MIPS and SPARC64 to libcompiler_rt 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, 13 Jan 2012 12:27:01 -0000 --p+IlF8Xh9KY56wTg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, * Jayachandran C. , 20120113 13:15: > Is this tested on MIPS with all the ABIs i.e. 32, n32 and 64? If it > is not, let me know... That's a bit of a problem. Florian tested it for me on SPARC64 and based on the bug reports I received at the time I _assume_ MIPS is fixed. If I remember correctly, MIPS32 already worked properly, but it was just MIPS64 that was broken. Still, it would be nice if someone could test it for me. Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --p+IlF8Xh9KY56wTg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPECMQAAoJEG5e2P40kaK794YP/1Lbk3hfRpVcbgVwgzE7XJx9 i3v3mkOQDx3gDoztgA90/BrhpZ4v3l9UVac5R1lcJd5gzQw76qIMC9gBfy/3roOI 2qd4ON5K4aDD4gtQNNYxYr2JQY2D3gMMOvU2gpJR9HXOWdb3neyZKnSSsn2C7B+Y bESVQnlaZNKSApbj2Fjp0maQVQ987LiD0SsYr7kBZAmVf48lvntEiEYZJ6Q2DoMJ LczdCiJLeU4ildo/svMcssUxZ8f627NmaMJLIr/bzDWpwLI0PkzQN90Y4eZR0Taw ILwv52oJOfhsqyncmRT4BAuDUq9jelNHk7JgOLf/IKgjataGvJyiuPUSOvOLNzSV 7zDstewowSA2G78dSENKfCpqEhDLj325uw3L513iOYzVKEdM7tv4Ix0ONr2YbUWv iHJ5xFueJFYWzXNdTBlRbNz6e+Zk1UoVeBUBgoP5EBolQ8oIi1idR7YeeCRTZLlC pGetzof0B4w+OL8n3mAxUKkCCP6BFtBlTr6CjcZ5OFcu2fgnbDbHGfM+379LG5lL f5hrmEzaSE6gPVZnA1B1Q2PnidZCPMV/2e9kszO+9YbfNZiRcgVXt899qiSyUpNn bPHNi96K3CTqc2TzMnfIvIkw3Wnd6cN+GdzvfP7mdjokjbbiyA0jaEj1Im2Pvbd/ zTEOdsSMqI/SdJb5jQrW =3aWu -----END PGP SIGNATURE----- --p+IlF8Xh9KY56wTg-- From owner-freebsd-mips@FreeBSD.ORG Fri Jan 13 12:44:00 2012 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7F8106564A; Fri, 13 Jan 2012 12:44:00 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0788FC16; Fri, 13 Jan 2012 12:43:59 +0000 (UTC) Received: by werm12 with SMTP id m12so514027wer.13 for ; Fri, 13 Jan 2012 04:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=yJ4NmqxeY4ifC80IDcykIUqudsNVQy+ZoTXy93bOQ8U=; b=K9yYJTXXrIZXWV16SoKhrdBPb8/T96bymP8ok9YJdcgJe8HNZjGj/8u9u2//kzV4FT Wa1L+1BRpJ1rrZ1qTFPy4QCqHCgfrm5fxYIMI9hHNNNwaBfUM8hVwSvm9uYAbv0OMOpw wYWEPw1aJwQibgJfo+yYOTL4tgHGQbFjN1ZZs= MIME-Version: 1.0 Received: by 10.216.137.97 with SMTP id x75mr2013860wei.57.1326456938142; Fri, 13 Jan 2012 04:15:38 -0800 (PST) Sender: c.jayachandran@gmail.com Received: by 10.216.54.15 with HTTP; Fri, 13 Jan 2012 04:15:38 -0800 (PST) In-Reply-To: <20120112180142.GI5300@hoeg.nl> References: <20111227231243.GB1895@hoeg.nl> <20120112180142.GI5300@hoeg.nl> Date: Fri, 13 Jan 2012 17:45:38 +0530 X-Google-Sender-Auth: OlRBeZv8QLt1tmMvIDD3NJU7dMg Message-ID: From: "Jayachandran C." To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Cc: mips@freebsd.org, sparc64@freebsd.org Subject: Re: [Last call] (Finally) migrate MIPS and SPARC64 to libcompiler_rt 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, 13 Jan 2012 12:44:00 -0000 On Thu, Jan 12, 2012 at 11:31 PM, Ed Schouten wrote: > Hi all, > > Florian did some quite some testing for me and he can confirm that the > patches make libcompiler_rt functional on SPARC64. As far as I know, the > ctz/clz issue is also what prevented MIPS64 from working, so I am not > aware of any issues that prevent us from switching to libcompiler_rt > exclusively. > > If there are any objections against me committing the following patch, > please speak up now! Is this tested on MIPS with all the ABIs i.e. 32, n32 and 64? If it is not, let me know... JC.