All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: xen-devel@lists.xenproject.org, grub-devel@gnu.org
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
Subject: [PATCH 03/18] x86/boot: use %ecx instead of %eax
Date: Fri, 30 Jan 2015 18:54:07 +0100	[thread overview]
Message-ID: <1422640462-28103-4-git-send-email-daniel.kiper__49072.5176911384$1422640602$gmane$org@oracle.com> (raw)
In-Reply-To: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com>

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 <daniel.kiper@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 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

  parent reply	other threads:[~2015-01-30 17:55 UTC|newest]

Thread overview: 166+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 17:54 [PATCH 00/18] x86: multiboot2 protocol support Daniel Kiper
2015-01-30 17:54 ` [PATCH 01/18] x86/boot/reloc: mask out MBI_BOOTDEV from mbi flags Daniel Kiper
2015-01-30 17:59   ` [Xen-devel] " Andrew Cooper
2015-01-30 17:59   ` Andrew Cooper
2015-01-30 17:54 ` Daniel Kiper
2015-01-30 17:54 ` [PATCH 02/18] x86/boot/reloc: create generic alloc and copy functions Daniel Kiper
2015-01-30 18:02   ` Andrew Cooper
2015-01-30 18:02   ` Andrew Cooper
2015-02-03 10:13   ` Jan Beulich
2015-02-03 10:13   ` Jan Beulich
2015-01-30 17:54 ` Daniel Kiper
2015-01-30 17:54 ` [PATCH 03/18] x86/boot: use %ecx instead of %eax Daniel Kiper
2015-02-03 10:02   ` Jan Beulich
2015-02-03 17:43     ` Daniel Kiper
2015-02-03 17:43     ` Daniel Kiper
2015-02-03 10:02   ` Jan Beulich
2015-01-30 17:54 ` Daniel Kiper [this message]
2015-01-30 17:54 ` [PATCH 04/18] xen/x86: add multiboot2 protocol support Daniel Kiper
2015-01-30 17:54 ` Daniel Kiper
2015-01-30 18:11   ` Andrew Cooper
2015-01-30 18:11   ` Andrew Cooper
2015-02-20 16:06   ` Jan Beulich
2015-03-27 10:56     ` Daniel Kiper
2015-03-27 11:20       ` Jan Beulich
2015-03-27 12:22         ` Daniel Kiper
2015-03-27 12:42           ` Jan Beulich
2015-03-27 12:42           ` Jan Beulich
2015-03-27 12:22         ` Daniel Kiper
2015-03-27 11:20       ` Jan Beulich
2015-03-27 10:56     ` Daniel Kiper
2015-01-30 17:54 ` [PATCH 05/18] efi: split efi_enabled to efi_platform and efi_loader Daniel Kiper
2015-02-20 16:17   ` Jan Beulich
2015-02-20 16:17   ` Jan Beulich
2015-03-27 13:32     ` Daniel Kiper
2015-03-27 13:32     ` Daniel Kiper
2015-03-27 13:43       ` Jan Beulich
2015-03-27 13:43       ` Jan Beulich
2015-03-27 13:53         ` Andrew Cooper
2015-03-27 13:53         ` Andrew Cooper
2015-03-27 14:04           ` Jan Beulich
2015-03-27 14:09             ` Lennart Sorensen
2015-03-27 14:09             ` Lennart Sorensen
2015-03-27 14:19               ` Jan Beulich
2015-03-27 14:19               ` [Xen-devel] " Jan Beulich
2015-03-27 14:21                 ` Lennart Sorensen
2015-03-27 14:21                 ` [Xen-devel] " Lennart Sorensen
2015-03-27 14:04           ` Jan Beulich
2015-03-02 17:21   ` Stefano Stabellini
2015-03-02 17:21   ` Stefano Stabellini
2015-03-02 18:43     ` Roy Franz
2015-03-02 23:40       ` Roy Franz
2015-03-02 23:40       ` Roy Franz
2015-03-03  8:49         ` Jan Beulich
2015-03-03  8:49         ` Jan Beulich
2015-01-30 17:54 ` Daniel Kiper
2015-01-30 17:54 ` [PATCH 06/18] x86: remove commented out stale references to efi_enabled Daniel Kiper
2015-01-30 17:54 ` [PATCH 07/18] efi: run EFI specific code on EFI platform only Daniel Kiper
2015-02-20 16:47   ` Jan Beulich
2015-02-20 16:47   ` Jan Beulich
2015-01-30 17:54 ` [PATCH 08/18] efi: build xen.gz with EFI code Daniel Kiper
2015-03-02 16:14   ` Jan Beulich
2015-03-02 16:14   ` Jan Beulich
2015-03-27 11:14     ` Daniel Kiper
2015-03-27 11:46       ` Jan Beulich
2015-03-27 11:46       ` Jan Beulich
2015-03-27 11:54         ` Andrew Cooper
2015-03-27 11:54         ` Andrew Cooper
2015-03-27 11:14     ` Daniel Kiper
2015-01-30 17:54 ` [PATCH 09/18] efi: create efi_init() Daniel Kiper
2015-01-30 17:54 ` [PATCH 10/18] efi: create efi_console_set_mode() Daniel Kiper
2015-01-30 17:54 ` [PATCH 11/18] efi: create efi_get_gop() Daniel Kiper
2015-01-30 17:54 ` [PATCH 12/18] efi: create efi_find_gop_mode() Daniel Kiper
2015-01-30 17:54 ` Daniel Kiper
2015-01-30 17:54 ` [PATCH 13/18] efi: create efi_tables() Daniel Kiper
2015-01-30 17:54 ` [PATCH 14/18] efi: create efi_variables() Daniel Kiper
2015-01-30 17:54 ` [PATCH 15/18] efi: create efi_set_gop_mode() Daniel Kiper
2015-01-30 17:54 ` [PATCH 16/18] efi: create efi_exit_boot() Daniel Kiper
2015-03-02 16:45   ` Jan Beulich
2015-03-27 12:00     ` Daniel Kiper
2015-03-27 12:10       ` Jan Beulich
2015-03-27 12:43         ` Daniel Kiper
2015-03-27 12:43         ` Daniel Kiper
2015-03-27 13:17           ` Ian Campbell
2015-03-27 13:17           ` Ian Campbell
2015-03-27 12:10       ` Jan Beulich
2015-03-27 12:00     ` Daniel Kiper
2015-03-02 16:45   ` Jan Beulich
2015-01-30 17:54 ` [PATCH 17/18] x86/efi: create new early memory allocator Daniel Kiper
2015-03-02 17:23   ` Jan Beulich
2015-03-02 20:25     ` Roy Franz
2015-03-03  8:04       ` Jan Beulich
2015-03-03  8:04       ` Jan Beulich
2015-03-03  9:39         ` Daniel Kiper
2015-03-03  9:39         ` Daniel Kiper
2015-03-27 12:57     ` Daniel Kiper
2015-03-27 12:57     ` Daniel Kiper
2015-03-27 13:35       ` Jan Beulich
2015-03-27 14:28         ` Daniel Kiper
2015-03-27 14:28         ` Daniel Kiper
2015-03-27 13:35       ` Jan Beulich
2015-03-02 17:23   ` Jan Beulich
2015-01-30 17:54 ` [PATCH 18/18] x86: add multiboot2 protocol support for EFI platforms Daniel Kiper
2015-01-30 19:06   ` Andrew Cooper
2015-01-30 19:06   ` Andrew Cooper
2015-01-30 23:43     ` Daniel Kiper
2015-01-31  0:47       ` Andrew Cooper
2015-01-31  0:47       ` Andrew Cooper
2015-01-30 23:43     ` Daniel Kiper
2015-02-10 21:27   ` Daniel Kiper
2015-02-10 21:27   ` Daniel Kiper
2015-02-10 22:41     ` Andrew Cooper
2015-02-10 22:41     ` Andrew Cooper
2015-02-11  8:20     ` Jan Beulich
2015-02-11  8:20     ` Jan Beulich
2015-02-14 17:23       ` Andrei Borzenkov
2015-02-15 21:00         ` Daniel Kiper
2015-02-15 21:00         ` Daniel Kiper
2015-02-14 17:23       ` Andrei Borzenkov
2015-03-17 10:32   ` Jan Beulich
2015-03-17 10:32   ` Jan Beulich
2015-03-17 12:47     ` Daniel Kiper
2015-03-17 12:47     ` Daniel Kiper
2015-03-27 13:06     ` Daniel Kiper
2015-03-27 13:36       ` Jan Beulich
2015-03-27 14:26         ` Daniel Kiper
2015-03-27 14:26         ` Daniel Kiper
2015-03-27 14:34           ` Jan Beulich
2015-03-27 14:57             ` Daniel Kiper
2015-03-27 14:57             ` Daniel Kiper
2015-03-27 15:06               ` Jan Beulich
2015-03-27 15:06               ` Jan Beulich
2015-03-27 15:10                 ` Daniel Kiper
2015-03-27 15:10                 ` Daniel Kiper
2015-03-27 13:36       ` Jan Beulich
2015-03-27 13:06     ` Daniel Kiper
2015-01-30 18:04 ` [PATCH 00/18] x86: multiboot2 protocol support Daniel Kiper
2015-01-30 18:04 ` Daniel Kiper
2015-01-31  7:22 ` João Jerónimo
2015-02-02  9:28 ` Jan Beulich
2015-02-03 17:14   ` Daniel Kiper
2015-02-03 17:14   ` Daniel Kiper
2015-02-04  9:04     ` Andrew Cooper
2015-02-04  9:51       ` Jan Beulich
2015-02-04  9:51       ` Jan Beulich
2015-02-05 10:59         ` Andrew Cooper
2015-02-05 10:59         ` Andrew Cooper
2015-02-05 11:50         ` Vladimir 'phcoder' Serbinenko
2015-02-05 12:00           ` Jan Beulich
2015-02-05 12:00           ` Jan Beulich
2015-02-05 11:50         ` Vladimir 'phcoder' Serbinenko
2015-02-04  9:04     ` Andrew Cooper
2015-02-02  9:28 ` Jan Beulich
2015-02-09 17:59 ` Daniel Kiper
2015-02-09 17:59 ` Daniel Kiper
2015-02-10  9:05   ` Jan Beulich
2015-02-10  9:05   ` Jan Beulich
2015-03-03 12:10 ` Ian Campbell
2015-03-03 12:10 ` Ian Campbell
2015-03-03 12:36   ` Daniel Kiper
2015-03-03 12:39     ` Ian Campbell
2015-03-03 12:51       ` Daniel Kiper
2015-03-03 12:51       ` Daniel Kiper
2015-03-03 12:39     ` Ian Campbell
2015-03-03 12:36   ` Daniel Kiper
2015-03-27 10:59 ` Daniel Kiper
2015-03-27 10:59 ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='1422640462-28103-4-git-send-email-daniel.kiper__49072.5176911384$1422640602$gmane$org@oracle.com' \
    --to=daniel.kiper@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=fu.wei@linaro.org \
    --cc=gang.wei@intel.com \
    --cc=grub-devel@gnu.org \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=keir@xen.org \
    --cc=ning.sun@intel.com \
    --cc=phcoder@gmail.com \
    --cc=qiaowei.ren@intel.com \
    --cc=richard.l.maliszewski@intel.com \
    --cc=roy.franz@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.