From nobody Sat Jul 4 21:00:40 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=1782477461; cv=none; d=zohomail.com; s=zohoarc; b=Fzel4xS314QBlyxwuMCRACuQSpsP/w8so+4npYVrT0s332ekfJe7Sw3qN98tkl0EoCcR4rnrOTit01ESIx+ZQwmpiVQ9U7ythCHgaUwQORKdJHsu+xCw7d3C/eSaNkxlIcKGgAN4/5IgmNMSHc8/woAAKRC/PkTbbwNT/BDQOHo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782477461; 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=SZ5oq/h6Ct/bubpgcFsVwUap/Y9yiAwC2oUUawjmI68=; b=i+3ix/PNMgaiVFepsNe2pQtljJAFxlkiQY8YJGRhtJpEyUEljNpdQFeLJletPcCxJnCKXMeuYZnnsMrt8v0YnoHDglFx9EoIUMi4y2Tn5Fn+eQi6r9kX0jrAKJm46QUg2n+mjVn837KS0SGMmIlymw0R2Y+lfEj7RyC7tGdX0M0= 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 1782477461320260.69650909837765; Fri, 26 Jun 2026 05:37:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1346120.1604637 (Exim 4.92) (envelope-from ) id 1wd5nt-00046X-VT; Fri, 26 Jun 2026 12:37:05 +0000 Received: by outflank-mailman (output) from mailman id 1346120.1604637; Fri, 26 Jun 2026 12:37:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nt-00046L-RV; Fri, 26 Jun 2026 12:37:05 +0000 Received: by outflank-mailman (input) for mailman id 1346120; Fri, 26 Jun 2026 12:37:05 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nt-00046F-8E for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 12:37:05 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wd5ns-008INd-Kt for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 14:37:04 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3e726d-e002-0a2a0a5209dd-0a2a4508b3e4-8 for ; Fri, 26 Jun 2026 14:37:04 +0200 Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a3e7270-edec-0a2a45080019-d155802dc930-3 for ; Fri, 26 Jun 2026 14:37:04 +0200 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-49241896317so4658705e9.3 for ; Fri, 26 Jun 2026 05:37:04 -0700 (PDT) Received: from localhost.localdomain (8.17.6.51.dyn.plus.net. [51.6.17.8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268ff1be9sm76578835e9.8.2026.06.26.05.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 05:37:03 -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=1782477424; x=1783082224; 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=SZ5oq/h6Ct/bubpgcFsVwUap/Y9yiAwC2oUUawjmI68=; b=l9m5imnYUPZGohIf2QU0qVmhqxhtLCQxR3jx3II/9h2WAZRUkQJcDZCjAzXkUdSKQ7 zWDKygena+02bFBKRCUf649gv+Si2LERDMxcDuSQsb7EuO5JJRxdPVn5/cnWYXIjN3iQ tUNMS5s4v40X552mTk0Lh8m17Qp88e9u3/+Rlim2iU3o9zT7oJVCO3AVWnYmRwVtIMD9 3OzPkL1W386FDR61B+8QafSLBAgpSEHi0R2MaNlhY64y+uIX/arjnrgYhtBsb9NiI0WM U9fibYWTb/WosovCSRLYNvK3LmH8OERg8pFNOwdAgUm2dzPLDTMMRgPuUR050Ij/tAHq Mriw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782477424; x=1783082224; 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=SZ5oq/h6Ct/bubpgcFsVwUap/Y9yiAwC2oUUawjmI68=; b=FOQE5zeJlDYMUPG/5AApOE5LULSZEu4JZXyyp8Be6gHzK/IvIUdzyoSQbMPwuHqZPw dooG+mnBnOru8gN6ZmMZyUfa21Q+2PlcKZWtomPBriHBwlYuynoYFPVTt6USg//uSYvo VcJWWfKWtl5RRImGq1undMn0ndtuR+tRmO+ZH7HdPnwI3TpwyjE4q6H9twQGU4Y5BJu2 3J+tvvYVpFew2HdFpyHBnGOKmvf/oTzDF3f45oxrvgYpes46MlfPUq9oezTxtB8N7Wm1 4UV3kNAO8J100jGYwHPf+pa/WFmcTpae8QP+NyzMs3TWUUziCIJ405snjBrO+SeKpuza x26w== X-Gm-Message-State: AOJu0YyKbrrTRQY2FZjnGhnEwwXgRDa9T7N6xH1c54EfWdOgvOqeWVCX W2DbqptIIUeAt6tqXGfMLZjrc5hLoH8/cXeb1RTupzWBt5JKqte/TWBhR+DofgwA0Sc= X-Gm-Gg: AfdE7ck1Q0TduYZDbSKdnnZbJ4T4hLMG4BNVSvZbxlrK7eHLckbHQV0RD15Al2Ys4bW iOvEupidhgwe3jkNdMCO50emymYUCNLq6Sc1XZLAdON789HtnzyB60ytE5chJIEjppIvNkcP1id +CB1uQN0s0Fucod7pmeFbQF7ajCp31ZiIxwx9I7FvjJgqN6rSbTR7p7zRCRQNtisiFNebNPjezI J9+aRsJY40ynds6Gb26E6/ZslT3OndPfvabrfZUVO2CtKuJXj1Vc5dBuEDDguZ5BA9sldptYAMn 9V78rRTtBZb0XqAVyiju+187ezRRwdr/6HSVp5OFG3TmrQgJGcFRQgapzlJIyJQE8QJltaHDTKP idt4+IMENBCqp5OFEVGcGH62ww20WZzh1HUJ9ZTNkqqBKDNqC5gg57knFTXgQGVqRTg6ioHNa3e 1zka7LsTwU81Ju2e4emK9Il6OWDa9+N0meP3/mMGutNJcrUPCzj5n9S19aPxBETHhAjQdQUWVkR V9ACDgD X-Received: by 2002:a05:600c:8b4b:b0:492:3d05:5639 with SMTP id 5b1f17b1804b1-492668945eamr90594455e9.36.1782477423934; Fri, 26 Jun 2026 05:37:03 -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 v5 1/5] Align relevant sections to 4KB Date: Fri, 26 Jun 2026 13:36:41 +0100 Message-ID: <20260626123645.229375-2-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260626123645.229375-1-frediano.ziglio@citrix.com> References: <20260626123645.229375-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-c1860d/1782477424-411293FC-B7135E53/0/0 X-purgate-type: clean X-purgate-size: 2075 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1782477462798158500 From: Frediano Ziglio 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 Sat Jul 4 21:00:40 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=1782477460; cv=none; d=zohomail.com; s=zohoarc; b=ZwJChRRLpFlznArw1GGsJWl1aKiQoOSMjKx4/iNV5MyBtzJWbQ7FXbYHeyj55RJDF7bkyTqohqDJv6oSOplGFZAF0aDNWfelnwHJehZ3ZzIwvDlh5px9NPBIy1kHZzV7PrR4lKsNi2Xd6ssRNK1FW3XlvVpsBkDevgsbsSTnRUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782477460; 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=sAKNT6XO/y4NOFGKf9ZV2Q/su24+5X1SoV17cy5xU9U=; b=PvQ9H9Okl70wmnuJzIfvMaAAoiFB30DoZ0pgqORtvU6on7VHdMgwFDxFFgrVdqUj2yCawbUG0/1jnvcC3ZpDnzHJw+K6ABsknzjJW6hcrkgMgruhkxVrPa6cU42e++x/5FwffH23Vhjiv+sJTkR6BJD5U5lHQ4Vqd0r8hTQRR4w= 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 178247746029392.26487494215019; Fri, 26 Jun 2026 05:37:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1346122.1604655 (Exim 4.92) (envelope-from ) id 1wd5nw-0004WP-Am; Fri, 26 Jun 2026 12:37:08 +0000 Received: by outflank-mailman (output) from mailman id 1346122.1604655; Fri, 26 Jun 2026 12:37:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nw-0004WI-7q; Fri, 26 Jun 2026 12:37:08 +0000 Received: by outflank-mailman (input) for mailman id 1346122; Fri, 26 Jun 2026 12:37:06 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nu-0004E8-LG for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 12:37:06 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wd5nu-008IO7-1x for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 14:37:06 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3e7269-5cb7-0a2a0a5109dd-0a2a450ccebe-28 for ; Fri, 26 Jun 2026 14:37:06 +0200 Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a3e7271-f399-0a2a450c0019-d1558035a4cf-3 for ; Fri, 26 Jun 2026 14:37:05 +0200 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4926046fbc5so10113955e9.0 for ; Fri, 26 Jun 2026 05:37:05 -0700 (PDT) Received: from localhost.localdomain (8.17.6.51.dyn.plus.net. [51.6.17.8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268ff1be9sm76578835e9.8.2026.06.26.05.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 05:37:04 -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=1782477425; x=1783082225; 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=sAKNT6XO/y4NOFGKf9ZV2Q/su24+5X1SoV17cy5xU9U=; b=rfE+i4Xee6iNgtnYSJNHj8wLuRy8rhUiO0jkiOzkZlZibRLTsOIx4Jlq9Fp8jAcMWp Q1GyT7sNElz/P3LD3kAEL9u7ewg7XTswwj1u9yj8u4p91CzeTAarDlobIJltpJmAvddn 2vd5yPMvyIy81mX8LBYbx9lkndZiErQRzR768Z0C7dzqzhrk4m1H54e0XV78TyP8T5w7 uGMCUYbZ4a4dgokjykoVNzDUOzxn1iNKUebDmcTZzYNwm1TiGsbbW8SreHB+Z6TQCbjD pOQ79SESEDGD+J1avSjBb9NpO+rcPq1qCnLgbVICK7LqBp7czTPFlIaUpP0/J6nO7YZz QptA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782477425; x=1783082225; 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=sAKNT6XO/y4NOFGKf9ZV2Q/su24+5X1SoV17cy5xU9U=; b=RS3pKXTFJFH7sY4p2uiltfkY5SL01rFheyd0yWtYL165iMmKAlIc/UOP1IpLktrmoG TF8hoIrbZotfiTeNdKsirTaQn3tD8LNkmS8BxA7hw/XclRoPjuxPO2FT0Li49z9tqpdm SiloX+28ycrAp2f1v1F71BkrzJT3rMwBnS4RTfFOG1MnPWVplLQ7i3O9DAFWUtUiz6lR HYow9Jiw9J1zAT5gaAHYBykQAioZ81tyDOPPiDsnQivlH6t5MiJLc//hw50Aqu5Qfxav O3XJ6pbJ3fcCBxmZp46gyHdLUffZjaSVCeGxAAyR+ru1KHUxmP2ftVMuwpTwmaZkSwdz JPCA== X-Gm-Message-State: AOJu0YxB8IxaFjLLVS0xDnu7+vIyXKuucmLffDNMwgEut42g31K+cWyQ +SqKRMNUCpRt/0gfU7MMNfc2BTUnNdRHngWkRC4JHBeJ3aDO6gxj92YoyTi5a4/+04w= X-Gm-Gg: AfdE7ckYiDNelulpje4Oz5flheB6HcE/NOvR5WGIpmwugwVkrqQq0+kj34YLz4gzGRg 80mx97X5KousKp+5PQgPWHbnHZRfDVeNrNIRzso2CIbpi32fXfWrKV+s1fMLpuUIMMgTcDDA0xj DBhUCROlSrGstEfOtL1aVWNzbqYs0PT7Ck6dqX9J2kqVxLlRRzdIduFK09PN0OYsmvre3CTgAg+ /h0N2hHj4hxFxlhjPQh0VlzZGGQFk88mjhZprO8ppa4Y0VLi2eaz9+oZxFk4mutkb7xf38K+CCY 5HLq/+Lc4yZZpYpqoOn5ZTF0phJ1Vc+wOOAxb/UDKTQjQf4TPsafJPVxMDs//WNo2B3FbA4fjW4 4MSr48M4rfMAjfqFa2dSvoDeGwhqit8vQViiNZDUXEv4Lau/WH0f0Mu7hdcJGeQ8G6VtQ5Qr+Jg d2WJc7Eu8o67dWGqDTKWoY4aEezbIQfTesqofblX7h2gCK+jDirvQ5sWQyqCutWWmHo86TeNMP5 HwmiwTg X-Received: by 2002:a05:600d:8497:20b0:490:af63:2cb1 with SMTP id 5b1f17b1804b1-492663e5d71mr67315365e9.7.1782477424840; Fri, 26 Jun 2026 05:37:04 -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 v5 2/5] x86/efi: discard multiboot and PVH support for PE binary Date: Fri, 26 Jun 2026 13:36:42 +0100 Message-ID: <20260626123645.229375-3-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260626123645.229375-1-frediano.ziglio@citrix.com> References: <20260626123645.229375-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-d25034/1782477425-91329D51-71170222/0/0 X-purgate-type: clean X-purgate-size: 4292 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1782477460812158500 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 -- 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. --- docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------ xen/arch/x86/boot/head.S | 8 ++++---- xen/arch/x86/xen.lds.S | 9 +++++++++ 3 files changed, 13 insertions(+), 10 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..ebdc562207 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!" @@ -135,8 +135,7 @@ multiboot2_header: .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!" .Lno_nx_msg: .asciz "ERR: Not an NX-capable CPU!" =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 @@ -152,7 +151,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 +709,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..88553513a9 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -57,6 +57,12 @@ SECTIONS __image_base__ =3D .; #else . =3D __image_base__; + /DISCARD/ : { + *(.text.header) + *(.init.multiboot) + *(.init.data.multiboot) + *(.init.rodata.multiboot) + } #endif =20 #if 0 @@ -195,6 +201,7 @@ SECTIONS DECL_SECTION(.init.text) { #endif _sinittext =3D .; + *(.init.multiboot) *(.init.text) *(.text.startup) _einittext =3D .; @@ -220,6 +227,7 @@ SECTIONS *(.init.rodata.cf_clobber) __initdata_cf_clobber_end =3D .; =20 + *(.init.rodata.multiboot) *(.init.rodata) *(.init.rodata.*) =20 @@ -234,6 +242,7 @@ SECTIONS *(.initcall1.init) __initcall_end =3D .; =20 + *(.init.data.multiboot) *(.init.data) *(.init.data.rel) *(.init.data.rel.*) --=20 2.43.0 From nobody Sat Jul 4 21:00:40 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=1782477466; cv=none; d=zohomail.com; s=zohoarc; b=dIsr2cV1MdvFKssuImEg+l5pW3M6tJvqVMcNt5Oq66NkbnYgYxssL4+WiFrrn/STtBuEdoK/sLl/aQlUkWGh+iO7tGALJBvbVkftODhKzkO5x1uNhpM8+xuMKF83a9yrnctyhJLE4TfNYaBaICxd+YT6a/rVbqF+BJqIYbmqlQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782477466; 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=h7zgfFDoBBPNpJ7qeY1DSNzH5DJ0mfqwAdGCYD7M6W0=; b=HFb95lOqUrTZYVuo4d9ESPCSsJyv5XtcAxaQZAvfbSrgJiJYvjMsRWdqp8qd4Fpgq8yBThwjdQKasJ5u/jqnAad0U8YJOpykU7hKn1Qx/5X5t6kEARtLp9eFztWj7hXyNPR0fHs+P4w/jGKNMbLC7CAHQvmx+gS1EOBYfItoV60= 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 1782477466502724.1788693056809; Fri, 26 Jun 2026 05:37:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1346123.1604659 (Exim 4.92) (envelope-from ) id 1wd5nw-0004ZO-Ju; Fri, 26 Jun 2026 12:37:08 +0000 Received: by outflank-mailman (output) from mailman id 1346123.1604659; Fri, 26 Jun 2026 12:37:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nw-0004Z8-Fi; Fri, 26 Jun 2026 12:37:08 +0000 Received: by outflank-mailman (input) for mailman id 1346123; Fri, 26 Jun 2026 12:37:07 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nv-0004Lc-Dn for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 12:37:07 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wd5nu-008IO7-Qt for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 14:37:06 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3e7250-5cb7-0a2a0a5109dd-0a2a4505ac78-42 for ; Fri, 26 Jun 2026 14:37:06 +0200 Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a3e7272-3cb2-0a2a45050019-d1558030bde0-3 for ; Fri, 26 Jun 2026 14:37:06 +0200 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4923fb1f095so8876695e9.1 for ; Fri, 26 Jun 2026 05:37:06 -0700 (PDT) Received: from localhost.localdomain (8.17.6.51.dyn.plus.net. [51.6.17.8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268ff1be9sm76578835e9.8.2026.06.26.05.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 05:37:05 -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=1782477426; x=1783082226; 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=h7zgfFDoBBPNpJ7qeY1DSNzH5DJ0mfqwAdGCYD7M6W0=; b=i21WghmRsF1Zdt+QIgbgX09tVJ2JUOMIfe9RziGcx2T+0EqgW0xt24vaUWjsRKHdM/ ExtRgnbuIO6VNywmPxyN+c1OMH5drLVsQsKsJRvBSHXJRUR/MLjel3nzIvPlS6p267xn 5zqUnClNFVH31NoF2wdnxwY1j4pz7nXJ4EbIsU9tmCmrZemY46l5gURc3UydJxdClXOx WQax7zXdx0PaTR2rjHSdfGjZ95/skU6lW8k+VpQumDfbCtbA3VIyuDLdETHhVoNx6zRJ dFRuGixn2tCSdj3UZpfkiBPiQKNSk2rEkTnwOCGrDk2JruKLAkggc437w6CGe8d6E9IG 1I4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782477426; x=1783082226; 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=h7zgfFDoBBPNpJ7qeY1DSNzH5DJ0mfqwAdGCYD7M6W0=; b=iz/JOpqoemxgLJ+M9f2yRaLo9oUzWdYGMMoEXJhNtnwqdN0V0GUaU330+tdFbRoFre e57E7uUf6K4n3PDyzIDRSW2agc8hAAzu8fDM4HuwqgVHexDinOgpihIHlfWdDzLCrAv3 MXfqTnhjK6nhrShhb/86sUggFh2exz0tQJB6uHOBkptmH8CQD+KuH3WgaiwFQUXhdNBZ 92SV4zbdI0FXXeVY2N2ENorXRineYvMuxvLFaYfxLbpOcx80uEnDl/YjaDhyTf2K7oiU 7D64APSje2avpUbB1z4TndcCorSdMi8HVQLKD9inOUPm93GFGyNqTf/y6JTmqZ0aVMru E3tw== X-Gm-Message-State: AOJu0YyoLET/y9YXlDqkomKALLCZ+BlVCp5TGbl1qaFjvnF1n2IYUZOj 0v+8fX3WctcqnJ9gpQmcjwjFA53PwizTFUvaTNwDM0t6qH+5i+7o1/fGofbP0K7XL6A= X-Gm-Gg: AfdE7ckMqizLw5CksOLdQQpkRAoPyX0pri5lfe09I+20L8saYkBh7Hw0Wam3A/q0aCn m9M4WxTyY+UIJqfOz7aUTccKwe2XVrCtx2bwisRhNGCR1SY0gjBWZeGtSktqBzEN5LrqfIAUMv4 NMwBPWnX7G0xX9a6pG8KOt/DAU8I01exhYIwAn5OpwpqyeTP7KyVTeW/fvGXOj+69m58Lok210j EtDtvhpJd7fgfuJbDBbhRp2cLBadzHVlsgt1orBZEmuLkQrUtSv0+O0Qx5skKC34hswH6kMv8Kn C501kUfx/Ca2giKdjXi1g65qkjk722BNwPDySW/nMTyIbaVLnEygNC7/ZyqcI8iV1o8QIT4lVGs Cgo7zHa96MqqYhm8xlE/w1MNC6hGKjMth6CMrPR+JRgpuIBkXt+ThygRRefKYjPW1gBipz1YvFC I4vvWHfYEfbszUg6JC2I+j6OCjBYraHPM5N5izTft9ADSinTZ3MmdH7OwLNFzIZ3W2eeU02uKvW SJS3a0g X-Received: by 2002:a05:600c:8a1a:10b0:492:488c:f627 with SMTP id 5b1f17b1804b1-49266872ce4mr74157985e9.11.1782477425844; Fri, 26 Jun 2026 05:37:05 -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 v5 3/5] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Date: Fri, 26 Jun 2026 13:36:43 +0100 Message-ID: <20260626123645.229375-4-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260626123645.229375-1-frediano.ziglio@citrix.com> References: <20260626123645.229375-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-c201ff/1782477426-551E62B8-8D192688/0/0 X-purgate-type: clean X-purgate-size: 1923 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1782477466816158500 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. --- 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 Jul 4 21:00:40 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=1782477469; cv=none; d=zohomail.com; s=zohoarc; b=Ee91+2yPKbhobedhop3vQpMysOIB2lwrocZAejcqQY88N+iqDZZlKfF2noi72Mk/aKMkYOBQ3Tzajaeemhyncv+WqDRM1fOvoWBqi5VEY10A6EnLQ5v0X+Q479w/AoNyg42wpUH4GRuy4zCpPNOOgf1NwHH31dn4Si5ufs5VUeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782477469; 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=ELcjCw1r06UTqQr5rPCcaNMw6q60HdsbqsHgkVk0c/k=; b=nSQCZKI9otGLF/ipkxMYuXcv8Xm3r1BTWvNL3C+NyLPnfIOrgoiUloGIrfQ8coP8zu87hme3Fk4qceLOGPL+jz7JVperGMR+4HyS1uND1HTKtmOjCKWfAlKrqcSgi6htedaD4fxxDz6JGIpuOW7Fbp6NVp9gqi6szk3FaXGNR+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 1782477469197356.35684117298365; Fri, 26 Jun 2026 05:37:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1346124.1604672 (Exim 4.92) (envelope-from ) id 1wd5nx-0004xH-SX; Fri, 26 Jun 2026 12:37:09 +0000 Received: by outflank-mailman (output) from mailman id 1346124.1604672; Fri, 26 Jun 2026 12:37:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nx-0004xA-PG; Fri, 26 Jun 2026 12:37:09 +0000 Received: by outflank-mailman (input) for mailman id 1346124; Fri, 26 Jun 2026 12:37:08 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nw-0004WD-9z for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 12:37:08 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wd5nv-008INd-N6 for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 14:37:07 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3e726c-e002-0a2a0a5209dd-0a2a45029de0-16 for ; Fri, 26 Jun 2026 14:37:07 +0200 Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a3e7273-5a27-0a2a45020019-d155dd34ecbb-3 for ; Fri, 26 Jun 2026 14:37:07 +0200 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-463f1165e16so907066f8f.0 for ; Fri, 26 Jun 2026 05:37:07 -0700 (PDT) Received: from localhost.localdomain (8.17.6.51.dyn.plus.net. [51.6.17.8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268ff1be9sm76578835e9.8.2026.06.26.05.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 05:37:06 -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=1782477427; x=1783082227; 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=ELcjCw1r06UTqQr5rPCcaNMw6q60HdsbqsHgkVk0c/k=; b=IyatKNDOF4vmV3btcCKbZhH5ESavWm50IlzZfKNH0ZJJux4vuhffDc1zwpl6LGCop5 GMCza8k+qEaoVJOOBYCQL2vI6uNb4eB7TcBy5tQZq37rIDFAZmuGv2Wd4MC3MSvdgq2v yAzP+AI2ZflZbuoTkvW4mkLTYtbhXWGYOwJgEyiFx+w2OMYUix2OUyMDJ5FqN44TN23P qLTWPEMuHUojQGGePSuCrEQ05zWd4Ax8O5p85ubnQ2icYXkmWsvhs2J23RzpiI9Zj6Rn 8JmtprumhKIPzmP4eOnUwcU1bluNoIeeazoPb6b3lLVqMHqY7JtRogzXUpclTVvv9t0V DzLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782477427; x=1783082227; 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=ELcjCw1r06UTqQr5rPCcaNMw6q60HdsbqsHgkVk0c/k=; b=hNRWYfuUili5Bz823f0iSqQsjopBIlTX0zXAVLv9atlW8QSkgMi9GuaIr5LyPmaJJh swLPnd/U1iN/lHFYMxDj3z8XwGRRWZC6Hj8juIEbS2DC0gV8db8jRRTgyx2TihFlGk2G 0iKY3SZFSVK8e6pqnCenNnr951yJyaG5C7+8I/o/Q10axcrJXGY3BsNOHzoc3k9jBiET aOBYs54Q50GTuQvvaNjjiM+kMRGj8Jl1IhjcB4Rsv1nYeJTHRuXUD5XhmulsBF0jRSF4 RfoCUfpLTkk2NjW6SnNPX/toRH+4qMWY520tgtOQI4N1WrmXnBmpztset8Fhk4kMUEFA 4HKg== X-Gm-Message-State: AOJu0YySLFlJbRLCl+kINxL9pfz8tnBbIs38GzOkb/mdb3Du4JhBKJGl w3XCVGuvO9fc2b6ODB405LdNC64an3KWMc5/2DTEgbWiCxyueQRR92kD4vjYHiLpse0= X-Gm-Gg: AfdE7cnQRT0wtyM/+pNQCbNEOt1XSdgNRBoRE7raLcozgNkxNHEld6HRuIcMc5Pu5ao osr3HrckvCGl/tuvu0miAkGSRyTvDhdTyfQ46cFREkk0N98oqtYUZeqWnDbKc1LZ8Bk/YGfmiyX oiNj6kRmw8A1pbb2tUcdHieskLrufKBNzhLVjQel7IwviQa3qAqKFxeDDarAdGL8onyW9PLmOmq G3DvZaLMJI7U3Qqt17pctnMimWpDHQFsXhDO71SfzJ5Alvrj+qHLalySRogxs6enJGYEPGApH5D a7m5Ro3XRtQgTGChxESR9XeMUnu5tuKBcrBorWX31fCt2YyndNx6JVK0AOHVbJio47vnc0cay25 Wbvp4CuFmTO5v+aHCcFu0HHBBFS1xlKzB4LJtrxV1vRPUGt107Mz8JFHOA9bH8fMPWkNMwpgZHL lG4CHpaU5IO8MyBdDHSWtu6m8QUZGz8p6xa3PiqkjWeI55EyX055SpJPy+oes+oph/59XD2w27n wY517wj X-Received: by 2002:a05:600c:6211:b0:490:c2a3:23cf with SMTP id 5b1f17b1804b1-492668b6dd3mr98566805e9.34.1782477426787; Fri, 26 Jun 2026 05:37:06 -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 v5 4/5] x86: Split .init section to satisfy UEFI CA memory mitigation Date: Fri, 26 Jun 2026 13:36:44 +0100 Message-ID: <20260626123645.229375-5-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260626123645.229375-1-frediano.ziglio@citrix.com> References: <20260626123645.229375-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/1782477427-572F47C5-54AFC484/0/0 X-purgate-type: clean X-purgate-size: 1956 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1782477470829158500 From: Frediano Ziglio 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 88553513a9..70678ab83c 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -195,11 +195,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) @@ -212,12 +208,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 From nobody Sat Jul 4 21:00:40 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=1782477458; cv=none; d=zohomail.com; s=zohoarc; b=ch8j9iJG5q378ZcFgw2k4NJFWishRFWc73J79SiiMhmCHiMlQlmw29NObBMmhLCM3qnhRkKrbHIffXzOpVScS2kkeXC6AkG2vSNf0KIcmb1bD4Q4nwCI8Or8PSDCyee5Lnt1w/AGX0Zajmoo+z1glD2QoyQPnZiZqjjMwcXm/I0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782477458; 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=Ana3ymIwcmSeF/vMnLZznGGCNHfICJ1NLKaFG+o2Xcw=; b=TEo9WcwaHzrSCBmz4x9o0R1Pl+vjhFT5f5YstnUbLg4QZGPdBPVedPOXQZ7NYucPO26sIr6ytcr75mL/bFVorCEi6ljPSvRmoCim2BFQkNDFK99zKYrN/mGGoeqDcq0XAKA5CVSHwaa710DVgwgN+libFgf+Y9vcPBLRE7ByMqE= 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 1782477458435491.7543952109845; Fri, 26 Jun 2026 05:37:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1346125.1604682 (Exim 4.92) (envelope-from ) id 1wd5nz-0005BI-3L; Fri, 26 Jun 2026 12:37:11 +0000 Received: by outflank-mailman (output) from mailman id 1346125.1604682; Fri, 26 Jun 2026 12:37:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5ny-0005B7-Uy; Fri, 26 Jun 2026 12:37:10 +0000 Received: by outflank-mailman (input) for mailman id 1346125; Fri, 26 Jun 2026 12:37:09 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wd5nx-0004eO-09 for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 12:37:09 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wd5nw-006RzF-CR for xen-devel@lists.xenproject.org; Fri, 26 Jun 2026 14:37:08 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3e726d-bab6-0a2a0a5309dd-0a2a4509caa2-10 for ; Fri, 26 Jun 2026 14:37:08 +0200 Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a3e7274-97e6-0a2a45090019-d1558033acb1-3 for ; Fri, 26 Jun 2026 14:37:08 +0200 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4926fe5be4bso1267315e9.0 for ; Fri, 26 Jun 2026 05:37:08 -0700 (PDT) Received: from localhost.localdomain (8.17.6.51.dyn.plus.net. [51.6.17.8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268ff1be9sm76578835e9.8.2026.06.26.05.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 05:37:07 -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=1782477428; x=1783082228; 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=Ana3ymIwcmSeF/vMnLZznGGCNHfICJ1NLKaFG+o2Xcw=; b=BOBvzVsb1DUxuMZUHaPbNMSIovIhOBMcqYLQoLpJnGlm11rIRczzoRJYCdiFpCkwmo N/hJUkCgxeq7FdFG0bE5yBiG9rwyXSph5Iz3AdQh5T3TQu1SJAcTsVuul/qetqVaPiZI 0qqtP3jUmGqIJg64fAWdR+WAEtGewSJDxDcWQZZr3186xxKWO+TmRsSxQPyjYxsOvg8c eqcrsawBeYO1lJNU9jEfe65cdl3MfwgwEyamp6W7QCkFFSZedJHBPT26meO8/FMPcn+J 8GjtsStLFszPEFnnaV/2KrAVZGh15DzsLZ3wUF3W1y6THntTJF9FHG4XkTjRmFnXZKH9 R+Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782477428; x=1783082228; 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=Ana3ymIwcmSeF/vMnLZznGGCNHfICJ1NLKaFG+o2Xcw=; b=D3iOLXoEqYcUlFSEzRx/LIAWHWe5a5rDWWz+UwMaXFawdjSOVcdXUpgKtoLn4t2ya3 h1NSEZ8a/iRZCGVtzUHJMmMr7VWEK/zQMoeCpZy2AUEvLlTPT3owpsANyWZw/rdcjhNe GkWhKOr8UcgfUIclUhQp41EXmN21a4ozSzCnBf/Xg3+FXW5QCj/vM+EnnxHfXSwBA8Zw xGtQYU4SqJTJ/4RgKJ8R5EgcZRPTEiq9ISa7RbJ1olExfT6uTjdy4LUeVLbbIW3KiG9c CAbxwTp7Z9fAarRjXNyAY6Swg+cRTQOiZbgDcu5osL16VK2sTVNxXKaLtI5RNxlY4mLX +uSg== X-Gm-Message-State: AOJu0YwZmYTnfy0P3QAen2Y9t72v5h+8W1we54YIE5LJZqeTRfEmT++f 7+BX4p/jpu+fqyu74MG2TC/1/85o5SUjdk8PcmzUdmL9jk0OHkXXMxrAZ46D43j6cAU= X-Gm-Gg: AfdE7ckC759MWkwed4QxsKk6BRZ4xIyIghHAaMiuVktLhYGij0gdm4/QRyZaFKogtXp m5R0ZqPNf4C7SPSdBtAC0w/NIwIWQzKh0GnN3MowDTcjv9NP05DP4NhZM/maorIUDLVgBDz/hom dLpJVQ0yftNMIbVqkvZUGZrjgP/IB+sMZ9xelzMC4MSHkutdk4TzVX5yYXgNKAyySwzT6y3HAjA jvI5YxzHbkaovwa8K6OzKn707rgzJ+y/9rwaRcKTfAmCF0diuzAadT1KQECCJnLq4kssNgd4Ha8 zf7osKG+CJg1tWF7c0AY0iUQhPZlqT0/8F1lcCSCRYoJ/K+15wv87gKrTw/jZI1JLa/BxyHxozn xYTqwZTp50RG6iIOK+0toJd+gbrRMZQqylbTtrQ1Dzm/OSm2GVoPsh8WixIjRL8qiUhAYVhgJzy zLhRy90sOY25U5eMlD5xLw/NZd8qgRkzYdPE+HFUTvXS1oxHnhkmQvrwBzz0ZFjoeWyy0Bx7Ffm eSEqiLl X-Received: by 2002:a05:600c:4443:b0:490:688b:f9f8 with SMTP id 5b1f17b1804b1-4926fc8cd5fmr10059545e9.27.1782477427721; Fri, 26 Jun 2026 05:37:07 -0700 (PDT) From: Frediano Ziglio X-Google-Original-From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , "Daniel P. Smith" , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [PATCH v5 5/5] x86/boot: Exclude not used string Date: Fri, 26 Jun 2026 13:36:45 +0100 Message-ID: <20260626123645.229375-6-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260626123645.229375-1-frediano.ziglio@citrix.com> References: <20260626123645.229375-1-frediano.ziglio@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1782477428-46B3B986-A624AA7A/0/0 X-purgate-type: clean X-purgate-size: 803 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1782477458792158500 Content-Type: text/plain; charset="utf-8" If CONFIG_REQUIRE_NX is not enabled the string is not used. Signed-off-by: Frediano Ziglio Reviewed-by: Jan Beulich --- xen/arch/x86/boot/head.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index ebdc562207..981f262b5e 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -133,7 +133,9 @@ multiboot2_header: .Lbad_ldr_nbs: .asciz "ERR: Bootloader shutdown EFI x64 boot services!" .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!" .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!" +#ifdef CONFIG_REQUIRE_NX .Lno_nx_msg: .asciz "ERR: Not an NX-capable CPU!" +#endif =20 .section .init.data.multiboot, "aw", @progbits .align 4 --=20 2.43.0