From patchwork Thu Jan 2 14:59:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11315909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAC4614B4 for ; Thu, 2 Jan 2020 15:01:27 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86F2B2072C for ; Thu, 2 Jan 2020 15:01:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="CWuktZJd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86F2B2072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1in1x9-0002LP-BL; Thu, 02 Jan 2020 14:59:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1in1x7-0002LD-DU for xen-devel@lists.xenproject.org; Thu, 02 Jan 2020 14:59:57 +0000 X-Inumbo-ID: 89baca9e-2d70-11ea-a37c-12813bfff9fa Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 89baca9e-2d70-11ea-a37c-12813bfff9fa; Thu, 02 Jan 2020 14:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1577977196; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sjRDIYOl9ceyQaNIJEpSnWE5i6UF/jphRt0RbeiWh+s=; b=CWuktZJdVGWTjoBSsQmM3VzY0AxerxdSlhmmMT9vB2ICmcdcnRa8jEkd SLHIkG1UJ8tHyPO8p8s0XYQfOV+pbJroayU3XQra0m+6+uzxzewR/VEm7 7SB9X0ONHLN6QQW9oiEvFFXrs3AI3SHs8BlseDyb7ohzHtN7gD94sLrYJ 8=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: HmXv9cAy0TPiQc8KcuIsL2vZu0EapoJhudXaSNIwNrQ43yUjM5Qoee3FdgSXpmHzqG4qozlAcN B83mnrhr3xSGItDH4WUmMEXkJBppHYeJj8AgDZHxiHKmjPhIkRLDwWE+prDSVYf8XrEZ933hXO Cr4IkwUnmD4LijGwVkLAIQvfQFgwtkQMAj4UE3I2+kKh5CiR97d1BZZcdbYtNigiW/0Gi8HNZ6 B3GykfCxR0BRUT2JgS9Rno2Ztckv0cg+Am8mw/fnylbcsuih7E3G63tA04iZOd+Ux2aoGMn3QX 5m4= X-SBRS: 2.7 X-MesageID: 10533696 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,387,1571716800"; d="scan'208";a="10533696" From: Andrew Cooper To: Xen-devel Date: Thu, 2 Jan 2020 14:59:53 +0000 Message-ID: <20200102145953.6503-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/boot: Clean up the trampoline transition into Long mode 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 , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The jmp after setting %cr0 is redundant with the following ljmp. The CPUID to protect the jump to higher mappings was inserted due to an abundance of caution/paranoia before Spectre was public. There is not a matching protection in the S3 resume path, and there is nothing interesting in memory at this point. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné --- xen/arch/x86/boot/trampoline.S | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index c60ebb3f00..574d1bd8f4 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -101,8 +101,6 @@ trampoline_protmode_entry: mov $(X86_CR0_PG | X86_CR0_AM | X86_CR0_WP | X86_CR0_NE |\ X86_CR0_ET | X86_CR0_MP | X86_CR0_PE), %eax mov %eax,%cr0 - jmp 1f -1: /* Now in compatibility mode. Long-jump into 64-bit mode. */ ljmp $BOOT_CS64,$bootsym_rel(start64,6) @@ -111,26 +109,6 @@ trampoline_protmode_entry: start64: /* Jump to high mappings. */ movabs $__high_start, %rdi - -#ifdef CONFIG_INDIRECT_THUNK - /* - * If booting virtualised, or hot-onlining a CPU, sibling threads can - * attempt Branch Target Injection against this jmp. - * - * We've got no usable stack so can't use a RETPOLINE thunk, and are - * further than disp32 from the high mappings so couldn't use - * JUMP_THUNK even if it was a non-RETPOLINE thunk. Furthermore, an - * LFENCE isn't necessarily safe to use at this point. - * - * As this isn't a hotpath, use a fully serialising event to reduce - * the speculation window as much as possible. %ebx needs preserving - * for __high_start. - */ - mov %ebx, %esi - cpuid - mov %esi, %ebx -#endif - jmpq *%rdi #include "video.h"