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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Mon, 22 Jun 2026 16:18:32 +0100
  • 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=6eteaBeiMzsuqrMWkmjhp+ii2ze54srInlQVvwTckyo=; b=JbzOvB7okD7Ft4vSVjrrAJewxGHTjL77GY45SduYecB0OUO4WSqAzfcvIHqogjD2ZMUU3xGa21HntjqRYqvg/ONrw1VaqT0b6FzIpC6TcRrCWcHN0VIkBNTqVpjZJRfi81H7bjuV5lCU3qBsdSrnA3FXTDGWYGeJrASchHPhq4t0pWAbuxlYHr6EIDoQKqvectE5G4LNq2eAyOuM5wxtqjneiUGlZ8O0fFn9kam+qCcrJxLchNPoGJGz9jxfcjwxEvWCCuzaXQR7r+jBp6SJEJHABzk0ygLZPpnsWx4e3ys5Zdh3Uu5Fu6ieY/5FpFLD8wrrcW6XdNv6a1FUpzSmPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qmiDqyb9GoAiYoUjjeO2g1/IqKUoTE7zfc7yF90FrmPtt1v4gEzAyG21ctOUpmjc6nh+u8lvGjcBurOd5IZT/6w6J1b7hupngUhGGTB91YNLCAoK4/Pwp26rr7eJZu8YVvkOxRKWssuCHqIF/JvPOhr84wVuUwYV/ISNBZcEas2g33zA3PsY3APhuyifb2t6k3oovsLa7GziU2uJIoYCNJnfZiUm+VMKtkkl79m6lW1O8sWfjFMxUUvz56XEVenEH4gcxc34glMoEavsv5RKt30Z7Y/bq253aqb5BMgJ9jJToNBRr+jfMiF62WYS0aLw1B79Kh/BJeTj2EIu/sQN4Q==
  • 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: jbeulich@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, ross.lagerwall@xxxxxxxxxx, Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Delivery-date: Mon, 22 Jun 2026 15:17:47 +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 3e189acf24..010e0c7046 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 f921eec5aa..03776f4723 100644
--- a/xen/arch/x86/machine_kexec.c
+++ b/xen/arch/x86/machine_kexec.c
@@ -198,7 +198,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 b52d31a654..ab9fa7f2b8 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -33,6 +33,7 @@ FUNC(kexec_reloc, PAGE_SIZE)
         /* %rdx - indirection page maddr */
         /* %rcx - entry maddr (%rbp) */
         /* %r8 - flags */
+        /* %r9 - entry arg */
 
         movq    %rcx, %rbp
 
@@ -71,6 +72,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®.