From nobody Sun May 5 07:46:11 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=1566222232; cv=none; d=zoho.com; s=zohoarc; b=bO1RKzscWplgRajoydGbdc9hYhANBWtnCbtVK60zUtjCE3lnOrOjwL/OZ/ufrPQI4N6zZdY9p892C9sICv7H+hGtU/5FuDoWy6UPhqdQlRJzgPmuhZmtl2doCOR73BYKN547I6LiGfJBGKj6ftYSDYnXGSs5W0P7pZq23CaXCN8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566222232; 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=lRpYJkhDRnyauxvkd9f0R3UcQfliphqVFatC9HCxSDg=; b=LC/fjCUIYm7p++a52U212U6iL1bKSBd2DqWOeFwE+6aPdKNKDDVAraj8S5cMNnolyUtcEukMOABXqk4YdTmPhaktCWSyCzQlnOfrmV/gGABBniegpqTJHHCHQI0RZW1OuJs2ndLdEWHAB6DYOHWO5ydkpwqKzUswSP9Epa4GW/o= 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 1566222232317267.92798638017325; Mon, 19 Aug 2019 06:43:52 -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 1hzhvV-0003Aq-8g; Mon, 19 Aug 2019 13:42:25 +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 1hzhvT-0003AW-GA for xen-devel@lists.xenproject.org; Mon, 19 Aug 2019 13:42:23 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2c04cf8e-c287-11e9-8bec-12813bfff9fa; Mon, 19 Aug 2019 13:42:22 +0000 (UTC) X-Inumbo-ID: 2c04cf8e-c287-11e9-8bec-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566222142; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vHf8WaA711QFLxi+iXstlQC4sWgRb6VLmwye9eit8v8=; b=gYO1ddxFe+J2i/OnngIA1Dd0eBsUPKWs9telCBUDJglh8c4MDncaa0Gk CmXmnD9aUJOL65h/BFsAkEW4bk2yGI/kKOZzsaT3FcjlzyxDK+RnwA+M8 UAwacNc0pOD9rKzCsrsw0I6Q0BTQHnb8YQbCoxZUXNtVywY1SbRPLQ9jk Y=; Authentication-Results: esa2.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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.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=esa2.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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: bRlLJZiyo1MEWkugwWCgAiNHvp53aH6tFEQRsB+qyivZrPQBODJ6eZ25exxL8XqABWUDTmGHn6 cxX4GNKLuh5P0QZN5GOdSDqsXF+tCZ3t4mJgy0dG64ojLbC3MNRB8agcyc/77hUkKIJG8U/24N Y0KSZYZedZJdTh99Ps+Bler48GnNHGnN4iW/dvAVR5RVXjiAkoVJvKAQr5c8PewDqe94S6Yypl zqwszHC8wwux9wEosnge5ZyAEEIPPYIieuhlKUs6zo7aCiWCFlXiHilVh3WFad7qOgggJmwL+X rHc= X-SBRS: 2.7 X-MesageID: 4422955 X-Ironport-Server: esa2.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="4422955" From: Andrew Cooper To: Xen-devel Date: Mon, 19 Aug 2019 14:42:11 +0100 Message-ID: <20190819134213.1628-2-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: Further minor GDT corrections 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) gdt_boot_descr and gdt_48 disagree on how long trampoline_gdt is. Introduce an end label and have the linker calculate the size, rather than hard coding it. Also, just as with c/s af292b41e9, there is no point forcing the CPU to set Access bits. Fix all remaining GDTs in Xen. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 The trampoline GDT access bits were actually noticed when trying to clean up our boot time pagetables and map the trampoline read-only. --- xen/arch/x86/boot/head.S | 2 +- xen/arch/x86/boot/trampoline.S | 15 ++++++++------- xen/arch/x86/x86_64/kexec_reloc.S | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 26b680521d..9fdb9b3954 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -129,7 +129,7 @@ multiboot2_header: =20 .word 0 gdt_boot_descr: - .word 7*8-1 + .word .Ltramopline_gdt_end - trampoline_gdt - 1 gdt_boot_base: .long sym_offs(trampoline_gdt) .long 0 /* Needed for 64-bit lgdt */ diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index 7c6a2328d2..1761fc1213 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -63,22 +63,23 @@ trampoline_gdt: /* 0x0000: unused */ .quad 0x0000000000000000 /* 0x0008: ring 0 code, 32-bit mode */ - .quad 0x00cf9a000000ffff + .quad 0x00cf9b000000ffff /* 0x0010: ring 0 code, 64-bit mode */ - .quad 0x00af9a000000ffff + .quad 0x00af9b000000ffff /* 0x0018: ring 0 data */ - .quad 0x00cf92000000ffff + .quad 0x00cf93000000ffff /* 0x0020: real-mode code @ BOOT_TRAMPOLINE */ .long 0x0000ffff - .long 0x00009a00 + .long 0x00009b00 /* 0x0028: real-mode data @ BOOT_TRAMPOLINE */ .long 0x0000ffff - .long 0x00009200 + .long 0x00009300 /* * 0x0030: ring 0 Xen data, 16 MiB size, base * address is computed at runtime. */ - .quad 0x00c0920000000fff + .quad 0x00c0930000000fff +.Ltramopline_gdt_end: =20 .pushsection .trampoline_rel, "a" .long trampoline_gdt + BOOT_PSEUDORM_CS + 2 - . @@ -182,7 +183,7 @@ start64: .word 0 idt_48: .word 0, 0, 0 # base =3D limit =3D 0 .word 0 -gdt_48: .word 6*8-1 +gdt_48: .word .Ltramopline_gdt_end - trampoline_gdt - 1 .long bootsym_rel(trampoline_gdt,4) =20 /* The first page of trampoline is permanent, the rest boot-time only. */ diff --git a/xen/arch/x86/x86_64/kexec_reloc.S b/xen/arch/x86/x86_64/kexec_= reloc.S index 5bf61d5c2d..9e5b7a6ba1 100644 --- a/xen/arch/x86/x86_64/kexec_reloc.S +++ b/xen/arch/x86/x86_64/kexec_reloc.S @@ -182,8 +182,8 @@ compat_mode_gdt_desc: .align 8 compat_mode_gdt: .quad 0x0000000000000000 /* null = */ - .quad 0x00cf92000000ffff /* 0x0008 ring 0 data = */ - .quad 0x00cf9a000000ffff /* 0x0010 ring 0 code, compatibility = */ + .quad 0x00cf93000000ffff /* 0x0008 ring 0 data = */ + .quad 0x00cf9b000000ffff /* 0x0010 ring 0 code, compatibility = */ =20 compat_mode_idt: .word 0 /* limit */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel