From patchwork Fri Aug 5 23:04:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9265767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 407D360839 for ; Fri, 5 Aug 2016 23:08:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F07628462 for ; Fri, 5 Aug 2016 23:08:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 238792848E; Fri, 5 Aug 2016 23:08:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 91F2128462 for ; Fri, 5 Aug 2016 23:08:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVoBR-00038x-SD; Fri, 05 Aug 2016 23:05:41 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVoBQ-00037I-EN for xen-devel@lists.xenproject.org; Fri, 05 Aug 2016 23:05:40 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 96/87-05127-3CB15A75; Fri, 05 Aug 2016 23:05:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeJIrShJLcpLzFFi42LpnVTnqntYemm 4wb1pkhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8ahSY9ZC7aKVszoucbcwPift4uRi0NIoJVJ on3LGTYI5yujxJpLjSwQzgZGid+vt0BlJjJKnF3Tz97FyMnBJqAjcfHLQzBbREBJ4t6qyUwgR cwCR5kk/k9+zAqSEBawkZix8TsjiM0ioCpx+HcfE4jNK+Am8XbxMzYQW0JAUaL72QQwm1PAXW LexudgthBQzcfu+awQNYYSpx9uY5zAyLeAkWEVo3pxalFZapGupV5SUWZ6RkluYmaOrqGBqV5 uanFxYnpqTmJSsV5yfu4mRmCwMADBDsa1rc6HGCU5mJREec9fXhIuxJeUn1KZkVicEV9UmpNa fIhRhoNDSYJ3qtTScCHBotT01Iq0zBxg2MKkJTh4lER4Z4GkeYsLEnOLM9MhUqcYdTkeLbyxl kmIJS8/L1VKnNcVpEgApCijNA9uBCyGLjHKSgnzMgIdJcRTkFqUm1mCKv+KUZyDUUmYNx5kCk 9mXgncpldARzABHfHRagnIESWJCCmpBsayrqeH8qzDjHXuznq8KOBFpa9Niof6s38HwkJkMzc EvzpTL68WkVL2N7C3guf0ythi7UhmfVbHX7migUfs1+z6tnrTS1FOxgTJvbUz3PvfFrm6nbuZ f118+ooUPwNptSn7ROZnBavVuEpnqD967L2s7uLyb04T7de7dFzcn8vSVb90auejdUosxRmJh lrMRcWJACkAf9ScAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1470438337!37192526!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64715 invoked from network); 5 Aug 2016 23:05:39 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-2.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Aug 2016 23:05:39 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u75N5VL9005361 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2016 23:05:31 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u75N5UNQ016500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2016 23:05:31 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u75N5TdP003479; Fri, 5 Aug 2016 23:05:30 GMT Received: from olila.local.net-space.pl (/10.175.255.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Aug 2016 16:05:29 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org Date: Sat, 6 Aug 2016 01:04:30 +0200 Message-Id: <1470438282-4226-8-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1470438282-4226-1-git-send-email-daniel.kiper@oracle.com> References: <1470438282-4226-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: jgross@suse.com, sstabellini@kernel.org, andrew.cooper3@citrix.com, cardoe@cardoe.com, pgnet.dev@gmail.com, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org Subject: [Xen-devel] [PATCH v4 07/19] x86/boot: use %ecx instead of %eax X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Konrad Rzeszutek Wilk --- xen/arch/x86/boot/head.S | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 7e5ae12..ffafcb5 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -87,14 +87,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 @@ -106,20 +106,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 - push %eax /* Boot trampoline address. */ + push %ecx /* Boot trampoline address. */ push %ebx /* Multiboot information address. */ call reloc mov %eax,sym_phys(multiboot_ptr)