From nobody Mon Aug 24 11:03:21 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=1783334806; cv=none; d=zohomail.com; s=zohoarc; b=kcvPewAllCQQe6YRr1VVP2l6o4QpNT3x5Kwcur+blldk67wVwlZj/2SQy8uz4vepGvf8h97b4y2SFQv5BOSBCCH/L4NPgwCNv2IA3DpgsHZsX43nRuBvuguzHwztaN/w6Cv6wIhbIOcuuVMbXqmLSN6qfxtKD720GcYPXbvur7k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783334806; 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=R8IgJz5YVmz5IpcGDcJICbBIDeI5zvAX/8CNu+XO66oZxCX/Qj/3XUQVTwk2V+hj3zu6LubWiSP1xtZnPEa0ApZJxFuDONnpZ8s1jepaAaTdkd77tQKrT6S1777G/wKMQzATLDnapKQIul9cZ234ZmvfWAxml7Eicxo5xxKHVwY= 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 1783334806890764.444542289033; Mon, 6 Jul 2026 03:46:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1355304.1610079 (Exim 4.92) (envelope-from ) id 1wggq2-0002f4-74; Mon, 06 Jul 2026 10:46:10 +0000 Received: by outflank-mailman (output) from mailman id 1355304.1610079; Mon, 06 Jul 2026 10:46:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wggq1-0002dl-VD; Mon, 06 Jul 2026 10:46:09 +0000 Received: by outflank-mailman (input) for mailman id 1355304; Mon, 06 Jul 2026 10:46:08 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wggq0-0002UB-Te for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:46:08 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wggq0-008v6e-A4 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 12:46:08 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4b8769-5cb7-0a2a0a5109dd-0a2a45029186-26 for ; Mon, 06 Jul 2026 12:46:08 +0200 Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a4b8770-5a27-0a2a45020019-d155802ba82a-3 for ; Mon, 06 Jul 2026 12:46:08 +0200 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-493b27c7451so34907015e9.0 for ; Mon, 06 Jul 2026 03:46:08 -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-493c63ba97csm349823985e9.12.2026.07.06.03.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 03:46: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=1783334768; x=1783939568; 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=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=; b=dBmh5XMP7MOppMWRL6M1dvW8MkO2W9q1yKB5m8iPiQCLGtqGTAfT7sCPrxzJ5KhL5V eZXuL/S24r4X9jILGkqeqWXUAtPeQT5N9h1xELsqYZY3XPzcs9Rl4LI+29CHK5fFGYcI kYoW5GFjaqwVPd4Ga+iIIq/40EM/cbr6iz+G+Hj9tqA64gEVdhz5LWEZXRNS7zSTJdNQ uJMcpVuol44U8bDQAMnMj9Gv6D4X4BwUvrFF5Kzs4Heq1MEz17SPgKQZ2sPQysQRIzsb cdn5run4/FFEncseafTz6jW+AMkVQQYUNolu5RDo/MS+HUU12fLZ631x5qpUAgANm3X8 Dk8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783334768; x=1783939568; 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=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=; b=XSAtulQ0RWhE6qZZDPkAsvuGPdS3jR63E7XyJQrhSEsbKzJPo0nEtGvsbQGA2g9EFj PlBPfbQleTZyLXcrHOvXzA0apuo38h7NAlus3k3EAWTEpBe/Owe2EFUz2XBrUYlzst25 WtDgB9vo6riiyTscowa5YbkgztbN6KDBu+XMlUbH76hcYnctAmerz/3P4lKPbkuckzcz HMSya5X+ynZt8RBXOmwxwQK9KLjcVEKtOhnz4ok0Mcg5Tj3f+7zRImbX7G0Ug82EbpmH NIjayXUW4Seiqug+34PFH1DEZQqc5C62Bdbc3XYTABzS99h5BssW7KvFWD9kX/lqi+ar zxlQ== X-Gm-Message-State: AOJu0YwnyFK9q7EUw+U3JJoj2kiCFPppxnTseg5Q4VCK0+GatLnXO+Hp efnBhgCw9hBNk1cOzAgl5iECd1wS9oI4FxXqlOu6zZdjlLfyxat9Hfky2eIR81bpRaw= X-Gm-Gg: AfdE7cknSL2SZ040ub6XfwIv6l/FrGYme/nX2PCmYRZIgat4wv3fcyaU4QCEKRfjSmc qlzdcm3DiNjS33evP02A3Iy3gmFNJ+OcDkpXlELtmXh4iweZvVAPXXYlZBsj1AyaYh7oXzJJ3E/ EO7VWYB7rnEJB6vYobbZf2Qu5mdcm2glTKRfb167tl+lyLQ+Q72SsWvCfScwi3kysruhGFDE4IK 1MmJjFlW92UbhI6ZilkXVoO0FDddZf0WaIF8KfUxIdjvWbsjAPw8y/oCz/scc1QPWHEL5EkcjPW H7tp0kpVufk588ZUD6TeLeotXZn5LThqyKpVSNHRdUHhYDn3oCmLShCfPQgpBCfmWwalgxD9av1 0TrTahzByKB+o1ulOuQBY4u8EL52Jq7Gt9EqCqkgEYxox5mmY6KH/JdUWRNS2+Vsg75ybMK6m6+ VxWGPmJNKWMrMmE4m9UGd5eMuJgXZRZgJIhveWEb5IojogkJJTlZJz8T5qNuESvdW61JQkbJ20Y GJZE21xXRxEag9fyIY= X-Received: by 2002:a05:600c:4ed4:b0:493:c600:e1a6 with SMTP id 5b1f17b1804b1-493dece4adcmr1187235e9.12.1783334767437; Mon, 06 Jul 2026 03:46:07 -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 v7 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Date: Mon, 6 Jul 2026 11:45:56 +0100 Message-ID: <20260706104557.430097-4-frediano.ziglio@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260706104557.430097-1-frediano.ziglio@citrix.com> References: <20260706104557.430097-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/1783334768-4E5147C5-3B7912CC/0/0 X-purgate-type: clean X-purgate-size: 1970 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1783334808143158500 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