From nobody Sat Jun 13 07:29:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1781192024; cv=none; d=zohomail.com; s=zohoarc; b=UL97+KdA+zgOh8VTHuwSwz2FhIoCSaNoDYvYqBC7dfOo7FEv5cDPjJ1nni0m3T+6j1o5Jl/ncg+VU5Gs8oAKEfS4GRUSqINPT9SkISCNeBPyPXeH4bZbkc06KXiszrN5RBvfaiuBSH8xQgYVooJdG0RsyTW8rdn2PcbDat5qUrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781192024; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QxbC6GNVg+EvojTPZihdUDF+yieh851t4HFnrJpjWBU=; b=W8GgpQZ32u3+A+XFKUkSWuTbfVbJfJJ94UgZSM0v61KsJzot4P3by+VMPKCW2Oabd7kpROTUmNvIgn/twhKN+AiMoQb4yp2vlU61cBMW9KfA7jlcbxaI+Kt66Tqdc5aNnfvrq9M4w//+oUlRdfjmKwwQAdLdhgkIsAK+keV6c/Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1781192024222141.97325013902434; Thu, 11 Jun 2026 08:33:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1335795.1597965 (Exim 4.92) (envelope-from ) id 1wXhP9-0005cX-TR; Thu, 11 Jun 2026 15:33:15 +0000 Received: by outflank-mailman (output) from mailman id 1335795.1597965; Thu, 11 Jun 2026 15:33:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhP9-0005c9-Pd; Thu, 11 Jun 2026 15:33:15 +0000 Received: by outflank-mailman (input) for mailman id 1335795; Thu, 11 Jun 2026 15:33:14 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhP8-0005ZP-F9 for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 15:33:14 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wXhP7-0033ey-S9 for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 17:33:13 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a2ad52c-5cb7-0a2a0a5109dd-0a2a450bc8cc-22 for ; Thu, 11 Jun 2026 17:33:13 +0200 Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a2ad539-212f-0a2a450b0019-d1558036c01f-3 for ; Thu, 11 Jun 2026 17:33:13 +0200 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-490c1915793so59513575e9.2 for ; Thu, 11 Jun 2026 08:33:13 -0700 (PDT) Received: from localhost.localdomain (5.116.208.46.dyn.plus.net. [46.208.116.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f0a43e9sm80679900f8f.0.2026.06.11.08.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 08:33:12 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781191993; x=1781796793; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QxbC6GNVg+EvojTPZihdUDF+yieh851t4HFnrJpjWBU=; b=N+2nC5Q5Aoekbl6HPlhd27GyGi00CeI1XAZpSY/5p1ItF9NVvfvGCUDEMBMgDo2S3E vXuI/z3Y/AIob1ui7lXp8hNK0bqM7VZ1KtQh4wFHbkNly6XsT393XdDlLCyAvdDHvdXa nnFEGDAbAjOGTV92M2bvex/L6qgRDhE6nzOF7BUE78ONwtDvUH8gWDTTFQihsSMV3n20 s2KKW3Rp74S8jIrYwPOq1VklRE54Ubn4GKmDb4r/lAM1H9rwV8CTb6ltYbQeO65VUbnk wrZm32jerrjlU0tCAadeVx8Hbq0dufj4X3UM8ZyW/32STxzrL865wmv2B1B7uq/UhGme GQhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781191993; x=1781796793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QxbC6GNVg+EvojTPZihdUDF+yieh851t4HFnrJpjWBU=; b=cbJaXUA2DWACyngQYcBwWNxcE2M/W7u6eiETNptw/PSLwdlYoQ5TOY+lZIDVlQrvt9 OKY0e+AdDhItTcVP2q6u6qoXDLlZrRRraHRIj2kjanrzHxBVk+ex5z1tbBHymf/ucLvW YXNzc5K9tsj2DVqzb/UUeoORqqb2hoTXutwB9CsDkhSwj2qQJz37Sj+WWMKMRH9uYBra yoI1zgAnsIk6oWANEGH+8i6hEW6lcLGabskzKpDgYfNQfxHci8M2MLoQ+M1VZPVTbkiw rx4lzvPyPTZl5PDwRAu7/O6IvH77UUuSkoLU888cGS3IFS4z0s5xEOpoDkYeHN+Y8HsD 9Xug== X-Gm-Message-State: AOJu0YzaUh4pHe6qchvcaQixvJob/9vbN/bdjrM2YCi5IvIPaZpIdUu9 fFTPHln8RkK1QaLmbN5gKGU9s25/Ld11T0ILt0LsJAv5Y/8yl17XnQ4lIi9D1wJX9Mg= X-Gm-Gg: Acq92OHCixNf+qJIpLS9rnzk17HS+ZcNfrquImMplVazW05tJv8dWltGJDTW4AlgFjQ MqfQPfEcZ/I1h+GuRYsmsU0SGD7DWv/TeQwaA1lAFGl2M2inQUvcIkRarJ8iGonSmz7RusmEDHn spufA8RErDz4vqovfSEOy79HKj95okRRdKxDcMbyGe4bi7Cs4LH9dEqvIxUU4uw1k5uVsjyfM02 kUOTYlVNNIi7xXWGdWsrI0o19FYQSyAssQumyCE0wR7Rr/cez32u2X+RfwI5wVk+NlgctlRi8OH hcLMsuBnLCX45dYVC7R+JZ/kojlJuxgU7kCUbYke9CrBLsvk6IYHuAZ8PT0hrjl0+n3QCm2e2vM VLyFsagq+92c1RUdU6eVPFQogvt1Lx1SMYv/LcOWV5nX/BcndI1fQBbN8slROemkBeW5RcT77BK /bBq3yakLwDMGGLFi52giFMXBCPUsXIkQ9S8FRQDrlK6zA6bnCWjAAZJ25/Zx0iQ3+Svzr0N8Qe MxoUZoA5w8w0EL8JXZCS8A9YAE4WK2RLEww X-Received: by 2002:a05:600d:84ca:10b0:490:e1a6:4d13 with SMTP id 5b1f17b1804b1-490e55d842bmr31380305e9.15.1781191992979; Thu, 11 Jun 2026 08:33:12 -0700 (PDT) From: Frediano Ziglio X-Google-Original-From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Frediano Ziglio Subject: [PATCH v2 1/4] Align some sections to 4KB Date: Thu, 11 Jun 2026 16:32:54 +0100 Message-ID: <20260611153257.650054-2-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260611153257.650054-1-frediano.ziglio@cloud.com> References: <20260611153257.650054-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1781191993-19165F3B-878AA1AA/0/0 X-purgate-type: clean X-purgate-size: 1286 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1781192024803158500 Content-Type: text/plain; charset="utf-8" Required by UEFI CA memory mitigation. It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms in the pagetables. NX_COMPAT is a requirement from shim-review, https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-sh= im-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-= done-to-ensure-such-compatibility Signed-off-by: Frediano Ziglio -- Changes since v2: - Change subject. --- xen/arch/x86/xen.lds.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index b9e888e596..f758940674 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -162,8 +162,8 @@ SECTIONS __note_gnu_build_id_end =3D .; } PHDR(note) PHDR(text) #elif defined(BUILD_ID_EFI) - /* Workaround bug in binutils < 2.36 */ - . =3D ALIGN(32); + /* Align to satisfy UEFI CA memory mitigation. */ + . =3D ALIGN(PAGE_SIZE); DECL_SECTION(.buildid) { __note_gnu_build_id_start =3D .; *(.buildid) @@ -330,6 +330,7 @@ SECTIONS __2M_rwdata_end =3D ALIGN(SECTION_ALIGN); =20 #ifdef EFI + . =3D ALIGN(PAGE_SIZE); .reloc ALIGN(4) : { __base_relocs_start =3D .; *(.reloc) --=20 2.43.0 From nobody Sat Jun 13 07:29:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1781192022; cv=none; d=zohomail.com; s=zohoarc; b=lVAaXsnbPpTB6iiJOTDC8vW0xC18JS6Og/7Kf81xleAfvailzaBDDRryPKLvS4pilvj/6I2krpM6TE9FwVAKBGPhnIjB/h0wpBbiYqfytOXml/pUDpd4j17t5x+ZGXjZ7Wc0Tk0I1QIat/e9bsX4dOs1679Kf9trJQpN+OIVUWY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781192022; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sXGTQ7SY9zFCk1adwq1nZVphVofHiD/jgErtshVT0HE=; b=Qa2FKbYQBz/72yX6a6a6RalhjbUYwjBI9zDw0LMsKQepkjuWess3+p4IIzl0+gW7wEzpej2ZJUBmZFWX52BE2nkew9uXeANbOpWwhBuKUK70cOjsOBWDsdeRSV90keuVxN+rlryvd85B84VgaYbUk3LV9Mi0PWgFya1BvtyG5mY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1781192022727508.820706405329; Thu, 11 Jun 2026 08:33:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1335796.1597979 (Exim 4.92) (envelope-from ) id 1wXhPB-0005ze-8y; Thu, 11 Jun 2026 15:33:17 +0000 Received: by outflank-mailman (output) from mailman id 1335796.1597979; Thu, 11 Jun 2026 15:33:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhPB-0005zU-35; Thu, 11 Jun 2026 15:33:17 +0000 Received: by outflank-mailman (input) for mailman id 1335796; Thu, 11 Jun 2026 15:33:15 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhP9-0005ZV-7h for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 15:33:15 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wXhP8-0033fE-KS for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 17:33:14 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a2ad52d-e002-0a2a0a5209dd-0a2a4507bebe-30 for ; Thu, 11 Jun 2026 17:33:14 +0200 Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a2ad53a-229c-0a2a45070019-d155dd2aa95c-3 for ; Thu, 11 Jun 2026 17:33:14 +0200 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-45ee5cdbd28so714997f8f.1 for ; Thu, 11 Jun 2026 08:33:14 -0700 (PDT) Received: from localhost.localdomain (5.116.208.46.dyn.plus.net. [46.208.116.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f0a43e9sm80679900f8f.0.2026.06.11.08.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 08:33:13 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781191994; x=1781796794; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sXGTQ7SY9zFCk1adwq1nZVphVofHiD/jgErtshVT0HE=; b=TjgqiEk1GcvWpRhq7wNZUMseW9OONgV1uCWQl9w+v0yXE67TspBN2sB85rB+GyZqnT hRCNpvuJItwFz2hx52j2dSpSHv3Wt2B/F26rbrW2FKKNzD77tmkPMm3PlmH5qEEZkVr3 rwBIYAn5oZPLBAy8yUJtl5vWVkkfuSFzs8PVs+bvXVxtsG1/rOWWRo8Nsz372hTDhjA9 Phk828kRdCbWUnf5XS4VgN3+F6zscu83pfaOiOXzzH/6u0fKsOSLiamVKz8LhauOV8tW rpLdJvDmdjWf4HePx3dP7LY1Z2tt8lzWT4OIyFo60vUDqFWlevQo8tMrzeAPdkdbWiYs uJ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781191994; x=1781796794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sXGTQ7SY9zFCk1adwq1nZVphVofHiD/jgErtshVT0HE=; b=FuxVkiyh+s38bH/3PJD4tmnV7hJkjz1UPYjTxJPyiVDKvb/LZ6Wtbh8Ar6fRpxvGN9 R1Or/LMP3TOGEUtvbPrVhec3wS/7rifvWICP01rb+ePhO/tcKTLB2oBAFSQWNCfPMTl8 v74MTVNiIphjA2Y0YB4DwAvH66eKfrFHfDGHdaccO3okusUHuG/xIyrIqfH4X698FWdK IxACL1JDKRiq4rFLWanqL60RRkGyRtttOfdlU/XQZO36oIQIinAXNYf5mraISBts6glT djK9EkpbhMlgeoztCk1vgs2kr0IJlpR/LnSQlBP0F74NY0555BMw5IEMlWpVaSwr5iwo OSlg== X-Gm-Message-State: AOJu0Yw41H9ihGa2EUB3MlirtOXbYNet+U178i/VcPsmSX9XS2dc9ctg Oly3j7IJ9ehuFjjWgsZQPpH7Vwx8cegf8dtGY0O9hjDWW0IWGuK6jQjgGSrBajbqmqc= X-Gm-Gg: Acq92OEqfX5GrBcRq2X1KLpUD3M57gXkeTOrEDYBw/QRWTjP2N82+HlGoPmYFAnOMRR /ExcgAyJNajW3u8gW3ZZwIN3zX3sibMI9p7le2Qvn3Ibbg8uJNWwUxT3nNTPEOC68Ptjz+DxIgW dsr1QvXpiwV1DDS6v/ICqGOj2WBeqNk+/daqwK4cqyYfoKi1i8qObWMTIPHs75w4uLRh/2+B3X5 UQ2NaNiLhjBeD8nr87/1pG4ePmN06SME5BUGlbS8tXV3FdsyScWmHj/JbcGUiyZ2eXifA0AqV0g t0f9sZRnzp0Wpo19AIA1GA8Y7WsQZHh2/YPPazTP3sxE8KGNjXnsDGPsLsBjri2iJ0SNjMrWSH2 MtzN2DV6NDv4GXXJl8+B3/ZPnJcRl3/DmgSuTKv11dmseqqF4/NRpfcxcMf5cBB4VroYY8udM+u zofLUq28VqdETzKm3qyOJP69PkYy73cLkzZjAZ7n+n4M72dOuM5VgxIiaYJMU82Y8dUGIA49xgi tJ/yytfSqvGcntsvwiLZkp+9VrZXiq1vuFL X-Received: by 2002:a05:6000:2085:b0:460:1c93:6eb6 with SMTP id ffacd0b85a97d-46067c21fa4mr4285861f8f.20.1781191993913; Thu, 11 Jun 2026 08:33:13 -0700 (PDT) From: Frediano Ziglio X-Google-Original-From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jan Beulich , Andrew Cooper , Teddy Astie , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Frediano Ziglio Subject: [PATCH v2 2/4] x86/efi: discard multiboot support for PE binary Date: Thu, 11 Jun 2026 16:32:55 +0100 Message-ID: <20260611153257.650054-3-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260611153257.650054-1-frediano.ziglio@cloud.com> References: <20260611153257.650054-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ef75cf/1781191994-22772C48-B9878073/0/0 X-purgate-type: clean X-purgate-size: 3003 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1781192025005158500 From: Roger Pau Monn=C3=A9 The multiboot headers (.text.header section) are not consumed in the PE binary, hence discard them in the linker script when doing a PE build. The multiboot and PVH entry points are not used in the PE binary, hence discard them in the linker script when doing a PE build. That removes some relocations that otherwise appear due to the usage of the start and __efi64_mb2_start symbols in the multiboot2 header. Section discarding is not done updating DISCARD_SECTIONS definition as the change is specific for x86. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 Signed-off-by: Frediano Ziglio -- Changes since v1: - improve commit message; - change section orders to avoid changing code order in final executable; - merge 2 commits; - removed deprecated documentation section. --- docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------ xen/arch/x86/boot/head.S | 3 ++- xen/arch/x86/xen.lds.S | 5 +++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst b/docs/hypervisor-= guide/x86/how-xen-boots.rst index 8b3229005c..b6d852050a 100644 --- a/docs/hypervisor-guide/x86/how-xen-boots.rst +++ b/docs/hypervisor-guide/x86/how-xen-boots.rst @@ -82,12 +82,6 @@ When a PEI-capable toolchain is found, the objects are l= inked together and a PE32+ binary is created. It can be run directly from the EFI shell, and h= as ``efi_start`` as its entry symbol. =20 -.. note:: - - xen.efi does contain all MB1/MB2/PVH tags included in the rest of the - build. However, entry via anything other than the EFI64 protocol is - unsupported, and won't work. - =20 Boot ---- diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 77bb7a9e21..90faf411b9 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -152,7 +152,7 @@ vga_text_buffer: efi_platform: .byte 0 =20 - .section .init.text, "ax", @progbits + .section .init.multiboot, "ax", @progbits =20 early_error: /* Here to improve the disassembly. */ =20 @@ -710,6 +710,7 @@ trampoline_setup: /* Jump into the relocated trampoline. */ lret =20 + .section .init.text, "ax", @progbits ENTRY(trampoline_start) #include "trampoline.S" ENTRY(trampoline_end) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index f758940674..749d9719cc 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -57,6 +57,10 @@ SECTIONS __image_base__ =3D .; #else . =3D __image_base__; + /DISCARD/ : { + *(.text.header) + *(.init.multiboot) + } #endif =20 #if 0 @@ -195,6 +199,7 @@ SECTIONS DECL_SECTION(.init.text) { #endif _sinittext =3D .; + *(.init.multiboot) *(.init.text) *(.text.startup) _einittext =3D .; --=20 2.43.0 From nobody Sat Jun 13 07:29:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1781192019; cv=none; d=zohomail.com; s=zohoarc; b=gm+YB2hruIlosTylxxMkNLLbnfFJ1rgLFQYoAxJ923UKdSe+ihAwGoucgi1kvxXQCBpd1zreo9Fz66YaEXsAuglDKiTcKfdWpKxzzwfoIzO/zWwS0rqQrVjiw4tdfUNjA60AKzzXdIp6SaQc1W1mtA/+v2/B3BlxDuVn8m45/sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781192019; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qoEJu6qfOh2UmjrdngE2nnp9Dsm0B7C3c1boM1iOShI=; b=FzxU1v6E1Txh8LvvwoM9UHxTLNiSTNPi73VNB4bTtMNeUrGLL/aOuRj+wtOq5n+WNQHVcwrGPir6uXjc+vSkL6Z3HC0ukQzuSzuiVUkEC5ieNDxQAAXFDMI6KecAjqhjKoBoyeir5rYaCBmrK30NI3w0CO+BK7QVRHRdo8eE9GM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1781192019656114.52256613925931; Thu, 11 Jun 2026 08:33:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1335798.1597985 (Exim 4.92) (envelope-from ) id 1wXhPB-00062d-Im; Thu, 11 Jun 2026 15:33:17 +0000 Received: by outflank-mailman (output) from mailman id 1335798.1597985; Thu, 11 Jun 2026 15:33:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhPB-00062O-By; Thu, 11 Jun 2026 15:33:17 +0000 Received: by outflank-mailman (input) for mailman id 1335798; Thu, 11 Jun 2026 15:33:16 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhPA-0005i8-GT for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 15:33:16 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wXhP9-00DLDY-MM for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 17:33:15 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a2ad537-bab6-0a2a0a5309dd-0a2a45019f02-8 for ; Thu, 11 Jun 2026 17:33:15 +0200 Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a2ad53b-c1f2-0a2a45010019-d1558036a8e6-3 for ; Thu, 11 Jun 2026 17:33:15 +0200 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-490b8ac62baso8779555e9.0 for ; Thu, 11 Jun 2026 08:33:15 -0700 (PDT) Received: from localhost.localdomain (5.116.208.46.dyn.plus.net. [46.208.116.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f0a43e9sm80679900f8f.0.2026.06.11.08.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 08:33:14 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781191995; x=1781796795; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qoEJu6qfOh2UmjrdngE2nnp9Dsm0B7C3c1boM1iOShI=; b=Y7/9WQzbQb9g8jYU6YXpcFQiP81Or8j1ogibRmo34dtA1NEZnH2nWKqVX/x657N8VT wc49AajHtV7jr6Zdygc4SzH6KFjNWofnpUkgEpFzzf7dELJ3C3Ndi9zunLUBylcWXA41 oVsRL4cwLuBDJ+YBbagtU2XwO1gZ7guNgW5TsVHGPoYFNVi12Tixy9qbyzmrSwyuEXv7 yWm0naXiHhoMjN5AVYT7EUimIibd7V+jveEJaYjMqLkqUlQmrBv6ua5Yqgbn8IKoEgaU U3tEq3bc1DE2BhBc54H59M+ApWaRTSH0XsVqalUJl/bsqiv7pNxAtYf85pZMxlJPOtgi cNCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781191995; x=1781796795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qoEJu6qfOh2UmjrdngE2nnp9Dsm0B7C3c1boM1iOShI=; b=GPBtNUhvqoEcP6fSO8vOlb3l+7OO1DIYBLN1ELNQV54kwYzfwAF+WGvd01pklcmeNJ ellvC7rctquSIAG9mqVJyg+mvmCBnhpmjk4v5kP86WSTx4iCi3OXQz7YUagrMzisZ1A7 ohtr1qEW2GpX+yD23ldA1E5w1qiH/quvNQkcXlLV9W0AqqONk3usROWVV8W4ZTPaufHt evZ1MLYWFaj22BvympB5Zsy9UxiXIM16aTr7RHmEYZNtF05c/NhHj8sABN4yJiL8/qUf TmWOGCyP5IfZ8HfsRQ9CgoXqLJuh8G6SC3RXxOwy+Lb/6ngDcp5itI0zahNe3RIJSmsF lR/g== X-Gm-Message-State: AOJu0YzKx7fH5lgVblIHCmZHmKfAxuPokAwezEYwF+aKthR1rdzWAQ5k vAGtJwoWMT2+Bsx1yqUH2NCo4lU+d5Zfg8Dt86ZL1LWXFnUN4Ffghtps5jUW+D1hZK8= X-Gm-Gg: Acq92OEOq3UfF7mxLaloJDJXX6hLpUvvqRWVEfj2FTklfP1SJ2Aycwmdw+Dd9XTSQV8 o8OaXLfa6eAvDeQMAZSSUNdlbjHNV9XZ5ZmHr/vg8d4OedGtGeTn0XNl0q3AClwhTLQB/5coL/A wzmV9sH4u/SzZpKHW9vPnT6ydKm296Zo9lXJfYsfYKGwqlU9LMKIxVX0fmS+Hf0F776cKhzHyB5 7JMk7EnNjZ8fc9K8cjMSOScW0u5I9yctmg5cYWfKtZI+tRn04eHA2R0NDOgHdHwq2QmQCcXIhEn KsiyQ+0FoZ9Wv/80I/o0iX8ouI5xq9fyPxmTqdym+VrFP3ECyQCwtvW3DmZUZyVTKxc3n31eeuc D4WmoffWUlvU1FEdHPcaZeedPvH+FjFRgN1ybOwFP1fKjAAuPZrcnkFBEBfwyAck6RKpvJQ7iQ+ 3Qq9kjNB7H5itDNMldz+725VqkFirpcjC+AALi/HvuSXW7/5KrPnrVVLZe9eoppIs3JN9sP7PcU Oqkwt6QWqrQImHyN5pWMYxm0Cu6U3Lvpwsq X-Received: by 2002:a05:600c:c059:10b0:490:3d3d:805a with SMTP id 5b1f17b1804b1-490e5131ae7mr32259635e9.12.1781191994826; Thu, 11 Jun 2026 08:33:14 -0700 (PDT) From: Frediano Ziglio X-Google-Original-From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Andrew Cooper , Teddy Astie , Frediano Ziglio Subject: [PATCH v2 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Date: Thu, 11 Jun 2026 16:32:56 +0100 Message-ID: <20260611153257.650054-4-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260611153257.650054-1-frediano.ziglio@cloud.com> References: <20260611153257.650054-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d62444/1781191995-AE342FF4-DF0BB432/0/0 X-purgate-type: clean X-purgate-size: 1810 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1781192020912158500 From: Roger Pau Monn=C3=A9 Instead of using the absolute __start_xen address, calculate it as an offset from the current instruction pointer. The relocation would be problematic if the generated PE binary had .init.text as a standalone section with just read and execute permissions." Removing this relocation is necessary to make it safe to split .init. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 Signed-off-by: Frediano Ziglio -- Changes since v2: - Improve commit message. --- xen/arch/x86/efi/efi-boot.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index d738b839ee..b983f054b5 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -270,7 +270,9 @@ static void __init noreturn efi_arch_post_exit_boot(voi= d) =20 /* Jump to higher mappings. */ "mov stack_start(%%rip), %%rsp\n\t" - "movabs $__start_xen, %[rip]\n\t" + "lea __start_xen(%%rip), %[rip]\n\t" + "add %[offset], %[rip]\n\t" + "push %[cs]\n\t" "push %[rip]\n\t" "lretq" @@ -278,7 +280,8 @@ static void __init noreturn efi_arch_post_exit_boot(voi= d) [cr4] "+&r" (cr4) : [cr3] "r" (idle_pg_table), [cs] "i" (__HYPERVISOR_CS), - [ds] "r" (__HYPERVISOR_DS) + [ds] "r" (__HYPERVISOR_DS), + [offset] "r" (__XEN_VIRT_START - xen_phys_start) : "memory" ); unreachable(); } --=20 2.43.0 From nobody Sat Jun 13 07:29:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1781192019; cv=none; d=zohomail.com; s=zohoarc; b=USP96G/Ph+jRjR84I+AOfqW2aEhtsZWt/XKaPaPCLmttgitHRJEvINhdYQv6JzZjBs9823NYixIWVyLHFQBu/ixbfJvCBoNBblUVNFatOymUoz7S5da1Ua9JyNem4fi1eT42D7t1JA5RicOW+7N2bcOMCx5zktP4ZBL8M6zvxhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781192019; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=33TPV9ua1J4veKgMgW4Ng7TdHJYDJOEyknwHEIMN6qs=; b=SVi3enQcFMW8C2saF4FG5vht9aIH42qayhZNdlSbF07BYxffrZBWx+dUgYXXs3RdbqrRrL9ikLRYFYtHJPLA4RXX8kRgMIVZ1Y7CW09qdyLz5054I/aBpU5E2LTnlJxp3VYUiXHBgMi9HN014L0znV6YF2GEEx979L28lsIxY14= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1781192019332798.011924359632; Thu, 11 Jun 2026 08:33:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1335799.1597997 (Exim 4.92) (envelope-from ) id 1wXhPC-0006Qh-P1; Thu, 11 Jun 2026 15:33:18 +0000 Received: by outflank-mailman (output) from mailman id 1335799.1597997; Thu, 11 Jun 2026 15:33:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhPC-0006QQ-MP; Thu, 11 Jun 2026 15:33:18 +0000 Received: by outflank-mailman (input) for mailman id 1335799; Thu, 11 Jun 2026 15:33:17 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wXhPB-0005z1-2K for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 15:33:17 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wXhPA-00GHRR-FM for xen-devel@lists.xenproject.org; Thu, 11 Jun 2026 17:33:16 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a2ad531-2eae-0a2a0a5409dd-0a2a45049ba6-20 for ; Thu, 11 Jun 2026 17:33:16 +0200 Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a2ad53c-1dec-0a2a45040019-d1558034b42a-3 for ; Thu, 11 Jun 2026 17:33:16 +0200 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4908b92904fso92302075e9.0 for ; Thu, 11 Jun 2026 08:33:16 -0700 (PDT) Received: from localhost.localdomain (5.116.208.46.dyn.plus.net. [46.208.116.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f0a43e9sm80679900f8f.0.2026.06.11.08.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 08:33:15 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781191996; x=1781796796; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=33TPV9ua1J4veKgMgW4Ng7TdHJYDJOEyknwHEIMN6qs=; b=CmvnPSZJXxJ4+GxBIxW/MpyQgD2crML++DUAdp043y2HT4vFCVL/gzvHutDguyYQR0 N0bb9G4mRGkETHn3aVkbfkAVlwG3McOCxMQzibiSXJNmgY+XaKJfASLFpwkIK6+Utpqp sTS6UwRZn/AeCBkxvBpkwqZuz0h3XexFmH81tZsFTEug6/fNEN01tyzWMYbvajsesNeN /LX/69yweUUUKlc11F1jTNeYupl3Q0teJ3qbdcU45NM5Ncpxb6CgqhiekTmUEipSpyZO T4gEumqtoEvJIf52AwfjLXPEiaUMtj5OWf+bf/cWemely2UwsAlEPh5YHWc7qGL4B8u6 f7iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781191996; x=1781796796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=33TPV9ua1J4veKgMgW4Ng7TdHJYDJOEyknwHEIMN6qs=; b=brJj7f+ObHf6sM0nUtLaTa4RaxX+kci6TkQkl5g6zOlyqQ6B0M1iSsT5lRAcD081Hz fcEjeemFFtvOfu42bVkyxusCRxU351Rc3O9CX3H9fs/nvP9nonbAQ9mVbUSaBAWSZTj5 8kv5HC+C2a72E24CR38diahC1Ob/7/f0jpYzJLwI4EkizMseCBAhOcZTXasvPSx6VTkx wIoCbfpAZEK7Q7/1FJeeZgBE+KfWFBljKFB1amN6/4dSEqncFZcAKLKP70gpMeeA9O2a hVE3mE8UIFeLdc34UZ/RNAxJAI6a+0XCiEya7JBb+0O1H+XRYJq7qr+apaSvAL+V7riF IfLQ== X-Gm-Message-State: AOJu0Yz4BZXfS2VqEni5U+H86CRlUTysOuit+3XHm8xg0vY727Yaheg7 xDI3UWLt2zz49fSzIgUfx3cdusc8pW3NmQ37TEjwgdrJl3laVZMN6Azmm0QaykdBFW0= X-Gm-Gg: Acq92OFuMjwkj2WqZmCGyezzY95YXSrSg7FmmSd3iJAPY+oyT5k8ahLOnzUcpT+OHSC frzlPTfbwhu6XuQ11mce8Hcvouv3g6Ne049Fi1s7CLpx4l5OJJh59nsb/+Va+9pk6RspiumTP7u 0r+0mR2rJbKFZN0tpj/S/XpVnBNSJc4pmi+WHiiN/CUIS8E/iSc8GheoxD/pf/XSJjsFmFkPjaB h9ONsvtrrD4mCsX98jyndsJXenS5o1Of1JA7M7ZiFxjKNx/rjHrxXXgEQdRQ1XMlxahNRHUgyyU YD6z287pmJLkQjod1hVC3sdsXK0ftpwCMfMlF1OFvm1uJ23zflGsz67iJFSVJPRX8r7hMvCtwAR vFOrV2ZKiNKYCq0sGzivStCn6ngJ4gjuWBg93Pr1a6XAVKr4iGZpvNCGulULCRdJ4eYt4EqrnL9 ZZlrBk/AwI3IHapJsaELvnI4qnGFkvQMXXFUNCFOCvQPwDSPoHInT+npqGH5R9cLsTZDjwpEUZf 7v0CIClJEzyk9OKE1Knxh8n/1t3i+VyfWss X-Received: by 2002:a05:600c:34c7:b0:490:44eb:c1dd with SMTP id 5b1f17b1804b1-490e563bdd3mr44657285e9.29.1781191995724; Thu, 11 Jun 2026 08:33:15 -0700 (PDT) From: Frediano Ziglio X-Google-Original-From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Frediano Ziglio Subject: [PATCH v2 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation Date: Thu, 11 Jun 2026 16:32:57 +0100 Message-ID: <20260611153257.650054-5-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260611153257.650054-1-frediano.ziglio@cloud.com> References: <20260611153257.650054-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1781191996-297793FF-1B629824/0/0 X-purgate-type: clean X-purgate-size: 1707 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1781192020913158500 Content-Type: text/plain; charset="utf-8" Currently .init section is both writeable and executable, split data and co= de to have 2 sections satisfying W^X rule. It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms in the pagetables. NX_COMPAT is a requirement from shim-review, https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-sh= im-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-= done-to-ensure-such-compatibility Signed-off-by: Frediano Ziglio -- Change since v2: - update comment style. --- xen/arch/x86/xen.lds.S | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 749d9719cc..8fefda1816 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -193,11 +193,7 @@ SECTIONS __2M_init_start =3D .; /* Start of 2M superpages, mapped RWX (bo= ot only). */ . =3D ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin =3D .; -#ifdef EFI /* EFI wants to merge all of .init.* ELF doesn't. */ - DECL_SECTION(.init) { -#else DECL_SECTION(.init.text) { -#endif _sinittext =3D .; *(.init.multiboot) *(.init.text) @@ -210,12 +206,12 @@ SECTIONS */ *(.altinstr_replacement) =20 -#ifdef EFI /* EFI wants to merge all of .init.* ELF doesn't. */ - . =3D ALIGN(SMP_CACHE_BYTES); -#else } PHDR(text) - DECL_SECTION(.init.data) { +#ifdef EFI + /* Align to satisfy UEFI CA memory mitigation. */ + . =3D ALIGN(SECTION_ALIGN); #endif + DECL_SECTION(.init.data) { *(.init.bss.stack_aligned) *(.init.data.page_aligned) =20 --=20 2.43.0