From owner-freebsd-arm@FreeBSD.ORG Fri Jan 10 23:02:48 2014 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8EE244D; Fri, 10 Jan 2014 23:02:48 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9270618D3; Fri, 10 Jan 2014 23:02:48 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s0AN2fOD077988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Jan 2014 15:02:41 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s0AN2fd4077987; Fri, 10 Jan 2014 15:02:41 -0800 (PST) (envelope-from jmg) Date: Fri, 10 Jan 2014 15:02:41 -0800 From: John-Mark Gurney To: Ian Lepore , freebsd-arm@FreeBSD.org Subject: Re: svn commit: r258412 - in head/sys/arm: at91 econa s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa Message-ID: <20140110230241.GS46596@funkthat.com> Mail-Followup-To: Ian Lepore , freebsd-arm@FreeBSD.org, andrew@FreeBSD.org References: <201311210108.rAL18AoQ051365@svn.freebsd.org> <20131221061048.GC99167@funkthat.com> <20140108071643.GB99167@funkthat.com> <1389197091.1158.370.camel@revolution.hippie.lan> <20140108173909.GF99167@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140108173909.GF99167@funkthat.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 10 Jan 2014 15:02:42 -0800 (PST) Cc: andrew@FreeBSD.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2014 23:02:48 -0000 John-Mark Gurney wrote this message on Wed, Jan 08, 2014 at 09:39 -0800: > So, I've tested that HEAD (absolutely no tree changes) w/ > WITHOUT_ARM_EABI boots fine... and just to make sure my test is > correct, I've disabled it too to verify that the kernel just hangs > (absolutely no output).. and reenabled it and verified it works (that > my setting is changing something)... > worky -> no worky -> worky... > > Now I just realized another interesting thing about setting > WITHOUT_ARM_EABI, it also fixes the console issue I was having w/ your > call to cpu_setup("") previously (w/ EABI) killing console output and > not even seeing the mtx panic message... > > So, it is clearly changing something very early on in boot... Apparently gcc ARMEB w/ EABI miscompiles code... The code to store lo_flags in the lock_object is correct: lock->lo_flags = i << LO_CLASSSHIFT; c03ce2d0: e1a01c06 lsl r1, r6, #24 c03ce2d4: e5881004 str r1, [r8, #4] But when I add a printf to fetch the data, I get: printf("lo_classindex: %#x\n", LO_CLASSINDEX(lock)); c03ce2e0: e5d81007 ldrb r1, [r8, #7] c03ce2e4: e59f0098 ldr r0, [pc, #152] ; c03ce384 <_end+0xffcf9 19c> c03ce2e8: e201100f and r1, r1, #15 ; 0xf c03ce2ec: eb0012ea bl c03d2e9c We are doing a ldrb (LoaD Relative Byte) which would be fine to substitute for the right shift of 24, but only if it loaded the correct byte.. It should be loading #4 instead of #7 since we are on big endian... Anyone who know gcc arm well to figure this out? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."