From owner-freebsd-mips@FreeBSD.ORG Wed Aug 3 01:29:31 2011 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 14582106566B for ; Wed, 3 Aug 2011 01:29:31 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id C12758FC0A for ; Wed, 3 Aug 2011 01:29:30 +0000 (UTC) Received: by yic13 with SMTP id 13so271975yic.13 for ; Tue, 02 Aug 2011 18:29:30 -0700 (PDT) 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 :content-transfer-encoding; bh=nYHSFqyMAvbl6VNL4HG66rr8llVY1sGXfZcxVOJn4wA=; b=S6ati2rkydaopW0QYZ6i1hkvDRez26rnsg0JSVsZ4TnGkvZrofNof2oUxtssTKiIWO LCV/OJnfLT75mHuZIXVgYMPuLy4QT16Z92Snr7K4uouHPvfn+L2+axRXMVer0jhVupI4 Fa8YiOBa+zXUHETlxqpRycYHhbqv+bVpCcZC4= MIME-Version: 1.0 Received: by 10.42.161.1 with SMTP id r1mr3119998icx.448.1312334969939; Tue, 02 Aug 2011 18:29:29 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.42.218.8 with HTTP; Tue, 2 Aug 2011 18:29:29 -0700 (PDT) In-Reply-To: References: <4D1A1B83.5070602@bsdimp.com> <4D1A5142.5090205@bsdimp.com> Date: Wed, 3 Aug 2011 03:29:29 +0200 X-Google-Sender-Auth: vVXq6m5zgv29gKANtdi1ZNh5EC0 Message-ID: From: Robert Millan To: "Jayachandran C." Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Retrieval of TLS pointer via RDHWR 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, 03 Aug 2011 01:29:31 -0000 2011/1/10 Jayachandran C. : > |+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0trapframe->pc +=3D sizeof(int); > > This will mis-behave if the rdhwr is in a branch delay slot. You > should either signal 'SIGILL' in this case or do an emulate branch (if > the rdhwr is can be used in a branch delay slot). Excuse me for the delay in replying, I had to investigate to figure this out and didn't find the time. It appears that rdhwr is allowed in a branch delay slot, but since it is known to be more costly, GCC developers avoid using it there, see: http://gcc.gnu.org/ml/gcc/2006-07/msg00488.html http://gcc.gnu.org/ml/gcc/2006-07/msg00494.html So I guess it'll be best to emulate it for correctness, knowing that this path will seldom be used. What do you think? Another doubt I have is that I don't get the distinction between the trapframe here: struct thread *td =3D curthread; [...] struct trapframe *locr0 =3D td->td_frame; and this one: register_t trap(struct trapframe *trapframe) { Do both correspond to userland CPU context for current thread? Thanks! --=20 Robert Millan From owner-freebsd-mips@FreeBSD.ORG Sat Aug 6 21:59:47 2011 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 0DBA3106564A for ; Sat, 6 Aug 2011 21:59:47 +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 AC8DF8FC08 for ; Sat, 6 Aug 2011 21:59:46 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.4) with ESMTP id p76LYLkA054992; Sat, 6 Aug 2011 17:34:21 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.4/Submit) id p76LYLA4054983; Sat, 6 Aug 2011 21:34:21 GMT (envelope-from tinderbox@freebsd.org) Date: Sat, 6 Aug 2011 21:34:21 GMT Message-Id: <201108062134.p76LYLA4054983@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: Sat, 06 Aug 2011 21:59:47 -0000 TB --- 2011-08-06 21:06:37 - tinderbox 2.7 running on freebsd-current.sentex.ca TB --- 2011-08-06 21:06:37 - starting HEAD tinderbox run for mips/mips TB --- 2011-08-06 21:06:37 - cleaning the object tree TB --- 2011-08-06 21:06:46 - cvsupping the source tree TB --- 2011-08-06 21:06:46 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/mips/mips/supfile TB --- 2011-08-06 21:07:00 - building world TB --- 2011-08-06 21:07:00 - MAKEOBJDIRPREFIX=/obj TB --- 2011-08-06 21:07:00 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2011-08-06 21:07:00 - TARGET=mips TB --- 2011-08-06 21:07:00 - TARGET_ARCH=mips TB --- 2011-08-06 21:07:00 - TZ=UTC TB --- 2011-08-06 21:07:00 - __MAKE_CONF=/dev/null TB --- 2011-08-06 21:07:00 - cd /src TB --- 2011-08-06 21:07:00 - /usr/bin/make -B buildworld >>> World build started on Sat Aug 6 21:07:00 UTC 2011 >>> 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 [...] /src/lib/libthread_db/libthr_db.c: In function 'pt_ta_map_id2thr': /src/lib/libthread_db/libthr_db.c:217: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type /src/lib/libthread_db/libthr_db.c: In function 'pt_ta_thr_iter': /src/lib/libthread_db/libthr_db.c:257: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type /src/lib/libthread_db/libthr_db.c: In function 'pt_ta_event_getmsg': /src/lib/libthread_db/libthr_db.c:398: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type /src/lib/libthread_db/libthr_db.c: In function 'pt_thr_event_getmsg': /src/lib/libthread_db/libthr_db.c:702: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type *** Error code 1 Stop in /src/lib/libthread_db. *** Error code 1 Stop in /src/lib. *** 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 --- 2011-08-06 21:34:21 - WARNING: /usr/bin/make returned exit code 1 TB --- 2011-08-06 21:34:21 - ERROR: failed to build world TB --- 2011-08-06 21:34:21 - 1154.76 user 339.61 system 1663.63 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full