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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Tue, 9 Jun 2026 16:45:17 +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=gPg+TWxKIYR7XaCE1xZJb8H3djSCjAFUgUsgKxDPc0Q=; b=Wdq3I/dtHErL1WORbMkdJOYKNj32oSpS/JlTbP4yTt8mDvHb9yZtbZL+URct0Nz6TdAnM8YBrnhCWoqbvTV8l001daCGxPSVb7S5dxJ+CAtGzGm3xfMGWzd3MHeGWLkoPZG/UlfBhWGwl/iuZcm7xQB59TSiACV2h2rl/ZZxYJrqVbQon8T0BYVsmz3i6XdWfEfyKnaLo8zWgFNFfdByHSEnzY+pHoHSiM43YhrcNVGZijspCJ6o6hHdrcdJpp/vTpLrRqxGz/aN2GGCjEx1jKyOZXsa12WpyNNzy03UKbi28qYVl4DB/2JFZWqPocEi3bUElBgSiRTy8YzOABZWNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JTlUq2fUM2pnEw3KtFzYEzVleFHXKR/6jzCEsIu/Gcnw/zPebGO+wU8QZwLsUHMlhbrvzGbd0YBi8lvBOtB4UKIBiNRD4rwyvUoRozOVJYTv3f2O+fiCns+82+tF6VPvDgxFoFey9ZMmqZv4n6OTAzOS1S3yOVnTbOtww3s7Bw7OOAPfh0ESzBDDXAC2sjuj1BkUNupKVFU1Wak3teseqYxEcjKFkJQuWrtZaH/gRXXUhOykStUGQSMsoRu7L85NLlCYv9ifr46SPTA37XVz3cS4YlAN+YyOT1t/aOpZubxwxRkd6PzBMDYEUJoxNZKrtHvK64uEXKOOtIAImoAiLg==
  • 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, Kevin Lampis <kevin.lampis@xxxxxxxxxx>, Kevin Lampis <klampis@xxxxxxxxxx>
  • Delivery-date: Tue, 09 Jun 2026 15:45:26 +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 <klampis@xxxxxxxxxx>

---
 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..2edc1bd0af 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->boot_params);
 }
 
 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..6a2c839b83 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 - boot params */
 
         movq    %rcx, %rbp
 
@@ -71,6 +72,8 @@ FUNC(kexec_reloc, PAGE_SIZE)
         movq    %rdx, %rdi
         call    relocate_pages
 
+        movq %r9, %rsi /* boot params */
+
         /* 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®.