From nobody Fri Aug 28 00:12:16 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=1783331117; cv=none; d=zohomail.com; s=zohoarc; b=VHKl1ZlIGCCE7cm0jpEHYq0SsyJMDE9iVtVshDwCrhB/aQON36eYk7vNTLzX8Banljr5obvk3RrR1HVHh9mahuI5Plf18SleVPw8Dc1jfCu/xl3Kres1pgFVIiYtvy8JfjArOYK3M9g15HiZRlQkQtN1tCvTyLIQZKRUOSdmfjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783331117; 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=BraaY1qC7HOBXFTxSHCrNc1y8UspO9XuBbEgUVn16EY=; b=H3OZvT9hqpH+0Xsz3kfZZkyefK9VvIAswPGPfVeGZ9DZLxeApaMQW2KKEZKIhym5M9IN8nIpD450yrtE9bL3+xjhXVNxWUcoUm8tzIZ4IynQw8rSpNoc7ia55gStayH0BgYIoXSzAFOLnKj6jCesaaIRzjZSDV4d5/Zf+7kKC8M= 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 178333111798521.41194574681208; Mon, 6 Jul 2026 02:45:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1355214.1609993 (Exim 4.92) (envelope-from ) id 1wgfsa-0007WT-OH; Mon, 06 Jul 2026 09:44:44 +0000 Received: by outflank-mailman (output) from mailman id 1355214.1609993; Mon, 06 Jul 2026 09:44:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wgfsa-0007WG-Jw; Mon, 06 Jul 2026 09:44:44 +0000 Received: by outflank-mailman (input) for mailman id 1355214; Mon, 06 Jul 2026 09:44:43 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wgfsZ-0007Fw-B9 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:44:43 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wgfsY-002r9l-OL for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:44:42 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4b78fd-5cb7-0a2a0a5109dd-0a2a4504c6e0-46 for ; Mon, 06 Jul 2026 11:44:42 +0200 Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a4b790a-a01d-0a2a45040019-d1558031ddd5-3 for ; Mon, 06 Jul 2026 11:44:42 +0200 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-493c2c0b9a8so25356765e9.1 for ; Mon, 06 Jul 2026 02:44:42 -0700 (PDT) Received: from localhost.localdomain (2.115.147.147.dyn.plus.net. [147.147.115.2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493ccd9d620sm283605205e9.1.2026.07.06.02.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 02:44:40 -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=1783331082; x=1783935882; 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=BraaY1qC7HOBXFTxSHCrNc1y8UspO9XuBbEgUVn16EY=; b=au7mGDey2UgTbbwtTESrELm69WH6rJ9Z6FrwpW983XxBBkaZA3pfrVnqjDuFMeYWMM y36QzmCp8y0Melegmk2t56AkH4bcXja18VGsICO9eT658dc2dmgDHOB+z3xnfz7E4rmJ ZOmVI6g1ruCWGH5XpyhmuLaFzB73B6HojR012mljaEBM2c2WhuuaE2hZ1EJsPlmc7Q2x rzTI16oK7ERQC/rbwjzPzg8s42agR20BbYplYxTkrTeN+DUW+tDMgB+lNban/4jmi9yD j666SzsI4RW2CI6KmFxy6Md02olVoYDAMnI2fVw+F3lEeYID9VM9BhJ0WIUo+e70Xxs7 GuDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783331082; x=1783935882; 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=BraaY1qC7HOBXFTxSHCrNc1y8UspO9XuBb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 5b1f17b1804b1-493d11f6f7bmr76574215e9.29.1783331080929; Mon, 06 Jul 2026 02:44:40 -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 v6 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Date: Mon, 6 Jul 2026 10:44:29 +0100 Message-ID: <20260706094430.427155-4-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260706094430.427155-1-frediano.ziglio@citrix.com> References: <20260706094430.427155-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-ebf023/1783331082-77B231CC-B10C79E3/0/0 X-purgate-type: clean X-purgate-size: 1924 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1783331119270158500 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