From owner-freebsd-arm@FreeBSD.ORG Tue Jul 22 07:38:00 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB5F9B52; Tue, 22 Jul 2014 07:38:00 +0000 (UTC) Received: from work.netasq.com (gwlille.netasq.com [91.212.116.1]) by mx1.freebsd.org (Postfix) with ESMTP id 606A62679; Tue, 22 Jul 2014 07:37:59 +0000 (UTC) Received: from work.netasq.com (localhost [127.0.0.1]) by work.netasq.com (Postfix) with ESMTP id BBE962700B44; Tue, 22 Jul 2014 09:37:57 +0200 (CEST) Received: from work.netasq.com (localhost [127.0.0.1]) by work.netasq.com (Postfix) with ESMTP id A136D2700A68; Tue, 22 Jul 2014 09:37:57 +0200 (CEST) Received: from [10.2.1.1] (unknown [91.212.116.2]) by work.netasq.com (Postfix) with ESMTPSA id 43C282700B44; Tue, 22 Jul 2014 09:37:57 +0200 (CEST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [CFR] mge driver / elf reloc From: Fabien Thomas In-Reply-To: Date: Tue, 22 Jul 2014 09:37:56 +0200 Message-Id: <3AE875C4-0259-4741-9433-BA0A9C1DCC40@freebsd.org> References: <14D22EA6-B73C-47BA-9A86-A957D24F23B8@freebsd.org> <1405810447.85788.41.camel@revolution.hippie.lan> <20140720220514.GP45513@funkthat.com> <20140720231056.GQ45513@funkthat.com> <9464C309-B390-4A27-981A-E854921B1C98@bsdimp.com> <20140721162559.GS45513@funkthat.com> <467619B1-F530-49AF-91BF-14CA3A31908B@bsdimp.com> <20140721165619.GT45513@funkthat.com> To: Warner Losh X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: Tim Kientzle , freebsd-arm , Ian Lepore , arch@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 07:38:00 -0000 >>=20 >> The original message said why=85 >=20 > I personally think the original code should unconditionally call = load_ptr() and store_ptr() > and if the optimization for aligned access is actually worth doing, = the test for it should be > in those functions rather than inline throughout the code. The code = will be clearer, and > it would be easier to optimize those cases that actually matter. >=20 > I=92m frankly surprised that these relocations are being generated = unaligned. Perhaps that=92s > the real bug here that should be fixed. While I=92m OK with the = original patch (subject to the > above), I=92d be curious what other cases there are for this = functionality. You had said that > you had additional use cases in the network stack, but I=92m having = trouble groking the > use cases. The problem was two years ago but if I remember correctly the module = used a packed structure with function pointer inside (at least). The fix came from NetBSD: = http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5/src/libexec/ld.elf_so/ar= ch/arm/mdreloc.c = http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5/src/libexec/ld.elf_so/ar= ch/mips/mips_reloc.c >=20 > If this is a huge deal, then defining functions to do this is trivial. = I=92m just not sure it is common > enough to need a special macro/function call in the base. >=20 > Warner