[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 6/7] x86/kexec: Pass boot params directly to new kernel


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Mon, 26 Oct 2026 09:20:16 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oOjev09aQTNY8dAemGzi70+Y2cPv21By6/8CxrKPdPA=; b=DT1Qlxr0CSd7rlFTdVOeenTQ2GxguDUXjF2WruaqbKdNllPj0rpqWQT8oNiUcX0DYnCivWjzeU0LV52lljj8qfEydvfcPTWq3RJMxuObAh5952Tw2yXmVE9CRp6NiDwwCfhmv2h6uZ5z424pH/ij+5jnGbESenDOPf95M7ZqMs5oOuEZcYpPjSOZhhhKChpy0hI4qJ/dJMrUzz7klIUZn+P0WVcHpe6cKe8/LL8NHLxNvazrjoR5Tv+ohecFBMqn7gVvflNIgfga/JmvLjJeKEK/y4hUuiZvYO7E0LxCeglPrH9OHjsAngz8ucBSGdCnkL+zNi/qLsGaNe7lg9KxdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yKt/e1WNMqd8B57FcOFjSzq+Xr4PeV9GMSWyCPMx1kYlUHYa8M2TmXbKut057el2nXprJLgOD2bwI3Q7lhnasRxoqxamtrk1wW+rFJympdfKS6JpxEvm0bZCDHX3l9tLh26PZLXfOl/GqexFePKKBNgXOcS5QdbI/F4bmGAh8AJoVk6FE8q1gtcSum+D8FqZn17u2LUZIRf1iGDYMZhUTw3n2Y2rlxR/XAIkVvOj8abBm/hoW/G0bMdPv8mc7g9sLflprxeUun7q16FdEen5YZCZHO/qNIv9xZel2/98U0FXEn5Zks0gOGf9/MlaTxX4BuJmphE6ttm1BUeeusQM+Q==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: jbeulich@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, roger@xxxxxxxxxxxxxx, teddy.astie@xxxxxxxxxx, ross.lagerwall@xxxxxxxxxx, Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Delivery-date: Mon, 26 Oct 2026 09:18:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When doing kexec on an EFI image there is no purgatory and kexec_reloc.S
hands off straight to the new kernel. To facilitate this the Linux
kernel boot params need to be passed through %rsi.

Signed-off-by: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
---
Changes in v2:
- Rename kexec_image->boot_params to entry_arg
- Fix indentation
---
 xen/arch/x86/include/asm/machine_kexec.h | 2 +-
 xen/arch/x86/machine_kexec.c             | 3 ++-
 xen/arch/x86/x86_64/kexec_reloc.S        | 3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/machine_kexec.h 
b/xen/arch/x86/include/asm/machine_kexec.h
index 3e189acf2464..010e0c704626 100644
--- a/xen/arch/x86/include/asm/machine_kexec.h
+++ b/xen/arch/x86/include/asm/machine_kexec.h
@@ -7,7 +7,7 @@
 
 extern void kexec_reloc(unsigned long reloc_code, unsigned long reloc_pt,
                         unsigned long ind_maddr, unsigned long entry_maddr,
-                        unsigned long flags);
+                        unsigned long flags, unsigned long arg);
 
 extern const char kexec_reloc_end[];
 
diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c
index 038670922d47..67ca3e09bece 100644
--- a/xen/arch/x86/machine_kexec.c
+++ b/xen/arch/x86/machine_kexec.c
@@ -199,7 +199,8 @@ void machine_kexec(struct kexec_image *image)
 
     kexec_reloc(page_to_maddr(image->control_code_page),
                 page_to_maddr(image->aux_page),
-                image->head, image->entry_maddr, reloc_flags);
+                image->head, image->entry_maddr, reloc_flags,
+                image->entry_arg);
 }
 
 int machine_kexec_get(xen_kexec_range_t *range)
diff --git a/xen/arch/x86/x86_64/kexec_reloc.S 
b/xen/arch/x86/x86_64/kexec_reloc.S
index 1d023733a916..0f163862b858 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -41,6 +41,7 @@ FUNC(kexec_reloc, PAGE_SIZE)
         /* %rdx - indirection page maddr */
         /* %rcx - entry maddr (%rbp) */
         /* %r8 - flags */
+        /* %r9 - entry arg */
 
         movq    %rcx, %rbp
 
@@ -104,6 +105,8 @@ FUNC(kexec_reloc, PAGE_SIZE)
         movq    %rdx, %rdi
         call    relocate_pages
 
+        movq    %r9, %rsi /* entry arg */
+
         /* Need to switch to 32-bit mode? */
         testq   $KEXEC_RELOC_FLAG_COMPAT, %r8
         jnz     .L_call_32_bit
-- 
2.52.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.