Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VhfTw-00023m-EJ for mharc-grub-devel@gnu.org; Sat, 16 Nov 2013 08:00:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhfTp-0001vU-6J for grub-devel@gnu.org; Sat, 16 Nov 2013 08:00:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhfTj-00075U-6e for grub-devel@gnu.org; Sat, 16 Nov 2013 08:00:05 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:39630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhfTj-00075A-10 for grub-devel@gnu.org; Sat, 16 Nov 2013 07:59:59 -0500 Received: by mail-ee0-f41.google.com with SMTP id t10so325626eei.28 for ; Sat, 16 Nov 2013 04:59:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=AUTPCnPXMzS6zPqPLPptX46mrtJ0auBW9dzPpVBGUIg=; b=etHrYJehWpkGJgW6sQQgIgEMiKNEynaAs/ZmS7RPeW5Ahub/DhVqVls1wRKSob7z2y oH46wH2BgeO/eZETxtuSjB/OtrLNczA7qlSO8go0dO1IuhMY7kQSFskc/7BnO3PzD1rJ Y2eZ5c+Lyod3thHeFnDzFHE4RCguJQCvu7fZm3xHYjhnPTF3a74kqXD/lflLV8hAD6E2 Wuw9bvL3deBAll4cr25hCqnQIyo7HSU22Vy92LKwFXigi2VbDH+tR+y5PVDCke84CoCP VuZSQ9Io1yPtexBiNUxVNgAptuVrUkack7h0e/d5BqBtrWJKxBqbxz2Fg+GZ5P7/FVic o3ew== X-Gm-Message-State: ALoCoQmH91CjZo6vs5cVHW+rRkuh3FpTrCWXKCxZfCyq440ZZiuX0/qH1HckglUOfFuaZufNsr9d X-Received: by 10.15.32.198 with SMTP id a46mr7649412eev.31.1384606798077; Sat, 16 Nov 2013 04:59:58 -0800 (PST) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id g47sm16543456eeo.19.2013.11.16.04.59.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 16 Nov 2013 04:59:57 -0800 (PST) Date: Sat, 16 Nov 2013 14:00:10 +0100 From: Leif Lindholm To: The development of GNU GRUB Subject: Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm) Message-ID: <20131116130010.GD30374@rocoto.smurfnet.nu> References: <51EBE025.6040302@gmail.com> <51F137FE.4030102@gmail.com> <51F139FF.2030402@gmail.com> <51F13E82.7040207@gmail.com> <20130727074625.64ad89d2@opensuse.site> <51F34AE4.1080709@gmail.com> <20131115231325.1d3fa95a@opensuse.site> <5286C02B.9050404@gmail.com> <20131116123941.GC30374@rocoto.smurfnet.nu> <528769EF.9070207@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <528769EF.9070207@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.83.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Nov 2013 13:00:11 -0000 On Sat, Nov 16, 2013 at 01:49:51PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > On 16.11.2013 13:39, Leif Lindholm wrote: > > - str r9, transition_space + 8 > You need to save r9. Otherwise GRUB will crash if compiled with clang. Hmm, but this is a bug in clang in that case. From an ABI perspective, grub_uboot_syscall is a veneer: the only visible side effect it is permitted to have is to corrupt r12. We need to additionally switch r8 between grub and u-boot copy because u-boot uses it for its global data pointer, and lr because we need to corrupt it to make u-boot return to this veneer to switch the r8 back again. This veneer should not touch anything else - so if we need to temporarily work around a toolchain ABI bug, can we do this via an ifdef and a config option? / Leif