From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Zkf0t-00028i-M5 for mharc-grub-devel@gnu.org; Fri, 09 Oct 2015 17:15:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkf0Z-00028G-IS for grub-devel@gnu.org; Fri, 09 Oct 2015 17:15:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zkf08-0005WM-LP for grub-devel@gnu.org; Fri, 09 Oct 2015 17:15:19 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:33016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkf08-0005W7-CR for grub-devel@gnu.org; Fri, 09 Oct 2015 17:14:52 -0400 Received: by wiclk2 with SMTP id lk2so86604436wic.0 for ; Fri, 09 Oct 2015 14:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=0D+ZQEhuIAdFFVzYMe6vL4KDoASLlTAeZH1jdvN3K7I=; b=wnZZvZlqODCG/n3Sc3hOKSYPkrvS5dmpTq5HPLsRiURg0BWbVaihgTchuwdviirvBy fyHKZM6NkS07Ut3rlOIY/ymNf/ChiJsPJ2Wkd5vjVqH7SlXdxQkSgmZ2od36RcnVzN75 gY0JdvWdhKZdpFpYh8F1LJ6/W1XUxEFAD0lTLUvX0AF17QQW+GrMSbjHv76Mo4LzhLx7 FdBpPmkT1J+7XFymBmhKKd3ai+dVRezRMIupwjTHOAnQZm46cCkkwfpYytqY4muqCMBg 8eTnAVnn+1DWfvYxSBqbpnRqmNoCdi4e2vUIATRaQtTPQKBJJKqWUEgSVQVSE2quphyn JIiw== X-Received: by 10.180.11.175 with SMTP id r15mr1361536wib.74.1444425291664; Fri, 09 Oct 2015 14:14:51 -0700 (PDT) Received: from [10.119.6.25] ([83.143.7.1]) by smtp.gmail.com with ESMTPSA id lb10sm4242104wjc.9.2015.10.09.14.14.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 14:14:50 -0700 (PDT) Subject: Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI. To: The development of GNU GRUB References: <1440009323-8667-1-git-send-email-mhw@netris.org> <55D6A36D.205@gmail.com> <876147ryhy.fsf@netris.org> <55D99791.4080104@gmail.com> <87a8thuqmo.fsf_-_@netris.org> <55EF16C0.6010703@gmail.com> <55F5186E.5040306@gmail.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= X-Enigmail-Draft-Status: N1110 Message-ID: <56182E44.8010306@gmail.com> Date: Fri, 9 Oct 2015 23:14:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F5186E.5040306@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GaODJm4QgSDMVrqtSDfPMeqbe6msTUiRB" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::233 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: Fri, 09 Oct 2015 21:15:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GaODJm4QgSDMVrqtSDfPMeqbe6msTUiRB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 13.09.2015 08:32, Andrei Borzenkov wrote: > 08.09.2015 20:11, Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: >> On 23.08.2015 23:50, Mark H Weaver wrote: >>> Include -mabi=3D32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compi= le >>> code for the O32 ABI when targetting MIPS, since the MIPS assembly co= de >>> in GRUB assumes this. >> Could you be more precise where we assume this? Why not fix the assemb= ly >> instead? >=20 > If I understand it correctly, this is not only about assembly - ABIs > differ in sizes of types as well, Only in obscure types long double and uint128_t. We use neither. > so we'd need to define whole new CPU > in grub. Nope > Not sure if it's worth it. We can consider ourselves lucky it > was caught that early. The differences are: * Use of rela instead of rel section. (I've prepared a patch) * Register names: There is no $t5 but there is $a5. I prepared a draft, cleaning up * Different parameter/result passing in presence of either a) >4 parameters b) floats c) 64-bit integers d) structs Neither happens between C and assembly. In all we have only following interfaces between C and assembly: a) Relocator call. No arguments void (*) (void); b) void grub_main(void); c) void grub_decompress_core (void *src, void *dst, unsigned long srcsize, unsigned long dstsize); d) void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len); e) void grub_arch_sync_dma_caches (void *address, grub_size_t len); f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so pointer g) int grub_longjmp (grub_jmp_buf env, int val) * $gp is caller vs callee-saved. We don't use $gp in assembly except in setjmp which is already appropriate for n32. So, we need just few cleanups to make it work. Whether we want to continuously maintain this compatibility is another question. I'm going to commit the fixes --GaODJm4QgSDMVrqtSDfPMeqbe6msTUiRB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlYYLkQACgkQmBXlbbo5nOurzwD/RnwGEUQjJYIdlUv3dRM6yl09 M2MOUI00GsWREQ8k/2ABAJs05BJwox1ExGDTEb2pkUAgv1aoh+BBVw7jsQ8O1/ZV =VbOz -----END PGP SIGNATURE----- --GaODJm4QgSDMVrqtSDfPMeqbe6msTUiRB--