From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH for-xen-4.5 v3 15/16] x86/boot: Use %ecx instead of %eax Date: Thu, 9 Oct 2014 12:02:53 +0100 Message-ID: <54366B5D.3060503@citrix.com> References: <1412790736-28915-1-git-send-email-daniel.kiper@oracle.com> <1412790736-28915-16-git-send-email-daniel.kiper@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcBUs-0002na-SB for xen-devel@lists.xenproject.org; Thu, 09 Oct 2014 11:03:02 +0000 In-Reply-To: <1412790736-28915-16-git-send-email-daniel.kiper@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Daniel Kiper , xen-devel@lists.xenproject.org Cc: jgross@suse.com, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ross.philipson@citrix.com, roy.franz@linaro.org, ning.sun@intel.com, jbeulich@suse.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org List-Id: xen-devel@lists.xenproject.org On 08/10/14 18:52, Daniel Kiper wrote: > Use %ecx instead of %eax and do not wipe multiboot protocol identifier. > We need that info in __reloc() to differentiate between multiboot(1) > and multiboot2 protocol. > > Signed-off-by: Daniel Kiper Much easier to review! Reviewed-by: Andrew Cooper given 1 tiny comment... > --- > xen/arch/x86/boot/head.S | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S > index f1b872a..18df0b7 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,19 +105,20 @@ __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 > + mov %ecx,%eax Probably useful to identify which parameters are in which registers when calling into reloc ~Andrew > push %ebx > call reloc > mov %eax,sym_phys(mbd_pa)