From nobody Fri Apr 19 02:06:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578598423; cv=none; d=zohomail.com; s=zohoarc; b=jtn1UJZjPuGzf7PQ/8FvuWNLd1XEhsFxwkcTg7kc4HVSqNa+/4tY9guwTUr5pAI5sUFAl+BOBiJicxsf1T+NYk+6l5fx7r6BTQMXmzxymI0qnuiryEUjaCXX2RosoqbIYQJxeIOzHN9DewRvxYpJWiBjz5k1obQpFT9Kw1FD8ZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578598423; 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; bh=e5WvZwFmTMF9d9hQPqQVc/J2wVIojMrUj3yyTLtmATY=; b=au/eQgvnSe9mGBE8Dk8UCdOOpGSMM01fS04nR2sfbvfUKydDBWQSo2t2Chog8P+4ZujiZur02gyIh08by9JobfGHFcIZkyXDErAEy73H40+57JexfDTjAUk64jCitHCKq2+2jNgLOWtWpt9fNeiYnoYjMWnW7fK3FV6NvKlEKbs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157859842376058.37724706450865; Thu, 9 Jan 2020 11:33:43 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdY8-0001tS-GW; Thu, 09 Jan 2020 19:32:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdY6-0001tK-WA for xen-devel@lists.xenproject.org; Thu, 09 Jan 2020 19:32:55 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cfa896f2-3316-11ea-b89f-bc764e2007e4; Thu, 09 Jan 2020 19:32:45 +0000 (UTC) X-Inumbo-ID: cfa896f2-3316-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578598365; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hUi8J02cOpp0rL71GTi5ko5+lGG5WbzAwabxwfIwRJw=; b=PXvvKuXYO+SEF30lDsKbzMbJpyrjjPphnP7t2YTge5IYVqMXLYW/Z9Bp pKVqUefYOEjYuo3Roa975pAG27oMD+h9pXONF9e+36TquYHyGNWE7iRw6 CFLp2yjU/U52zf8sgnSYLNP84VrnL+MXibW9PQ0HBeTWNq2SHYUjLdej7 8=; Authentication-Results: esa6.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 (zohomail.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 9rtjaZn9sY5A1WTzTACuuQT0YOOzfDwr07casTkzdI067KrWPDqWFf3yRRBBO72RGkRGd/PPiY vF2JeYpudL4BgnP/vbil7ZQlKHYhvrYDBym8Nq5Z0KKffyNsXIOhi3hFttAe6lnjW6+qP4xSGN RcXynoBpIfp4nScnQkrhhSIfs9Lw3qn/j+kLWsDZyORKwuIkoENeGIHN+cU+YXyVa/QUZ8xsx8 1wMCdsWt38ieR33iO/ZVf3udeM9Aqzr6zJdEFRABs5t/JhKeaIJfqyB3HAPcsuLt3obTOCIFRk GVI= X-SBRS: 2.7 X-MesageID: 11138289 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,414,1571716800"; d="scan'208";a="11138289" From: Andrew Cooper To: Xen-devel Date: Thu, 9 Jan 2020 19:32:38 +0000 Message-ID: <20200109193241.14542-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109193241.14542-1-andrew.cooper3@citrix.com> References: <20200109193241.14542-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 1/4] x86/boot: Remove the preconstructed low 16M superpage mappings 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) These are left over from c/s b2804422 "x86: make Xen early boot code relocatable", which made it possible for Xen not to be in the bottom 16M. Nothing using the mappings any more. Build them in the directmap when walk= ing the E820 table along with everything else. Furthermore, it is undefined to have superpages and MTRRs disagree on cacheability boundaries, and nothing actually checks. While we don't fix t= his explicitly, we do at least honour the E820 now if it says there are boundar= ies in this range. As a consequence, there are now no _PAGE_PRESENT entries between __page_tables_{start,end} which need to skip relocation. This simplifies t= he MB1/2 entry path logic to remove the l2_identmap[] special case. The low 2M (using 4k pages) is retained for now. Amongst other things, it matters for console logging while the legacy VGA hole is in use. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 v2: * Update commit message to explain what the low 16M used to be used for * Add PREBUILT_MAP_LIMIT --- xen/arch/x86/boot/head.S | 10 ++-------- xen/arch/x86/boot/x86_64.S | 17 ++++++----------- xen/arch/x86/setup.c | 13 ++++++++----- xen/arch/x86/x86_64/asm-offsets.c | 3 --- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 250587fdf0..d152af4542 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -661,15 +661,9 @@ trampoline_setup: mov %eax,sym_fs(boot_tsc_stamp) mov %edx,sym_fs(boot_tsc_stamp)+4 =20 - /* - * Update frame addresses in page tables excluding l2_identmap - * without its first entry which points to l1_identmap. - */ + /* Relocate pagetables to point at Xen's current location in memor= y. */ mov $((__page_tables_end-__page_tables_start)/8),%ecx - mov $(((l2_identmap-__page_tables_start)/8)+1),%edx -1: cmp $((l2_identmap+l2_identmap_sizeof-__page_tables_start)/8),= %ecx - cmove %edx,%ecx - testl $_PAGE_PRESENT,sym_fs(__page_tables_start)-8(,%ecx,8) +1: testl $_PAGE_PRESENT,sym_fs(__page_tables_start)-8(,%ecx,8) jz 2f add %esi,sym_fs(__page_tables_start)-8(,%ecx,8) 2: loop 1b diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index 0acf5e860c..de555f87f4 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -65,24 +65,19 @@ l1_identmap: .size l1_identmap, . - l1_identmap =20 /* - * __page_tables_start does not cover l1_identmap because it (l1_identmap) - * contains 1-1 mappings. This means that frame addresses of these mappings - * are static and should not be updated at runtime. + * __page_tables_{start,end} cover the range of pagetables which need + * relocating as Xen moves around physical memory. i.e. each sym_offs() + * reference to a different pagetable in the Xen image. */ GLOBAL(__page_tables_start) =20 /* - * Space for mapping the first 4GB of memory, with the first 16 megabytes - * actualy mapped (mostly using superpages). Uses 4x 4k pages. + * Space for 4G worth of 2M mappings, first 2M actually mapped via + * l1_identmap[]. Uses 4x 4k pages. */ GLOBAL(l2_identmap) .quad sym_offs(l1_identmap) + __PAGE_HYPERVISOR - idx =3D 1 - .rept 7 - .quad (idx << L2_PAGETABLE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE - idx =3D idx + 1 - .endr - .fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0 + .fill 4 * L2_PAGETABLE_ENTRIES - 1, 8, 0 .size l2_identmap, . - l2_identmap =20 /* diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index ed54f79fea..62adc9e2a8 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -678,6 +678,9 @@ static unsigned int __init copy_bios_e820(struct e820en= try *map, unsigned int li return n; } =20 +/* How much of the directmap is prebuilt at compile time. */ +#define PREBUILT_MAP_LIMIT (1 << L2_PAGETABLE_SHIFT) + void __init noreturn __start_xen(unsigned long mbi_p) { char *memmap_type =3D NULL; @@ -1020,7 +1023,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) * * We require superpage alignment because the boot allocator is * not yet initialised. Hence we can only map superpages in the - * address range BOOTSTRAP_MAP_BASE to 4GB, as this is guaranteed + * address range PREBUILT_MAP_LIMIT to 4GB, as this is guaranteed * not to require dynamic allocation of pagetables. * * As well as mapping superpages in that range, in preparation for @@ -1036,10 +1039,10 @@ void __init noreturn __start_xen(unsigned long mbi_= p) if ( boot_e820.map[i].type !=3D E820_RAM ) continue; =20 - /* Superpage-aligned chunks from BOOTSTRAP_MAP_BASE. */ + /* Superpage-aligned chunks from PREBUILT_MAP_LIMIT. */ s =3D (boot_e820.map[i].addr + mask) & ~mask; e =3D (boot_e820.map[i].addr + boot_e820.map[i].size) & ~mask; - s =3D max_t(uint64_t, s, BOOTSTRAP_MAP_BASE); + s =3D max_t(uint64_t, s, PREBUILT_MAP_LIMIT); if ( s >=3D e ) continue; =20 @@ -1346,8 +1349,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) =20 set_pdx_range(s >> PAGE_SHIFT, e >> PAGE_SHIFT); =20 - /* Need to create mappings above BOOTSTRAP_MAP_BASE. */ - map_s =3D max_t(uint64_t, s, BOOTSTRAP_MAP_BASE); + /* Need to create mappings above PREBUILT_MAP_LIMIT. */ + map_s =3D max_t(uint64_t, s, PREBUILT_MAP_LIMIT); map_e =3D min_t(uint64_t, e, ARRAY_SIZE(l2_identmap) << L2_PAGETABLE_SHIFT); =20 diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-of= fsets.c index f9cb78cfdb..07d2155bf5 100644 --- a/xen/arch/x86/x86_64/asm-offsets.c +++ b/xen/arch/x86/x86_64/asm-offsets.c @@ -165,8 +165,5 @@ void __dummy__(void) OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer); BLANK(); =20 - DEFINE(l2_identmap_sizeof, sizeof(l2_identmap)); - BLANK(); - OFFSET(DOMAIN_vm_assist, struct domain, vm_assist); } --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri Apr 19 02:06:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578598429; cv=none; d=zohomail.com; s=zohoarc; b=ZjcrZ5zX2xLd2WyWXwBQYAVZmzQAcFo4l8QCL9EkFU06GcUx5/f4CwG8DSqiLPJNVWiMm8UTltthNjqQ+yvf+nvUbeNyYiz26KnYPzEy9oEFCgs91F66Xr2yUTN9Rcibn5biucMFWB0nuLVMyr8RaH6yX+Ci6sZrPmoRUIeA9wA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578598429; 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; bh=G2h3fmmzKLBQ2qGThdI1LY2/yVHtUGf5zqfcjRNOeOQ=; b=F+Z1N2BdoARiwTh2oAbqWTDsGax9p3XZqJh5gOzUrmrrdC8IjQ/5okQetpQzTsvBc2LcLQPUsz9YdD/E4XcRi63qGVwoENuoYkQ0pkC8JBV2HU8HsnV/a3XHlIzVg9mBZQkG1zw47ZIWhga/skPc56Fp276GwFHgD7D06k0zOJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157859842967968.28151343524837; Thu, 9 Jan 2020 11:33:49 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdYH-0001w5-9p; Thu, 09 Jan 2020 19:33:05 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdYG-0001vt-R1 for xen-devel@lists.xenproject.org; Thu, 09 Jan 2020 19:33:04 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d5386ad4-3316-11ea-b89f-bc764e2007e4; Thu, 09 Jan 2020 19:32:54 +0000 (UTC) X-Inumbo-ID: d5386ad4-3316-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578598374; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S0PnDIRPnnivkZtzB1RPCTwe6TcOz1Y0241PkWUJgLU=; b=ZOj5qAH0Dqw/2PbpP963aA1W+jtRClbs3EQjwRIwOvmn38DsanJAIOxh v4XcrTh7qhOSzVwV3ZVZYpseIpj5DCMe1ma9I+F5YMi52fpnELUx8oEti rR2NR4Tmj9qqRnIbDasRryVhIjxsgJwskg/0hqPuPfcUjX0BJokOQ0iDI w=; Authentication-Results: esa6.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 (zohomail.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: AFFgm29NDEXp+EmqkD7Dewug/IH2mIPbHS9RB/3yyT6dRa2DGobrfRFypdYu4I4CRUSaTZpVOw f8c7ko4NFbGwWX4EQD5hNUNKrwBN8HviP1aZA66s4TPLI70wAS1xMbWAnE+y2/D5ygqjsogyjW Qpvs4BYtiZUtnFnKzEquZPE59yBcCsL+BkXEpHdLQKZIWWzK8/90Mfr7D+DfQIWKdLpu2cVeDL IP+osGtpvOd/QNcJusTUQoE8OPXyv14O67pD1EYxPKWXWTLRw30aykJ/NKpo6HQf3M9Pk+Ki5a lyk= X-SBRS: 2.7 X-MesageID: 11138290 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,414,1571716800"; d="scan'208";a="11138290" From: Andrew Cooper To: Xen-devel Date: Thu, 9 Jan 2020 19:32:39 +0000 Message-ID: <20200109193241.14542-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109193241.14542-1-andrew.cooper3@citrix.com> References: <20200109193241.14542-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 2/4] x86/boot: Clean up l?_bootmap[] construction 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) The need for Xen to be identity mapped into the bootmap is not obvious, and differs between the MB and EFI boot paths. The EFI side is further complicated by an attempt to cope with with l2_boot= map only being 4k long. This is undocumented, confusing, only works if Xen is = the single object wanting mapping. The pageables are common to both the MB and EFI builds, so simplify the EFI bootmap construction code to make exactly one identity-map of Xen, which now makes the two paths consistent. Comment both pieces of logic, explaining w= hat the mappings are needed for. Finally, leave a linker assert covering the fact that plenty of code blindly assumes that Xen is less that 16M. This wants fixing in due course. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 v2: * Extra BUILD_BUG_ON()'s --- xen/arch/x86/boot/head.S | 8 ++++++-- xen/arch/x86/efi/efi-boot.h | 20 +++++++++++++------- xen/arch/x86/xen.lds.S | 3 +++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index d152af4542..0b75d33a25 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -668,7 +668,11 @@ trampoline_setup: add %esi,sym_fs(__page_tables_start)-8(,%ecx,8) 2: loop 1b =20 - /* Initialize L2 boot-map/direct map page table entries (16MB). */ + /* + * Map Xen into the directmap (needed for early-boot pagetable + * handling/walking), and identity map Xen into bootmap (needed for + * the transition into long mode), using 2M superpages. + */ lea sym_esi(start),%ebx lea (1<> L2_PAGETABLE_SHIFT) + i; paddr_t addr =3D slot << L2_PAGETABLE_SHIFT; =20 l2_identmap[slot] =3D l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_P= SE); - slot &=3D L2_PAGETABLE_ENTRIES - 1; l2_bootmap[slot] =3D l2e_from_paddr(addr, __PAGE_HYPERVISOR|_PAGE_= PSE); } - /* Initialise L3 boot-map page directory entries. */ - l3_bootmap[l3_table_offset(xen_phys_start)] =3D - l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR); - l3_bootmap[l3_table_offset(xen_phys_start + (8 << L2_PAGETABLE_SHIFT) = - 1)] =3D - l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR); } =20 static void __init efi_arch_handle_module(struct file *file, const CHAR16 = *name, diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 111edb5360..7f82f64078 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -381,3 +381,6 @@ ASSERT((trampoline_end - trampoline_start) < TRAMPOLINE= _SPACE - MBI_SPACE_MIN, "not enough room for trampoline and mbi data") ASSERT((wakeup_stack - wakeup_stack_start) >=3D WAKEUP_STACK_MIN, "wakeup stack too small") + +/* Plenty of boot code assumes that Xen isn't larger than 16M. */ +ASSERT(_end - _start <=3D MB(16), "Xen too large for early-boot assumption= s") --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri Apr 19 02:06:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578598428; cv=none; d=zohomail.com; s=zohoarc; b=NDoYX/CxyDKAgZZ9ZuKMTftrLOAlLS77kFEyr4gp1qHTdET1AHTrJhyta3eRnEscWZR1juj2G1EIJJMykuQsxU5KYsi/S4Az68ay8poZjbjEtzlXqx+KtPhkL5nwMXso1GH5oVcQ9eoyZNESQ7TX43ljzd9igLu07oMf+hkwBW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578598428; 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; bh=vEbjDE4MLPbEEsVxl4HXxMo+f56cntABlNkDxPwSBJ0=; b=SCVAjsW1if4QYEgPDf/enGX9lZsIG/mVufqVhP+bZpPDbuwrYadqpuUd7EG3mX/YnqWwll60UD1IitFlEn8/TlQGD+OwjUcuMLk3qiQQPgmP7stlBoz+8U1yymFHzH5BXYfY7VBFZgjYxgc1cAp5tm1SHDG144wJq9FlKSMI/8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578598428252298.00465784055984; Thu, 9 Jan 2020 11:33:48 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdYD-0001uB-Qd; Thu, 09 Jan 2020 19:33:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdYB-0001ti-Ry for xen-devel@lists.xenproject.org; Thu, 09 Jan 2020 19:32:59 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d049c2e8-3316-11ea-ac27-bc764e2007e4; Thu, 09 Jan 2020 19:32:47 +0000 (UTC) X-Inumbo-ID: d049c2e8-3316-11ea-ac27-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578598366; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TUgSJcvrtirnKoh5NZO7xoERz9S6nXrtyBnu1JNNQyo=; b=iX1Pz4q/Fag89XoA1aIp9djJZZZx+/2HkhLS4/kMuCmawf36PR4ZesiK 0WtexTTsYsRcdX665occOdi9HbzidIjYHetjjjkVVW2w8X9Xg2PjjFCOY dqrQi3/xkuQJ5aTj81m/sN66waJ/vhJ9D+V1IiltlIe9biysSsJPdV0YC E=; Authentication-Results: esa5.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 (zohomail.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 9g+cp44T7LVkWnkx5tocdIhT2jPVosjMB+R3gL3eoKSvuzcZngER5UjV1DeN27ePwq35z2CPp3 95sB/zqzNBZuscktsviwDqGUSXMvbupZjScxTDzcJLKq9Tn50ObDCDaHGXDeXQwzm57oR8RDcR 0GKD2Q16z35nfuZGsS9UTgFvTSHqiy6gDi17CMxugkx/d56/xp6YYVK+bInEI+duoy+PbhGdTC tt8DGektGI4eU3Ufzm84H4k5ns2InnLXsDTBRgUkZoNXVtU5H86X/MIXzDiStZSk1a+FnTRERv aEE= X-SBRS: 2.7 X-MesageID: 11081780 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,414,1571716800"; d="scan'208";a="11081780" From: Andrew Cooper To: Xen-devel Date: Thu, 9 Jan 2020 19:32:40 +0000 Message-ID: <20200109193241.14542-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109193241.14542-1-andrew.cooper3@citrix.com> References: <20200109193241.14542-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 3/4] x86/boot: Don't map 0 during 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 , =?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) In particular, it causes accidental NULL pointer dereferences to go unnotic= ed. The majority of the early operation takes place either in Real mode, or Protected Unpaged mode. The only bit which requires pagetable mappings is = the trampoline transition into Long mode and jump to the higher mappings, so th= ere is no need for the whole bottom 2M to be mapped. Introduce a new l1_bootmap in .init.data, and use it instead of l1_identmap. The EFI boot path doesn't pass through the trampoline, so doesn't need any adjustment. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/boot/head.S | 14 ++++++++------ xen/arch/x86/boot/x86_64.S | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 0b75d33a25..d246e374f1 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -689,12 +689,14 @@ trampoline_setup: sub $(L2_PAGETABLE_ENTRIES*8),%eax loop 1b =20 - /* - * During boot, hook 4kB mappings of first 2MB of memory into L2. - * This avoids mixing cachability for the legacy VGA region. - */ - lea __PAGE_HYPERVISOR+sym_esi(l1_identmap),%edi - mov %edi,sym_fs(l2_bootmap) + /* Map the permanent trampoline page into l{1,2}_bootmap[]. */ + mov sym_esi(trampoline_phys), %ecx + lea __PAGE_HYPERVISOR_RX(%ecx), %edx /* %edx =3D PTE to write = */ + shr $PAGE_SHIFT, %ecx /* %ecx =3D Slot to write= */ + mov %edx, sym_offs(l1_bootmap)(%esi, %ecx, 8) + + lea __PAGE_HYPERVISOR + sym_esi(l1_bootmap), %edx + mov %edx, sym_esi(l2_bootmap) =20 /* Apply relocations to bootstrap trampoline. */ mov sym_fs(trampoline_phys),%edx diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index de555f87f4..af62850589 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -155,6 +155,10 @@ GLOBAL(__page_tables_end) .section .init.data, "aw", @progbits .align PAGE_SIZE, 0 =20 +l1_bootmap: + .fill L1_PAGETABLE_ENTRIES, 8, 0 + .size l1_bootmap, . - l1_bootmap + GLOBAL(l2_bootmap) .fill 4 * L2_PAGETABLE_ENTRIES, 8, 0 .size l2_bootmap, . - l2_bootmap --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri Apr 19 02:06:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578598427; cv=none; d=zohomail.com; s=zohoarc; b=eYIJsDMgntQ5Pv2jZUWtwjMHn/G1o+xTDsFtRXYVMfqs5nTAaSTemswthvYOljrUZd6/VPSqsrh6VnLKgxS9+xPwkpm9vmmyngbKWB/l4SoCsp8DDrNNm/8oXaihP+v9AfnYq+BptT3OkdQJAo75aOVlFQBdcwz/TsBW8TV9hwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578598427; 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; bh=ky+DSEjBgZaGG0db3p6/qpywYSDO+rIo7LTcoD6QXzk=; b=PclDwOmnqqPvHXcK9EyPUh15dqR2lPwOrZhdscvDa3yUg4mzmzFbRi24lwIBcTe63LwwEAMdHJH4pHYwL2SrqkAxuaT69Z2wtc2EEcAitpQbxZo/NsZuDG6xuJDG5SGA4uh0oFNN63d8SJseH1o4c2MJvkCl5HZ8ifnxndzGv/w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578598427040223.75591122127412; Thu, 9 Jan 2020 11:33:47 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdY6-0001tC-6x; Thu, 09 Jan 2020 19:32:54 +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 1ipdY4-0001t6-SV for xen-devel@lists.xenproject.org; Thu, 09 Jan 2020 19:32:52 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d33f5581-3316-11ea-ba61-12813bfff9fa; Thu, 09 Jan 2020 19:32:52 +0000 (UTC) X-Inumbo-ID: d33f5581-3316-11ea-ba61-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578598372; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4T2bHZMNtQ/+mkzwSgBiDf/wC0cM6a9T4871J62jmJM=; b=CaPDE3Xd7ZBmFrU5g8ZLa3SqZriVJ7a8yDNQgGIFR1sBX1NovRgFnoPf 6Mko3tA6vpy1Ah4h4PiNPOdaahm7XllHsGlq8RFx3iqGpNeef5nur8S2I S3c5dqSdMc5tlT3sOZWeC4mK2eiBO0Iho2658+7X5IJbvH7XpoucCi4JV I=; Authentication-Results: esa4.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 (zohomail.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ea7VDE+wFYXXqEa5FDWMLxDjTSGYJp7E+faaqdfH+Mi/2H8g7vvlPXB71YT90GgkuEFK/sL+YU w1A9WNafERv03ERYGuO2EEnHRSPd1dw8jk04Hhe3Ecoi7IPsnXWRL/nTrH0SPiPvG462YpTxM3 AiZa1+BdSD/Ngs3e7UIZNXdaX006GIwPoTHh/pdcymJpTDg1yJL/zLDdgqWvujHTd7eztGtRzR 799vfT/dRdk7VCHoDAyhUmqL9omRU3CmBbjxVQhQR0T2ibLesOwPG+ULPtjkuSvMuQKRwq3zB+ 1+g= X-SBRS: 2.7 X-MesageID: 11295601 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,414,1571716800"; d="scan'208";a="11295601" From: Andrew Cooper To: Xen-devel Date: Thu, 9 Jan 2020 19:32:41 +0000 Message-ID: <20200109193241.14542-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109193241.14542-1-andrew.cooper3@citrix.com> References: <20200109193241.14542-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 4/4] x86/boot: Drop INVALID_VCPU 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) Now that NULL will fault at boot, there is no need for a special constant to signify "current not set up yet". Since c/s fae249d23413 "x86/boot: Rationalise stack handling during early boot", the BSP cpu_info block is now consistently zero, so drop the adjacent re-zeroing. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 v2: * Drop re-zeroign of the cpu_info block --- xen/arch/x86/cpu/mcheck/mce.c | 2 +- xen/arch/x86/domain_page.c | 2 +- xen/arch/x86/setup.c | 3 --- xen/arch/x86/tboot.c | 2 +- xen/include/asm-x86/setup.h | 3 --- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 29f3f9c5e3..198595ff97 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -260,7 +260,7 @@ static int mca_init_global(uint32_t flags, struct mcinf= o_global *mig) &mig->mc_coreid, &mig->mc_core_threadid, &mig->mc_apicid, NULL, NULL, NULL); =20 - if ( curr !=3D INVALID_VCPU ) + if ( curr ) { mig->mc_domid =3D curr->domain->domain_id; mig->mc_vcpuid =3D curr->vcpu_id; diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c index 4a07cfb18e..dd32712d2f 100644 --- a/xen/arch/x86/domain_page.c +++ b/xen/arch/x86/domain_page.c @@ -29,7 +29,7 @@ static inline struct vcpu *mapcache_current_vcpu(void) * When current isn't properly set up yet, this is equivalent to * running in an idle vCPU (callers must check for NULL). */ - if ( v =3D=3D INVALID_VCPU ) + if ( !v ) return NULL; =20 /* diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 62adc9e2a8..1b6ca4a47d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -707,9 +707,6 @@ void __init noreturn __start_xen(unsigned long mbi_p) =20 /* Critical region without IDT or TSS. Any fault is deadly! */ =20 - set_processor_id(0); - set_current(INVALID_VCPU); /* debug sanity. */ - idle_vcpu[0] =3D current; init_shadow_spec_ctrl_state(); =20 percpu_init_areas(); diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 3e828fe204..5020c4ad49 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -392,7 +392,7 @@ void tboot_shutdown(uint32_t shutdown_type) * During early boot, we can be called by panic before idle_vcpu[0] is * setup, but in that case we don't need to change page tables. */ - if ( idle_vcpu[0] !=3D INVALID_VCPU ) + if ( idle_vcpu[0] ) write_ptbase(idle_vcpu[0]); =20 ((void(*)(void))(unsigned long)g_tboot_shared->shutdown_entry)(); diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index 861d46d6ac..28257bc5c8 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -4,9 +4,6 @@ #include #include =20 -/* vCPU pointer used prior to there being a valid one around */ -#define INVALID_VCPU ((struct vcpu *)0xccccccccccccc000UL) - extern const char __2M_text_start[], __2M_text_end[]; extern const char __2M_rodata_start[], __2M_rodata_end[]; extern char __2M_init_start[], __2M_init_end[]; --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel