From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZOq1e-0005Xt-TU for mharc-grub-devel@gnu.org; Mon, 10 Aug 2015 12:34:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOq1c-0005Sw-0G for grub-devel@gnu.org; Mon, 10 Aug 2015 12:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOq1W-0000ZZ-Mu for grub-devel@gnu.org; Mon, 10 Aug 2015 12:34:11 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:26959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOq1W-0000Yw-GS for grub-devel@gnu.org; Mon, 10 Aug 2015 12:34:06 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7AGXwtI020679 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Aug 2015 16:33:59 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t7AGXvv2006012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 10 Aug 2015 16:33:58 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t7AGXvSG002570; Mon, 10 Aug 2015 16:33:57 GMT Received: from l.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 10 Aug 2015 09:33:47 -0700 Received: by l.oracle.com (Postfix, from userid 1000) id C07666A3C8E; Mon, 10 Aug 2015 12:33:45 -0400 (EDT) Date: Mon, 10 Aug 2015 12:33:45 -0400 From: Konrad Rzeszutek Wilk To: Daniel Kiper Subject: Re: [Xen-devel] [PATCH v2 04/23] x86/boot: call reloc() using cdecl calling convention Message-ID: <20150810163345.GA13576@l.oracle.com> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-5-git-send-email-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437402558-7313-5-git-send-email-daniel.kiper@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: jgross@suse.com, grub-devel@gnu.org, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, gang.wei@intel.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, phcoder@gmail.com, xen-devel@lists.xenproject.org, wei.liu2@citrix.com, richard.l.maliszewski@intel.com, qiaowei.ren@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: Mon, 10 Aug 2015 16:34:13 -0000 On Mon, Jul 20, 2015 at 04:28:59PM +0200, Daniel Kiper wrote: > Suggested-by: Jan Beulich > Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk > --- > xen/arch/x86/boot/head.S | 4 +++- > xen/arch/x86/boot/reloc.c | 20 ++++++++++++++++---- > 2 files changed, 19 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S > index ed42782..3cbb2e6 100644 > --- a/xen/arch/x86/boot/head.S > +++ b/xen/arch/x86/boot/head.S > @@ -119,8 +119,10 @@ __start: > > /* Save the Multiboot info struct (after relocation) for later use. */ > mov $sym_phys(cpu0_stack)+1024,%esp > - push %ebx > + push %ebx /* Multiboot information address. */ > + push %eax /* Boot trampoline address. */ > call reloc > + add $8,%esp /* Remove reloc() args from stack. */ > mov %eax,sym_phys(multiboot_ptr) > > /* Initialize BSS (no nasty surprises!). */ > diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c > index 63045c0..708898f 100644 > --- a/xen/arch/x86/boot/reloc.c > +++ b/xen/arch/x86/boot/reloc.c > @@ -10,15 +10,27 @@ > * Keir Fraser > */ > > -/* entered with %eax = BOOT_TRAMPOLINE */ > +/* > + * This entry point is entered from xen/arch/x86/boot/head.S with: > + * - 0x4(%esp) = BOOT_TRAMPOLINE_ADDRESS, > + * - 0x8(%esp) = MULTIBOOT_INFORMATION_ADDRESS. > + */ > asm ( > " .text \n" > " .globl _start \n" > "_start: \n" > + " push %ebp \n" > + " mov %esp,%ebp \n" > " call 1f \n" > - "1: pop %ebx \n" > - " mov %eax,alloc-1b(%ebx) \n" > - " jmp reloc \n" > + "1: pop %ecx \n" > + " mov 0x8(%ebp),%eax \n" > + " mov %eax,alloc-1b(%ecx) \n" > + " mov 0xc(%ebp),%eax \n" > + " push %eax \n" > + " call reloc \n" > + " add $4,%esp \n" > + " pop %ebp \n" > + " ret \n" > ); > > /* > -- > 1.7.10.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel