Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CFFDCD6E4A for ; Fri, 29 May 2026 15:36:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1322629.1588947 (Exim 4.92) (envelope-from ) id 1wSzFn-0004r6-1A; Fri, 29 May 2026 15:36:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1322629.1588947; Fri, 29 May 2026 15:36:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wSzFm-0004pj-PU; Fri, 29 May 2026 15:36:06 +0000 Received: by outflank-mailman (input) for mailman id 1322629; Fri, 29 May 2026 15:36:05 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wSzFl-0004iq-Hv for xen-devel@lists.xenproject.org; Fri, 29 May 2026 15:36:05 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wSzFk-0016uA-Uu for xen-devel@lists.xenproject.org; Fri, 29 May 2026 17:36:04 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a19b253-5cb7-0a2a0a5109dd-0a2a4506e07c-36 for ; Fri, 29 May 2026 17:36:04 +0200 Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a19b264-7371-0a2a45060019-d155dd2fbdc3-3 for ; Fri, 29 May 2026 17:36:04 +0200 Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-45e6a4d0be0so6412131f8f.1 for ; Fri, 29 May 2026 08:36:04 -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-45ef34b834esm4196196f8f.11.2026.05.29.08.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 08:36:03 -0700 (PDT) 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=1780068964; x=1780673764; 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=dbvjQGIXrgh2VZV7pqCGHyTdh0FdQdlsGVZavBAbEBI=; b=R4zv9jQGJ0ynoZ3jc57s7oa+hDDND4CXOJHQ8pgjmuZceSi5EYsgIZ6/AmeECmJRTT EhmmV9ZpOoy1aWhG5wRvBkzaLOIE343l9zisn1VqTV/0aZI7MfHKfD/pG76e1ja4qtEJ c+PfvM4xV8TUrWLBUPQ8po0RPd58OgRevN5/jYRA7iog5ler48A5TMEzkGMOGvy2/47y c8dknMjK8JHSYqaBIE6gxU2T/ybTUJqP2z7f1K+RKgxUBsygdSuDGVl1FOPFN15E77IG Z6O34oiGXzVTABxhFveZj200nUKCw8FLYoeDcHm+kw3Lhw1LEg7TTYQsdtZUFJFSkb9l BRPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780068964; x=1780673764; 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=dbvjQGIXrgh2VZV7pqCGHyTdh0FdQdlsGVZavBAbEBI=; b=NTPgp5ws11ytPBiqkg5qkCB4NdSxFOEVpC9NW72ZDuYvY+W84ARDlT9+ZcpvhJPPJO 7u4hC1Q5/8l+QsUn4tf1iyGh0sWD9mVnkbpxoZwoq3JhUf7xQk/fXAZdkzC5u2yyRH/W J7JYVMz7czVkNpuTcQ5i2Aye11J/0bkKHSPyHFDmxee4/qd7Y3miDKC0AcbNByanCSdK fwxZRij+MSOhfj8b2mg4n4hSMTs01OPFKBsb0GvU/wWlsCzi0IPmIFWrKK2yNQD3gCoU X7MUcAfWnV6VzbsXSjK8TZ/fgis0ph6OZ6KzCeQ5k6d3KCxIzZK+H92E6Gn1xpVmEkKr mV9A== X-Gm-Message-State: AOJu0YyeoyspDlnnOuxjhynjdnMEHRZ0y28xOP7+ArlbIOFwGR1P7rcD L7JFen8gMRgMpsQOt+wzc08pSCXwj7NFWAPviKzzVgtJED3UlbnqgdlZnSh3qPOQ X-Gm-Gg: Acq92OGdHPhpRfEKwCxtcQaCEQ1MTsSjUSGy7MfNGOTQcpbXNCBE4ebQ3zSPwoLNvg3 2BuRQ7p3IlDnbYn+RoCRt56XL9owDPyyALxW5AT0DLmfswktypzExD4T5NyNZgwooG4el8tC7PM yOZRjma218zP7fKpMpfHnUpus0oALRWWyhVbKRzRCZjME92mq30niTBenF+QwfVF57+qvlAw6Gj nXhsmUSdDM9+NpFV7Dmpn3p8Gte7hYlgSnyQ6lj94V4GHl7PDzjq5Y1Q5CNo1Xny5lwjXApc8UM bmadc6rCwt80Ka9av4hcq2pKzEByVyemIzgOhqgA2/2eM/tnPsLyhJyABlfKeZ8Wp+XCubS3Yxt IBwyDFzX4/nW25SbKVgcBJWsaGQVJMMa+pXLKYCnHBtrzQAeWOHZ6HYZCCrCqCqfJBl3m1KcSEG NDAwahCjBKHh68OanGNU01ndHSTQrWzoeTeLe7OTCLurWzLP+k8RNEmFlfa8kRPg2zrq+b89Zmz xymTp+8eDyYTbT/KjbzwK6wX1JRRvZ09epA X-Received: by 2002:a5d:6e89:0:b0:45e:73eb:1ff7 with SMTP id ffacd0b85a97d-45ef6af6c21mr490829f8f.3.1780068964295; Fri, 29 May 2026 08:36:04 -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 6/6] x86: Split .init section to satisfy UEFI CA memory mitigation Date: Fri, 29 May 2026 16:35:31 +0100 Message-ID: <20260529153531.1341542-7-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260529153531.1341542-1-frediano.ziglio@cloud.com> References: <20260529153531.1341542-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-16d1c6/1780068964-84767D75-1041D615/0/0 X-purgate-type: clean X-purgate-size: 1327 Currently .init section is both writeable and executable, split data and code to have 2 sections satisfying W^X rule. Signed-off-by: Frediano Ziglio --- 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 a5a85e9b8a..7f892cb2fa 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -193,11 +193,7 @@ SECTIONS __2M_init_start = .; /* Start of 2M superpages, mapped RWX (boot only). */ . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; -#ifdef EFI /* EFI wants to merge all of .init.* ELF doesn't. */ - DECL_SECTION(.init) { -#else DECL_SECTION(.init.text) { -#endif _sinittext = .; *(.init.text) *(.text.startup) @@ -210,12 +206,12 @@ SECTIONS */ *(.altinstr_replacement) -#ifdef EFI /* EFI wants to merge all of .init.* ELF doesn't. */ - . = ALIGN(SMP_CACHE_BYTES); -#else } PHDR(text) - DECL_SECTION(.init.data) { +#ifdef EFI + /* align to satisfy UEFI CA memory mitigation */ + . = ALIGN(SECTION_ALIGN); #endif + DECL_SECTION(.init.data) { *(.init.bss.stack_aligned) *(.init.data.page_aligned) -- 2.43.0