Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YIhVw-00031N-2R for mharc-grub-devel@gnu.org; Tue, 03 Feb 2015 12:43:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIhVn-00030A-Ou for grub-devel@gnu.org; Tue, 03 Feb 2015 12:43:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIhVi-00030F-Lv for grub-devel@gnu.org; Tue, 03 Feb 2015 12:43:43 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:43233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIhVi-0002zz-G4 for grub-devel@gnu.org; Tue, 03 Feb 2015 12:43:38 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t13HhS2g025332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Feb 2015 17:43:29 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t13HhQmG025027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 3 Feb 2015 17:43:27 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t13HhPAh024934; Tue, 3 Feb 2015 17:43:25 GMT Received: from olila.local.net-space.pl (/10.175.224.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Feb 2015 09:43:24 -0800 Date: Tue, 3 Feb 2015 18:43:18 +0100 From: Daniel Kiper To: Jan Beulich Subject: Re: [PATCH 03/18] x86/boot: use %ecx instead of %eax Message-ID: <20150203174318.GL29167@olila.local.net-space.pl> References: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> <1422640462-28103-4-git-send-email-daniel.kiper@oracle.com> <54D0AAB1020000780005C491@mail.emea.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D0AAB1020000780005C491@mail.emea.novell.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 Cc: Juergen Gross , grub-devel@gnu.org, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, phcoder@gmail.com, xen-devel@lists.xenproject.org, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org 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: Tue, 03 Feb 2015 17:43:49 -0000 On Tue, Feb 03, 2015 at 10:02:09AM +0000, Jan Beulich wrote: > >>> On 30.01.15 at 18:54, wrote: > > /* Save the Multiboot info struct (after relocation) for later use. */ > > mov $sym_phys(cpu0_stack)+1024,%esp > > - push %ebx > > - call reloc > > + mov %ecx,%eax > > + push %ebx /* Multiboot information address */ > > + call reloc /* %eax contains trampoline address */ > > This last part looks completely unrelated to the change made here > (and contrary to the description, as here you clobber %eax while > the description says reloc() needs it unclobbered); afaict it belongs > in whatever patch add the consumption of this value in reloc(). Yep, this is confusing. I should change reloc.c:_start() in this patch too. > That said - passing parameters to reloc() by two different means > looks very odd too. I'm clearly of the opinion that parameter > passing should follow an existing convention unless entirely > unfeasible. Which then raises the question whether this patch is So, I think that we should add another patch which fixes this issue and put all arguments on the stack according to the cdecl calling convention on x86. > really needed: Rather than fiddling with a lot of code, can't you > just copy the incoming %eax into some other register, making this > a single line change that can again simply be done in the patch > where you actually consume the new information? If we do thing(s) mentioned above then this issue will disappear too. Additionally, I think that we should not use another register if it is not really required. Daniel