From patchwork Wed May 1 11:17:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 10924953 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 689FA1398 for ; Wed, 1 May 2019 11:18:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DABD28A93 for ; Wed, 1 May 2019 11:18:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4132028DEA; Wed, 1 May 2019 11:18:49 +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 B8FD728A93 for ; Wed, 1 May 2019 11:18:47 +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 1hLnEf-0001SB-KN; Wed, 01 May 2019 11:17:13 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLnEe-0001RU-OS for xen-devel@lists.xenproject.org; Wed, 01 May 2019 11:17:12 +0000 X-Inumbo-ID: a8adaa12-6c02-11e9-843c-bc764e045a96 Received: from merlin.infradead.org (unknown [2001:8b0:10b:1231::1]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a8adaa12-6c02-11e9-843c-bc764e045a96; Wed, 01 May 2019 11:17:10 +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=j/oWfHnrgmtRhtW+dnbvcIGOB Hg6uDBqhv93KfYZs2LlL1mrSdKV0LgRNpMGF9M7pYS4zK/D8vLLCOoq3z2ywd8iOT59dK+KyBTSRT 6sP4OMfVNEz9Nor64d/9sAsCNjKIZIlYQwr4h7fNsRTQSI/F/1l5abJYFFNdUZPrX7hrHeF4G4N1I WRSfghKKs0MHgbLvoaSbiGjvRyffDFAsB4k1crD+DxARd8VDQ1E/GvzOAQupA63avbbcWKKpro2Uz FXB3A1YTRB+8/795uRPitycCIwxw055gFP51zLXBz3/3FiRpcmd60dRN8Fsmt5LFk0VrOR1bg9+uI M8KQ5ZRJA==; 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 1hLnEZ-0008RO-25; Wed, 01 May 2019 11:17:07 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hLnEY-0030ML-5l; Wed, 01 May 2019 12:17:06 +0100 From: David Woodhouse To: dwmw2@infradead.org, xen-devel@lists.xenproject.org Date: Wed, 1 May 2019 12:17:02 +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 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