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

[PATCH v4 16/44] x86/boot: introduce consumed flag for struct boot_module


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 30 Aug 2024 17:47:01 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725054479; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=bVRjWgn0rJXMNoedI0B0emnthNEBUMt5tP4JhrqFCck=; b=PoQmeXORo1oDLnmlw1vnvJyFufOxxOybxKsklwFZN730rSXEQ6rEE98TEymWkStYuD+Cl/wgsTAFFX3eP5c94pZuY+VhSS2vWYeF9KVEjsE/F2fIzVhutZ5JIdzbjkiNApzQTzgVDcrxvMyP8EmLhLHE9a44cqO+si9ILezEWi4=
  • Arc-seal: i=1; a=rsa-sha256; t=1725054479; cv=none; d=zohomail.com; s=zohoarc; b=Ru3p5X5v6TlDJEMWI+9LyYX324Xjv8m84ceJlv3IYp+7xQzTqB/gdRUrXVNf6MFRUQok2KtkRl0zCj0kzNQJuhfKPwvXF9dOMLPtrz0oAy+QeIbYkSPshMJoxPWxAKM9HKF1/rLZlGV2SMRDdZo+RYyEP9ECLLymkgau2zf6bAA=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivered-to: dpsmith@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 30 Aug 2024 21:56:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Allow the tracking of when a boot module has been consumed by a handler in the
hypervisor independent of when it is claimed. The instances where the
hypervisor does nothing beyond claiming, the dom0 kernel, dom0 ramdisk, and a
placeholder for itself, are updated as being consumed at the time of being
claimed.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 xen/arch/x86/include/asm/bootinfo.h | 1 +
 xen/arch/x86/setup.c                | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/x86/include/asm/bootinfo.h 
b/xen/arch/x86/include/asm/bootinfo.h
index 99f8c9b83b25..740308693629 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -26,6 +26,7 @@ struct boot_module {
 
     uint32_t flags;
 #define BOOTMOD_FLAG_X86_RELOCATED     (1U << 0)
+#define BOOTMOD_FLAG_X86_CONSUMED      (1U << 1)
 
     paddr_t start;
     size_t size;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 0b6bde9ce7e3..da75dfce083d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -320,6 +320,7 @@ static void __init multiboot_to_bootinfo(multiboot_info_t 
*mbi, module_t *mods)
 
     /* map the last mb module for xen entry */
     boot_mods[info.nr_mods].type = BOOTMOD_XEN;
+    boot_mods[info.nr_mods].flags |= BOOTMOD_FLAG_X86_CONSUMED;
     boot_mods[info.nr_mods].early_mod = &mods[info.nr_mods];
 
     boot_info = &info;
@@ -1212,6 +1213,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
     bitmap_fill(module_map, boot_info->nr_mods);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
     boot_info->mods[0].type = BOOTMOD_KERNEL;
+    boot_info->mods[0].flags |= BOOTMOD_FLAG_X86_CONSUMED;
 
     if ( pvh_boot )
     {
@@ -2100,6 +2102,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
 
     initrdidx = find_first_bit(module_map, boot_info->nr_mods);
     boot_info->mods[initrdidx].type = BOOTMOD_RAMDISK;
+    boot_info->mods[initrdidx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
     if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
-- 
2.30.2




 


Rackspace

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