From patchwork Fri Aug 9 15:01:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 11086731 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 477031399 for ; Fri, 9 Aug 2019 15:03:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F6242000A for ; Fri, 9 Aug 2019 15:03:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23FCA1FFE5; Fri, 9 Aug 2019 15:03:07 +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 8AA1F1FFD9 for ; Fri, 9 Aug 2019 15:03:06 +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 1hw6Ow-0002vd-Pv; Fri, 09 Aug 2019 15:01:54 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hw6Ov-0002uy-Rh for xen-devel@lists.xenproject.org; Fri, 09 Aug 2019 15:01:53 +0000 X-Inumbo-ID: 9e829dbe-bab6-11e9-8980-bc764e045a96 Received: from merlin.infradead.org (unknown [2001:8b0:10b:1231::1]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9e829dbe-bab6-11e9-8980-bc764e045a96; Fri, 09 Aug 2019 15:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Mime-Version:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To: 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=n96qu5Uu1/dUVOHxfzBzpuYzQlINE+oe0rtaySasuJM=; b=0D4Pi6ifXc4wFMdhaBE9MyXPy qhdCK60ShAm7m8wwaYsgeMoZbFSwD/aUxpKKhaTk+wFI/3hN7f0ruYgAOHbow82p8pRBLh8bFLtYG Twh5ssRPilDB1eldFmAjo5cDiUjWrnA0TVs1gD+NG3+7P948RHzYES1QHLUMCqllLPJC9j2Qk888h uDicB7bVj4rTl1CgkWyjSodpfboSVLUplDaLHwn8N7jYe0x0HEBEuQjJoBl/iTHu4ZRjGjzSIp2qN aHf13p2GOQeAch65vKu02rh2NH1b9umlSUMj5BCbHZxBwzIGT0rMF67SxKuSpIqV8X91zr01sHmec LxUwLuNKA==; Received: from [2001:8b0:10b:1:4a2a:e3ff:fe14:8625] (helo=u3832b3a9db3152.ant.amazon.com) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hw6Ot-0007ih-57; Fri, 09 Aug 2019 15:01:51 +0000 Message-ID: <6dc2b63127f966961aeb2a7bfe89a5cdce83241b.camel@infradead.org> From: David Woodhouse To: xen-devel Date: Fri, 09 Aug 2019 16:01:49 +0100 In-Reply-To: References: X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Subject: [Xen-devel] [PATCH v2 2/6] 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: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau =?iso-8859-1?q?Monn=E9?= 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 d78bed394a..e3b42e3263 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -735,7 +735,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 7c6a2328d2..429a088b19 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -194,9 +194,6 @@ gdt_48: .word 6*8-1 .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 @@ -276,7 +273,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