From nobody Mon May 6 21:58:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1566222231; cv=none; d=zoho.com; s=zohoarc; b=meyoGZ3Qs1FWrqP6L/9+34doLQJvU64twOlhqbu8AJ/E5PiTDdD/Q9LNPXPkptUvlnVPC7YBBhfBFaS0RpgYv0hRTSV1c+j4PrfZMtEC5TWFBjb5rZoLqEaMso+DnQDdfuaWaOc9gmD/Cs+lMeuzRFbiwlkHQ5kKcHSCibafzmc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566222231; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gCbWU7818yDz4fQUSSYf6p5JfPVQtY4tFV/QiOg9BXM=; b=fvYnb7LEtTvY9G60O3heINy2EVHpKs0i3dpCwpR4nHFg43H8oG279wAioSiZ9sASjxFuZnCG7F6CWptMpEwYz/7NOBAuXa+LuSIGXz8+spEF04qKhzVOtEusbFplNQ1KnKYNsLp8M9v29ZPHP1cmQqZhSsP7zgG/ptIp7N7q8vU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1566222231015703.0963171206437; Mon, 19 Aug 2019 06:43:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hzhvR-0003AG-Su; Mon, 19 Aug 2019 13:42:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hzhvQ-0003A5-SP for xen-devel@lists.xenproject.org; Mon, 19 Aug 2019 13:42:20 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2a15e76c-c287-11e9-813a-bc764e2007e4; Mon, 19 Aug 2019 13:42:19 +0000 (UTC) X-Inumbo-ID: 2a15e76c-c287-11e9-813a-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566222140; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Vu9nOOVl9GhXutvla9P9PoIt01N5H2blZq19ocdshdQ=; b=FIEWY7UpkdKHn4mNcMhrvJ7vwGXw5800M94IIaszVGnDqsltibIHIB1M EEEGPWH81zjU3PbkbZIC2Xrd3XsnQI2xsNh3w2xzf7KUoTt9Q1hS0Ar5u bbty+goWzDO3kSl1p81q13UcfwBfX29zrNujw0iDYiBgFSVGGorNuaaBI I=; Authentication-Results: esa3.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 (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.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=esa3.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 ~all" Received-SPF: None (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: /HcgtG2hR/nAgeErSysqZLpM+kM8qcVSt2gf9e9ULH738FFNhraSwPi62m+jVG2noQ1mDNvpen YlswW1oAfci72oPwJoRxV1bvDzRb1BtCragn+8YTHIO3DYoaB2BR02tz/0agnJXIzeZA9KLpfw yO84cmApBm4lDppNL3wcB+RNvlU8H1KyYkGoxFjhP0RdHLh0jSsGXxFTuTW5UB+wYubApTkoZt 7gkCRNHANl+PkUPxmyBNQ8RpLeOSHLXj5ODNd0FYo1U7x2rOj+otqdb3sn0/A6UDwZ44cZAajC WvA= X-SBRS: 2.7 X-MesageID: 4439579 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,405,1559534400"; d="scan'208";a="4439579" From: Andrew Cooper To: Xen-devel Date: Mon, 19 Aug 2019 14:42:13 +0100 Message-ID: <20190819134213.1628-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190819134213.1628-1-andrew.cooper3@citrix.com> References: <20190819134213.1628-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/boot: Drop all use of lmsw 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=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) lmsw is an obsolete relic of the 286 processor - so much so that it even la= cks intercept assistance on AMD processors. Use a plain mov to %cr0 which is easier to follow, certainly faster to virtualise on AMD hardware, and almost certainly a faster microcode path in real hardware. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/boot/trampoline.S | 12 ++++++------ xen/arch/x86/boot/wakeup.S | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index 1b11b4757a..89f841331d 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -54,9 +54,10 @@ GLOBAL(trampoline_realmode_entry) lidt bootsym(idt_48) lgdt bootsym(gdt_48) mov $1,%bl # EBX !=3D 0 indicates we are an= AP - xor %ax, %ax - inc %ax - lmsw %ax # CR0.PE =3D 1 (enter protected = mode) + + mov $X86_CR0_PE, %eax + mov %eax, %cr0 + ljmpl $BOOT_CS32,$bootsym_rel(trampoline_protmode_entry,6) =20 .code32 @@ -252,9 +253,8 @@ trampoline_boot_cpu_entry: lgdt bootsym(gdt_48) =20 /* Enter protected mode, and flush insn queue. */ - xor %ax,%ax - inc %ax - lmsw %ax # CR0.PE =3D 1 (enter protected = mode) + mov $X86_CR0_PE, %eax + mov %eax, %cr0 =20 /* Load proper protected-mode values into all segment registers. */ ljmpl $BOOT_CS32,$bootsym_rel(1f,6) diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S index e3cb9e033a..2af6c6017c 100644 --- a/xen/arch/x86/boot/wakeup.S +++ b/xen/arch/x86/boot/wakeup.S @@ -51,8 +51,9 @@ ENTRY(wakeup_start) lidt wakesym(idt_48) lgdt wakesym(gdt_48) =20 - movw $1, %ax - lmsw %ax # Turn on CR0.PE=20 + mov $X86_CR0_PE, %eax + mov %eax, %cr0 + ljmpl $BOOT_CS32, $bootsym_rel(wakeup_32, 6) =20 /* This code uses an extended set of video mode numbers. These include: --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel