From patchwork Wed May 1 19:39:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 10925533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF5A214B6 for ; Wed, 1 May 2019 19:41:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CED0328ECB for ; Wed, 1 May 2019 19:41:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB7EE28ECA; Wed, 1 May 2019 19:41:31 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7582828ECB for ; Wed, 1 May 2019 19:41:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLv4l-0005LG-Jt; Wed, 01 May 2019 19:39:31 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLv4j-0005KU-90 for xen-devel@lists.xenproject.org; Wed, 01 May 2019 19:39:29 +0000 X-Inumbo-ID: d4548a78-6c48-11e9-843c-bc764e045a96 Received: from merlin.infradead.org (unknown [2001:8b0:10b:1231::1]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d4548a78-6c48-11e9-843c-bc764e045a96; Wed, 01 May 2019 19:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0uzhdEgCHmkBXOnlYFszNL13fpDQ+zr287GzwBDOIO8=; b=NMt84nkvmSxnOoQKhd4p+nVAz 4gO3/RuqN4SZQiLXwIz2GO+WR1V3YhchkHLs2iZ+DEtOwWe+GmCV4rH7+cN27Lj3jGXBEr15bgc3Q uTkkmqUXQ3radcV6IhBpVGfzRnozg9+SE7KGItQ7j+OATg1GvxypkFUuOqf2QRzJt0wUH15hqaAQ5 ZsEdXdotm/Ipdqdh5RroeKtY45+vBFamPImVcPlWvJINnFBzbIbx9gHoBYY+F7CUoGfFcmMwdBakA if5xScZrlZ5rZUxD3OvQ5QEzHaH0G/rG86KKDMzrWyif1SCBbjMHOwXotLJ60IKPDlQq2QVCYvLTK 9lfA1X1Yg==; Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLv4g-0002zf-5s for xen-devel@lists.xenproject.org; Wed, 01 May 2019 19:39:26 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hLv4f-0032Td-9j for xen-devel@lists.xenproject.org; Wed, 01 May 2019 20:39:25 +0100 From: David Woodhouse To: xen-devel@lists.xenproject.org Date: Wed, 1 May 2019 20:39:21 +0100 Message-Id: X-Mailer: git-send-email 2.17.2 In-Reply-To: References: In-Reply-To: References: X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Subject: [Xen-devel] [RFC PATCH v2 3/7] x86/boot: Only jump into low trampoline code for real-mode boot X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: David Woodhouse If the no-real-mode flag is set, don't go there at all. This is a prelude to not even putting it there in the first place. Signed-off-by: David Woodhouse --- xen/arch/x86/boot/head.S | 10 ++++++++++ xen/arch/x86/boot/trampoline.S | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index db19ac6fd8..7c30de3671 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -734,7 +734,17 @@ trampoline_setup: /* Switch to low-memory stack which lives at the end of trampoline region. */ mov sym_fs(trampoline_phys),%edi lea TRAMPOLINE_SPACE+TRAMPOLINE_STACK_SPACE(%edi),%esp + cmpb $0, sym_fs(skip_realmode) + jz 1f + /* If no-real-mode, jump straight to trampoline_protmode_entry */ + lea trampoline_protmode_entry-trampoline_start(%edi),%eax + /* EBX == 0 indicates we are the BP (Boot Processor). */ + xor %ebx,%ebx + jmp 2f +1: + /* Go via 16-bit code in trampoline_boot_cpu_entry */ lea trampoline_boot_cpu_entry-trampoline_start(%edi),%eax +2: pushl $BOOT_CS32 push %eax diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index 5588c7986a..df0ffd5013 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -187,9 +187,6 @@ start64: .code32 trampoline_boot_cpu_entry: - cmpb $0,bootsym_rel(skip_realmode,5) - jnz .Lskip_realmode - /* Load pseudo-real-mode segments. */ mov $BOOT_PSEUDORM_DS,%eax mov %eax,%ds @@ -269,7 +266,6 @@ trampoline_boot_cpu_entry: mov %eax,%gs mov %eax,%ss -.Lskip_realmode: /* EBX == 0 indicates we are the BP (Boot Processor). */ xor %ebx,%ebx