From nobody Thu Jul 23 21:11:48 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=1784096552; cv=none; d=zohomail.com; s=zohoarc; b=L2syWOKXtVBv8zmLk4sK4H3CKnGKYWxcaO9xtqFM3+SVQy82ycfhG/rgY8D8VUJdpel9JcK1jjuVUsWOdkvyN4HKw14n8gZhjbDebWiaChMdhzd5rqTKpN80ZPff3YTfqHJlTJz0imqbt23EFDgCLB7TOQmQpdbcla3oti7GC2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784096552; 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=pqCnw296qrnwdmXLYDWU2GesaXoLsxGgUNGqF+FPq+0=; b=XPQIrs3GA6mvUfVqN5kMfS7X7yLl5YpIRmSBUuUyomz+rSu4qA/cJw0jD4M1vipC7IwqEYth2tbuuJ/BqtZEAEF7SpWs3anl4zq70YbewkY8lCXdOcG6x5vlCruOPBlNoob4aslYioCBLHypvM0SU4Si+bVJeO1kt20DtjYzq8I= 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 1784096552382514.1367864721882; Tue, 14 Jul 2026 23:22:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1362689.1614452 (Exim 4.92) (envelope-from ) id 1wjt0Y-0001Jj-Rl; Wed, 15 Jul 2026 06:22:14 +0000 Received: by outflank-mailman (output) from mailman id 1362689.1614452; Wed, 15 Jul 2026 06:22:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjt0Y-0001Il-NH; Wed, 15 Jul 2026 06:22:14 +0000 Received: by outflank-mailman (input) for mailman id 1362689; Wed, 15 Jul 2026 06:22:14 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjt0Y-0001Gm-4E for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:14 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wjt0X-00DZpn-HD for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:13 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a5726fa-e002-0a2a0a5209dd-0a2a450288c0-46 for ; Wed, 15 Jul 2026 08:22:13 +0200 Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a572715-6ca4-0a2a45020019-d155dd31e1b3-3 for ; Wed, 15 Jul 2026 08:22:13 +0200 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-47de0093c42so1429382f8f.3 for ; Tue, 14 Jul 2026 23:22:13 -0700 (PDT) Received: from localhost.localdomain (2.115.147.147.dyn.plus.net. [147.147.115.2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 23:22: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:Content-Type: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=1784096533; x=1784701333; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=pqCnw296qrnwdmXLYDWU2GesaXoLsxGgUNGqF+FPq+0=; b=X83jrNlkieOwg4NaW4oBRr71PTdcVvcRdSeaGDbXhhLRD1Oombf2wATCiFEtb5tP22 N09Nh7+ISnFS2OFFoCQSqG+3ACuRmQYtRB1MOBquZaQj1Tb+Z5wlsZFNAT5riGv/H8v/ ZlRbTkyzidYI6m4ntLTHzgFOHdO8XiSyR3tE8gIeGqsjl7Ag9TlZfjpxQHAV32PjyHsP Mp0Zk70x7wk4u7eOQw7B5OHTPvbJl+EIbh+5UfxeVmW7O1TRfml0ZBrZvJ+1yjbR1m+g eaKOgM9TCAxG+T185JNn2vBvY17cCOFpn2w4+130MKIbmQ0XtEOFej9t74dgFooudkZ0 +M2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784096533; x=1784701333; h=content-transfer-encoding:content-type: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 :content-type; bh=pqCnw296qrnwdmXLYDWU2GesaXoLsxGgUNGqF+FPq+0=; b=aZdI2XrFRUp7C6AGsW5OXCGs9PFNuY4tWO60vckn4gO5olDlMgHO7b8noKa2AphGt4 HxeZwmdsvkbH4nHZyxtnryLGu6K8Lg40n6DENKfdeY1cqIcIG+F8cHL+1wQ0VNn6UTel 0AEOg2KmjZ9u5y6fm1PEBDwAoWUuzP3aIjWxC6i6DSXSaP6A7grMffxNC8f8BZy4+Kof /EZZ0XTR0SW4QtYnsLTMhrMst8wym+bJu0Kq78mTIWUxS5Pp0k7E1khj6+JbUzTVlG+r gwLEzbpgsq0iX9BANkfimXqgsx8W/jx7AaCURIlispAAWkdMX+aRGApb/BrAlm3hwfbd TtRQ== X-Gm-Message-State: AOJu0Yyh1hDO/RXdv3qFUEeKvkTj0g+QwEQDqEDmTX6c1zvLhs4x4JqO ijc7AdnJBs5/7LzCBKG2z9JJC0X+48vsu6uTa9q3qnwXHB5whFN+lmjiMzn4FNofHSMGcw== X-Gm-Gg: AfdE7ckFxCoavS8FZNFFnCmk2696FasclIQd8uaU1c/ODC3KmtBg40puYGbso+YPHAV JIMO/anKrqgKdRWKg+u1ctYiwIbXHzLYp0dTot1EedLV1Sz+XiDeoJeMeLWvmWaQFvjX1DNQZ49 qZFxkUz/0sJCU234sr+XdgTdegB6uNv7J8N3p10G1ERqqRbiCCNT2oobKVHfIfD48CydCLMEzMH 0dYBNtxYUfUuxtiOl/P/e+oIzABdZbY9kO+K5V0n+tk8IiIjNDt76PiajOhS5Rv8Ajx2TGy87YA TK2Oxd64d8Q4qIr+QqXHS8IsuqEabiGzRo8gAoBZhZ8BjfQv+bnE6m03ct5tRSU0d5CWO+mRA/v BuI1dl9+eVPwj+qn13uI4r9h6nRgoc+P6AJHllnZsoC9AesgouJWWNPqcuXF39psq4d2XvJLV54 TboL0oY/d8TkGlc9LdYZiGCJXzI7Z+Y3lf4Fltw37qkXCxtC4QvToHzy4rF0DG0S4wD2gp0W44u WxalAQxAM5onOcv17A= X-Received: by 2002:a5d:5f83:0:b0:44a:be4:d0e4 with SMTP id ffacd0b85a97d-47f2dccb3bemr17034965f8f.25.1784096532832; Tue, 14 Jul 2026 23:22: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?= Subject: [PATCH v8 1/4] Align relevant sections to 4KB Date: Wed, 15 Jul 2026 07:22:03 +0100 Message-ID: <20260715062206.328049-2-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com> References: <20260715062206.328049-1-frediano.ziglio@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1784096533-F14AE2AC-30B94D61/0/0 X-purgate-type: clean X-purgate-size: 2023 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1784096552840158500 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 Sections with different permissions must be in separate pages. In the case of debug sections they are contiguous and have the same permissions, including the immediately preceding .reloc section, so it's not an issue if they are not aligned to the page. Before the .debug sections you could have the .reloc or the SBAT section, either are permission-compatible. Signed-off-by: Frediano Ziglio Acked-by: Marek Marczykowski-G=C3=B3recki Acked-by: Jan Beulich --- Changes since v1: - Change subject. Changes since v2: - Improved commit message and subject. Changes since v3: - Added Acked-by; - Improved commit message. Changes since v4: - Added missing comment; - Added Acked-by. --- xen/arch/x86/xen.lds.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index b9e888e596..8e63cf5bc2 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,8 @@ SECTIONS __2M_rwdata_end =3D ALIGN(SECTION_ALIGN); =20 #ifdef EFI + /* Align to satisfy UEFI CA memory mitigation. */ + . =3D ALIGN(PAGE_SIZE); .reloc ALIGN(4) : { __base_relocs_start =3D .; *(.reloc) --=20 2.43.0 From nobody Thu Jul 23 21:11:48 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=1784096560; cv=none; d=zohomail.com; s=zohoarc; b=b5wVD+1w+ea/V0t6J/FqBSHaXlQBbic9C6v34bsBn+6rEavpjsMyN2wE8sMLiPLVU7WGfZkdvH8HnoByaNaPbDYfKZNVuce6dO+LWMlpG4EHNbN/xg5ZySHqlZE99Ipngmt6kHSgpG2M1IjNqkzWhmEpTVlAX1NhD0jqXkyYnzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784096560; 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=FqYWTs8G33kIjfb7qWPUTwZdIykiHkYIeo/EcHEwy6s=; b=ZDa+BrohxjwF/xPy88TpO0In1kq5QPWNyA1RqOUdN0c+/WWQ3ujKZptyZ6scSlWK91ViTK0HZQGa4Wxnf7GVmqk29+wFj+1TK9xlddOPym80Mb8FIxUefi9h2JtTg0y2Bv/vQT/7VgXUsKypzB7UV4qJc4LoRGaR1lwQySkyndM= 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 1784096560614658.9374098483186; Tue, 14 Jul 2026 23:22:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1362690.1614467 (Exim 4.92) (envelope-from ) id 1wjt0b-0001hd-5p; Wed, 15 Jul 2026 06:22:17 +0000 Received: by outflank-mailman (output) from mailman id 1362690.1614467; Wed, 15 Jul 2026 06:22: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 1wjt0b-0001hU-2h; Wed, 15 Jul 2026 06:22:17 +0000 Received: by outflank-mailman (input) for mailman id 1362690; Wed, 15 Jul 2026 06:22:15 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjt0Z-0001XS-HW for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:15 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wjt0Y-00ABip-UG for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:14 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a57270d-5cb7-0a2a0a5109dd-0a2a4503c806-40 for ; Wed, 15 Jul 2026 08:22:14 +0200 Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a572716-fae8-0a2a45030019-d155802dc801-3 for ; Wed, 15 Jul 2026 08:22:14 +0200 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493c19bad03so44737985e9.2 for ; Tue, 14 Jul 2026 23:22:14 -0700 (PDT) Received: from localhost.localdomain (2.115.147.147.dyn.plus.net. [147.147.115.2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 23:22: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:Content-Type: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=1784096534; x=1784701334; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=FqYWTs8G33kIjfb7qWPUTwZdIykiHkYIeo/EcHEwy6s=; b=NypO/5kiEm9EPx0O6E88q3JFxnfLEXdtyOvodX49omRbWRr6EUP6CTLWq/EWMWTvXH 0wACMIK2x6/IqxtYIO2PnO7N2mFIoUjoLLXbezqZXrSAhxCMMzKzG2szodAE/KvB6F13 gWsGQInEd+BBCwEn74abNTwyHPV6jDlWYi3n38CNUV/M95VsmORFhImTHKp+TWMRPtxe 8cyJzrIL1V0OHy9csmtayAMj/7ijZqzQwTl9jdUKOsUVilRMlHsxJJBHGyhqdTXsn9PW o6KNeQxWcR7ebS/zfKmvAeUjFi/h4Ufkm5gxJJRMxTmV8VefB3wDaIut87Ho4/Voua+g u+Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784096534; x=1784701334; h=content-transfer-encoding:content-type: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 :content-type; bh=FqYWTs8G33kIjfb7qWPUTwZdIykiHkYIeo/EcHEwy6s=; b=b6uhaJmjj7cbZpMVTOmvvSvq5mF2sZw08tDj/DZT3Tho5aqzelXTFHxXvb1AYQoW6b ZKWmt2y9YRuIL3K6kf1bHBG0SXVvSgiVxNVIsKkeL1Ybl67NHNdrhc6rUxl6C4U8+jPh 1mCNxhKwQlE4ngtG08XJkWP6KJg8QWoclc+bXC5BaLA8eux4RJLZxLA6JxXhnN2gL38V DhApAhZdZbxPby2x1hoo4ItPkx6vqyTxvZu3JwAUFqpjFF1dYlHNKHJabANUfNvE1eQr 2f22ORz/3guCYouHFKtRehcpTg5CfS4FILVTvQvk9AuBQroxT5QblK14AQRna/Vl5bJK 5nTw== X-Gm-Message-State: AOJu0YxN2xW/PsLh27tQDSMbGmwMwsAtj0X5LXd6JI0EIOT++UVOetXk Ke8eo5xqFsFOCyL7oV5aKEnBrrBn5Hc13U+3KBEuv9j0ZcgUN2EyPbruBmov14l45QssWQ== X-Gm-Gg: AfdE7cln1TnzNOcyOXnDoU8vOoS0sE3JS4iJT1ynrOLnbevvJAWMskagQpzKLJ23EiV MMm9Xq4zohhRoiJvdyJmbmJAhBQFgeBd8UriLFbEQYbAyhHHJszDpqScjToTdwx5ZVt7CQ37LMu HtOZCli5mWtrM1IqjbFyqgLfbfLGkr84HELqIujMJbXLvjSHS7Eg0Q17kygJeSbMwsI8HDmath1 Y9d/1dyQzCGdmwP1j5zNnoUpy4+pXnfzNCD8RcPJSYq1bRXpK0kObvfPI5eof6j5Nt123DegKuW 6e8zjn+3pYONfHda9a8UNG/tq3UrhXT4fe35Hlq4IlYT39idn6YH2XXeka63GDL4jfUp0m330kr ehZGuo3Fy1Gf2B/QviQlpUGd2uaROxH/bxV28ApGdJ8mJXH5Wzd56s3nXSocmMu4Ba7///e85r6 t3uNdp33f8Yj/FscfsV81EUe4+T7Lb/yBDYRyn7Jr4eweDwAEp2TnAJ4X2sDlQDQa4CYW+QsRL1 45hpzgsWF4EW5mO5mU= X-Received: by 2002:a05:600c:4e0d:b0:495:39dc:583d with SMTP id 5b1f17b1804b1-4953c150667mr15497415e9.6.1784096534038; Tue, 14 Jul 2026 23:22: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?= , Jan Beulich , Andrew Cooper , Teddy Astie , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Michal Orzel , Julien Grall , Stefano Stabellini , Frediano Ziglio Subject: [PATCH v8 2/4] x86/efi: discard multiboot and PVH support for PE binary Date: Wed, 15 Jul 2026 07:22:04 +0100 Message-ID: <20260715062206.328049-3-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com> References: <20260715062206.328049-1-frediano.ziglio@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1784096534-6C6DE4E9-3504AE32/0/0 X-purgate-type: clean X-purgate-size: 5251 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1784096560874158500 From: Roger Pau Monn=C3=A9 Multiboot and PVH booting are not supported for PE, hence discards 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 Reviewed-by: Jan Beulich Acked-by: Marek Marczykowski-G=C3=B3recki --- Changes since v1: - improve commit message; - change section orders to avoid changing code order in final executable; - merge 2 commits; - removed deprecated documentation section. Changes since v2: - Update commit message, join 2 sentences together. Changes since v3: - Added Acked-by. Changes since v4: - more clear subject; - removed more code/data from EFI output; - removed Acked-by. Changes since v5: - simplify section exclusion using more wildcard; - exclude more multiboot functions. Changes since v7: - added Reviewed-by. Changes since v8: - added Acked-by. --- docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------ xen/arch/x86/boot/head.S | 8 ++++---- xen/arch/x86/xen.lds.S | 7 +++++++ xen/tools/combine_two_binaries.py | 2 +- 4 files changed, 12 insertions(+), 11 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 68b963ce6f..981f262b5e 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -126,7 +126,7 @@ multiboot2_header: .size multiboot2_header, . - multiboot2_header .type multiboot2_header, @object =20 - .section .init.rodata, "a", @progbits + .section .init.rodata.multiboot, "a", @progbits =20 .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!" .Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!" @@ -137,8 +137,7 @@ multiboot2_header: .Lno_nx_msg: .asciz "ERR: Not an NX-capable CPU!" #endif =20 - .section .init.data, "aw", @progbits - .subsection 1 /* Put data here after the page tables (in x86_64.S)= . */ + .section .init.data.multiboot, "aw", @progbits .align 4 =20 .word 0 @@ -154,7 +153,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 @@ -712,6 +711,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 8e63cf5bc2..4ed1d2bec1 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 .; @@ -220,6 +225,7 @@ SECTIONS *(.init.rodata.cf_clobber) __initdata_cf_clobber_end =3D .; =20 + *(.init.rodata.multiboot) *(.init.rodata) *(.init.rodata.*) =20 @@ -234,6 +240,7 @@ SECTIONS *(.initcall1.init) __initcall_end =3D .; =20 + *(.init.data.multiboot) *(.init.data) *(.init.data.rel) *(.init.data.rel.*) diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_bina= ries.py index 581e57cbc0..5f0433dcad 100755 --- a/xen/tools/combine_two_binaries.py +++ b/xen/tools/combine_two_binaries.py @@ -33,7 +33,7 @@ parser.add_argument('--map', dest=3D'mapfile', parser.add_argument('--exports', dest=3D'exports', help=3D'Symbols to export') parser.add_argument('--section-header', dest=3D'section_header', - default=3D'.section .init.text, "ax", @progbits', + default=3D'.section .init.multiboot, "ax", @progbits', help=3D'Section header declaration') parser.add_argument('-v', '--verbose', action=3D'store_true') --=20 2.43.0 From nobody Thu Jul 23 21:11:48 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=1784096559; cv=none; d=zohomail.com; s=zohoarc; b=Hry3t/1ZKB0XP7/+RqrZEl/KuoZTtw3+3spQXNwBhoBT9v+4BhzTIXJiK1tC9ZLN6jCCEmGe5hEwmJGlPyFblTxSX+qoVSzCcFD19BlGMCq70nxQx3YDLVl6iDeJjaP7dkd6dbG82wgvHuWi7FbcnZuNJRxBJKJCIcq8T31isrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784096559; 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=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=; b=B50rBvskQPssC6lndWoS06cN5UWwNUR2QE98Ss1iy/7OzTu0CHHptpXHs286q331wxsorCAvyDr1n6vDAcdw8bs0A6uzE6R7YkcfFDrL546Czst/oRXKEIrRFLDth0UjgwN6x+WES2Ty4nSJIHWEmLv7NuAHmsRdW27s4oHDOX4= 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 178409655994640.14169292274471; Tue, 14 Jul 2026 23:22:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1362691.1614477 (Exim 4.92) (envelope-from ) id 1wjt0c-0001x0-ES; Wed, 15 Jul 2026 06:22:18 +0000 Received: by outflank-mailman (output) from mailman id 1362691.1614477; Wed, 15 Jul 2026 06:22: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 1wjt0c-0001wr-9f; Wed, 15 Jul 2026 06:22:18 +0000 Received: by outflank-mailman (input) for mailman id 1362691; Wed, 15 Jul 2026 06:22:16 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjt0a-0001gi-Ej for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:16 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wjt0Z-00DZsc-Ri for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:15 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a572717-e002-0a2a0a5209dd-0a2a450b9e78-6 for ; Wed, 15 Jul 2026 08:22:15 +0200 Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a572717-b7e8-0a2a450b0019-d1558031b901-3 for ; Wed, 15 Jul 2026 08:22:15 +0200 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-493c52cde9eso43221505e9.3 for ; Tue, 14 Jul 2026 23:22:15 -0700 (PDT) Received: from localhost.localdomain (2.115.147.147.dyn.plus.net. [147.147.115.2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 23:22: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:Content-Type: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=1784096535; x=1784701335; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=; b=snwnbrF6yAzAElnHSrzq/N9y4zjYqeqH/bx0kWfhsqWOjfzU6UJSW2btzuc7Rli52Y vQRvi1ssRVoLWxZ9iesIqWNN6vZYnr/V+nHfoDeB4bHDRfh3o6ZLnwKWaGynIGnp+YJC HGnQE36KW/3jAO5z+QQPjNFuc1MWcfvPwCwEEVUi6Hi36AnJH1505MCkCpXGLOCTdqrT bUVs7i48uUqhzD2vOpO4yb0Aeg5e0hkfGIFEksvRXV5/dlo4uw5HFdZEobn7zT1cPk3T yqDWURFBD7eUpICYnLhzEIJoKdaeXcSpNW1CBjM5xZzxWT4Wsb0pMhXFA1ulVOwq69hu RtjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784096535; x=1784701335; h=content-transfer-encoding:content-type: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 :content-type; bh=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=; b=nidlVUf+SNTLy74mNGAZlN3dzAbZnj12pEMbCWA17ouhZIHDMpXe/hK7zxL8VkLLXp HhMU+9DYuyLItbB5gqFiC/sInWWZFF7ntoXuOtmIqJr/10NIOcEmRgw2FvdyVUYXWiZM U3PG60hPxeYuF89ySw9g8daD/Im1qHbkmS4kjUleOoJ+7RbaQvmYc8w4DurtqJCvYH2u lNrW8tKfDJ6s7NBgnzWfRijGr1Jrlcz57nYH7aBaebBzm1MDt5G8KaSiFEX71O1JRZfs yLmfBt1Ry90KylLThNs7reYbRc35jCVunW4jhtx7ffFuMvr+GetlTUBKP4JeIYoy4VRT VR5g== X-Gm-Message-State: AOJu0YxwVS57q1luRvLBdn1B1cTMUy4Nw6JbYKS7JLWQD6HsNqTEPtxP a4UzJhvQCnWcm6EH4F/9iSA7j7oIvRC8McPWCzuMELS58TIUMmVWCYsISOxi/SZZLrHMMA== X-Gm-Gg: AfdE7cls/dQlaEbf2LY2dyvajb1L5//Tr9ZNxqWUvUNzQRhV0mczktM4n5UpyHEa8Up n8jM7g2RABqlEE1bSbYuFS/ThBMrnqHhf8Nv7Y1hXmKWO7wIQRskEeW++HhcPneQQizSyQabsKh hizdlISLxYNqJUcjdtsaD+d+xwSbPrl9fbDZ8138k5IB9jJbHijj1n6QcM7E6JK67NkMPpZjzKO 5kQk0ZOleZcciJQWIdaHWBdae1q4UGWXLKIQYYvCsD2yYnK0Qln2UFXnQz/4As0D2t6iz8uzIW9 Wz/+QvQ/SkPdGoeILNsSmlvAYO+I7ZO1cd546TQOkoUqfyDseRJfCPCbEHK5hYy9jTdsNoQhDAt c9iGVG1JTM1nqQ2UjoztQM1oABbx8cKKNf72kBgSnDGa6FGS/gzCo0ZsPVKXKc76kxhFQaJja6m fEYeVoi3I0/1bYxQQ9WtJ5BiuGvXftZ2HSxzjrWmuhczdc3QCPv3PdvmhVo3uDNAuWs/bnfNTSJ domK3Berxb742UFlRs= X-Received: by 2002:a05:600c:8a0d:10b0:495:3b8a:5e17 with SMTP id 5b1f17b1804b1-4953b8a5e5amr14974785e9.16.1784096534938; Tue, 14 Jul 2026 23:22: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 v8 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Date: Wed, 15 Jul 2026 07:22:05 +0100 Message-ID: <20260715062206.328049-4-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com> References: <20260715062206.328049-1-frediano.ziglio@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1784096535-2C59A9EA-68D735A4/0/0 X-purgate-type: clean X-purgate-size: 1970 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1784096560823158500 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 Acked-by: Marek Marczykowski-G=C3=B3recki --- Changes since v1: - Improve commit message. Changes since v3: - Added Acked-by. Changes since v6: - remove spurious quote. --- 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 Thu Jul 23 21:11:48 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=1784096566; cv=none; d=zohomail.com; s=zohoarc; b=Y0cX/beVn9B6LdNtpF4podEAJWK/A8hQzfFQ8C0kwWdGAgpwbTZ8Bh5gLkQT8UTzMWevLgfzsFmnOkEwR8QDOAWkqneNn1o8xITb3NtX66k59OgpSg3NJjvJbUqPOti1bpXhN601iNz0j4VVyA5c5DdTPYKaNAr6a2Z0X+Mq3ns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784096566; 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=xqQBYkVwo2VphdJUd/assmMfM7KdXYOfGeEjL/ARnds=; b=GZVrdjJFUvVtnWpwvFpgpYR4qRSoWcMtKnZ50PHXwKRm+tXpa9AQBFxCgrWbdRa1CJDOkKsp8ooF1IxlU/yzIUXaO6n4kG6ITd3GBf21m8GpZJ5Hiydd5wNLcwNkUPIY0u/5DHmpFGxsriB5oTpmp6ErGPSfFKS0U2U3Yv9+rXU= 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 1784096566402805.7773384458757; Tue, 14 Jul 2026 23:22:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1362692.1614486 (Exim 4.92) (envelope-from ) id 1wjt0d-0002CJ-OY; Wed, 15 Jul 2026 06:22:19 +0000 Received: by outflank-mailman (output) from mailman id 1362692.1614486; Wed, 15 Jul 2026 06:22:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjt0d-0002C1-IZ; Wed, 15 Jul 2026 06:22:19 +0000 Received: by outflank-mailman (input) for mailman id 1362692; Wed, 15 Jul 2026 06:22:17 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjt0b-0001hP-AR for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:17 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wjt0a-00Chgm-Gk for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:16 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a572718-2eae-0a2a0a5409dd-0a2a4503edba-6 for ; Wed, 15 Jul 2026 08:22:16 +0200 Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a572718-fae8-0a2a45030019-d155dd2eac99-3 for ; Wed, 15 Jul 2026 08:22:16 +0200 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-47122683cf3so2817079f8f.0 for ; Tue, 14 Jul 2026 23:22:16 -0700 (PDT) Received: from localhost.localdomain (2.115.147.147.dyn.plus.net. [147.147.115.2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 23:22: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:Content-Type: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=1784096536; x=1784701336; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=xqQBYkVwo2VphdJUd/assmMfM7KdXYOfGeEjL/ARnds=; b=FN1vGwOW9ng01iDhG3JuZsfAiN9wOZRRmYL1Os//DxCZelirAIr96D/i0Mygml3TmZ 8CoN66gl2oOrs3ZR4L1+Uhqk9rvoYKvZwdQlFpFZsJFNKd7841f2pZ9FHvotUhq4dfI+ dq6pVfrtmCz6SKGj4GqB0QY1C2P0pz8haSM5H7HFtlomrNM7Q1Ox2viKDAiWg93/ojN3 JSganAN1Xqx1tsQge/4U2SMrGZNiA5JyvL+la5ULK1zTEase6U27Q+Px+xW49VDZD8sd G8UNmpmm4sqclDiiTRscw4L9V1r4mEKDleAptSGDy6OSX/ezGVKmFmYLXeQNdt1f/brR ueCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784096536; x=1784701336; h=content-transfer-encoding:content-type: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 :content-type; bh=xqQBYkVwo2VphdJUd/assmMfM7KdXYOfGeEjL/ARnds=; b=DDKL6N/cUd8sNonwBqXGeuvKIOc9qVUyyAQM8MTGGI0SE6pSMo026NOkhoE4U/poJo /tuaElZvgLZiIK2BvQgSuUZjGvmbJw9ytUJqlFb5BswpxfHNPJ4dt6ogolDxzW8aXPi6 To+pqQPRVHvpiBJBLSHKN0oZ8trQra26nSJaPdXtvGrKahQyLouEtoaNycrW6jy861wH Cq0SdlYk47IhPnm2/iXcrEoUxfBBMIw1TUavgYT46mf8bHwUDaxz/T9bvySN7GjmiedV wOJBsfEPO1lySLXWJZo9nKmKRvp0rnBx+Fc0qPiv2Ck17NVgxhGf2ij7Zpcj48HaZ0Az j9ow== X-Gm-Message-State: AOJu0YxRrA6Z2RKtlpZ3qqz9TECMGhijk2l080Bbbnxjxp0SOWQ//J1/ tHb1Y663CsVblkuoyKl+nFwTHaub+K8w+RZ3bPIe7AAV1mnzBTlnQnmPMcFZY+wC0Sn6Uw== X-Gm-Gg: AfdE7clJSFoWM5FbPzvyrakr/RmeLU6bQMR1Ur1yNhDJw3WMQ5tJQ5Cr4jIZ6sYBcpi aNUEl+5A/wp9PZmhA2dVS2Nf9cFQs1JH/YwBQfsIdHEf3IEPkjD+gyEJIBrtOa7v0ldQu4tobZD jQyInkikD+uAVDBlXXAkKMnX9XPaP8HktdsBKb13pKsFC7wUuRIzTV8QlCWRBeTn7026fhVLpj4 25ShKNnf8m5dPyWWLRbwhIZZVBy4Nv9HSbEfaQ3f0u96PuVqJDstcboUizalEShUPlijWhaY+Pn MvcRGiqe/CKWFOdof56qM5h4g3mtujlvM3FKBY7NhEyCd3iiIlV/ajjAuw5PwvtyiPD4faJMWGi Juo9ZJpXj0Jr5xNpaERb1ctrlWEZu1EgTtir27C4QK23Dwo3OJEAqPhg8macoez3zEoEv+H5Tsf Gn3ARJVhW8usL/dPkvPTjI7ubYBCTeClSa6XuUtOX/oWEAWUBW5eWdB0toTQCGdkKgv2PyrRGmu gv8q8muuSNckNauj+M= X-Received: by 2002:a5d:6843:0:b0:475:f0f0:9ef8 with SMTP id ffacd0b85a97d-47f464a4887mr5853955f8f.61.1784096535856; Tue, 14 Jul 2026 23:22: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?= Subject: [PATCH v8 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation Date: Wed, 15 Jul 2026 07:22:06 +0100 Message-ID: <20260715062206.328049-5-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com> References: <20260715062206.328049-1-frediano.ziglio@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1784096536-6FCC34E9-4FF0E265/0/0 X-purgate-type: clean X-purgate-size: 1904 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1784096567280158500 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 Acked-by: Marek Marczykowski-G=C3=B3recki Acked-by: Jan Beulich --- Change since v1: - update comment style. Changes since v3: - Added Acked-by. Changes since v4: - Added Acked-by. --- 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 4ed1d2bec1..e26e37db13 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