From patchwork Fri Aug 19 22:43:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9291293 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 75323600CB for ; Fri, 19 Aug 2016 22:46:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A879295CE for ; Fri, 19 Aug 2016 22:46:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F3B2295D6; Fri, 19 Aug 2016 22:46:30 +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 C0975295CE for ; Fri, 19 Aug 2016 22:46:29 +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 1basWh-0002Xu-HN; Fri, 19 Aug 2016 22:44:35 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1basWf-0002X8-U3 for xen-devel@lists.xenproject.org; Fri, 19 Aug 2016 22:44:34 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id FA/49-08498-1DB87B75; Fri, 19 Aug 2016 22:44:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeJIrShJLcpLzFFi42LpnVTnqnuhe3u 4wd0pKhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8ahSY9ZC7aKVszoucbcwPift4uRi0NIYDKT xJWb99ggnL+MEhdX/WGHcDYyStw82MAI4UxklDh7/QxQGScHm4COxMUvD9lBbBEBJYl7qyYzg RQxC8xhkrjauwvI4eAQFrCReN4eCmKyCKhKXJ0sC1LOK+AucefnXBYQW0JAUaL72QSwkZwCHh J/Nj1iArGFgGoe//nBBlFjLNH+9iLbBEa+BYwMqxg1ilOLylKLdI1M9ZKKMtMzSnITM3N0DQ3 M9HJTi4sT01NzEpOK9ZLzczcxAkOFAQh2MK5aEHiIUZKDSUmU109te7gQX1J+SmVGYnFGfFFp TmrxIUYZDg4lCd5/nUA5waLU9NSKtMwcYNDCpCU4eJREeBm6gNK8xQWJucWZ6RCpU4y6HI8W3 ljLJMSSl5+XKiXOGw1SJABSlFGaBzcCFkGXGGWlhHkZgY4S4ilILcrNLEGVf8UozsGoJMzbAD KFJzOvBG7TK6AjmICO4OXfAnJESSJCSqqBkfFI1+2lCXwNMqJf2QSXPLTbXZ5hZng7JNE8tTh PsdzoR2bJqrbdqlaz77v9yxdJffnU4GCU4e7KH9/1Y5k2T3tt+XOf06QTpz+w7p6W2td/j8f6 NPufBW+0FGUZrX8fNvs4SUDi42oT86PHA6evn8p/L4AphmPuQrN8zm2t36Tkzu+t9160TImlO CPRUIu5qDgRAOxh2JGbAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1471646670!29293067!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.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29689 invoked from network); 19 Aug 2016 22:44:32 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 19 Aug 2016 22:44:32 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u7JMiO6r013202 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Aug 2016 22:44:24 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u7JMiOrx000985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Aug 2016 22:44:24 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u7JMiNYa012503; Fri, 19 Aug 2016 22:44:23 GMT Received: from olila.local.net-space.pl (/10.175.190.131) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 19 Aug 2016 15:44:22 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org Date: Sat, 20 Aug 2016 00:43:17 +0200 Message-Id: <1471646606-28519-8-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1471646606-28519-1-git-send-email-daniel.kiper@oracle.com> References: <1471646606-28519-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] 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, gang.wei@intel.com, fu.wei@linaro.org Subject: [Xen-devel] [PATCH v5 07/16] 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)