From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YHFml-00026g-K3 for mharc-grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHFme-0001vU-S6 for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHFmV-0007Kb-Vm for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:08 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:36583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHFmV-0007KJ-Po for grub-devel@gnu.org; Fri, 30 Jan 2015 12:54:59 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t0UHsqRq002620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Jan 2015 17:54:53 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0UHspbD022781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 30 Jan 2015 17:54:51 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0UHspJV022768; Fri, 30 Jan 2015 17:54:51 GMT Received: from olila.local.net-space.pl (/10.175.253.219) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Jan 2015 09:54:50 -0800 From: Daniel Kiper To: xen-devel@lists.xenproject.org, grub-devel@gnu.org Subject: [PATCH 03/18] x86/boot: use %ecx instead of %eax Date: Fri, 30 Jan 2015 18:54:07 +0100 Message-Id: <1422640462-28103-4-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> References: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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, keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.citrix.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, phcoder@gmail.com, 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: Fri, 30 Jan 2015 17:55:13 -0000 Use %ecx instead of %eax to store low memory upper limit from EBDA. This way we do not wipe multiboot protocol identifier. It is needed in reloc() to differentiate between multiboot (v1) and multiboot2 protocol. Signed-off-by: Daniel Kiper Reviewed-by: Andrew Cooper --- xen/arch/x86/boot/head.S | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index c99f739..6180783 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -86,14 +86,14 @@ __start: jne not_multiboot /* Set up trampoline segment 64k below EBDA */ - movzwl 0x40e,%eax /* EBDA segment */ - cmp $0xa000,%eax /* sanity check (high) */ + movzwl 0x40e,%ecx /* EBDA segment */ + cmp $0xa000,%ecx /* sanity check (high) */ jae 0f - cmp $0x4000,%eax /* sanity check (low) */ + cmp $0x4000,%ecx /* sanity check (low) */ jae 1f 0: - movzwl 0x413,%eax /* use base memory size on failure */ - shl $10-4,%eax + movzwl 0x413,%ecx /* use base memory size on failure */ + shl $10-4,%ecx 1: /* * Compare the value in the BDA with the information from the @@ -105,21 +105,22 @@ __start: cmp $0x100,%edx /* is the multiboot value too small? */ jb 2f /* if so, do not use it */ shl $10-4,%edx - cmp %eax,%edx /* compare with BDA value */ - cmovb %edx,%eax /* and use the smaller */ + cmp %ecx,%edx /* compare with BDA value */ + cmovb %edx,%ecx /* and use the smaller */ 2: /* Reserve 64kb for the trampoline */ - sub $0x1000,%eax + sub $0x1000,%ecx /* From arch/x86/smpboot.c: start_eip had better be page-aligned! */ - xor %al, %al - shl $4, %eax - mov %eax,sym_phys(trampoline_phys) + xor %cl, %cl + shl $4, %ecx + mov %ecx,sym_phys(trampoline_phys) /* 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 */ mov %eax,sym_phys(multiboot_ptr) /* Initialize BSS (no nasty surprises!) */ -- 1.7.10.4