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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Sun, 6 Oct 2024 17:49:27 -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=1728251424; 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=rsjinz7BtJ8PUF4bqFrjiANBKB2lhUkIggv9H9Y5wr0=; b=kXenxq/25XZNg6VAiDUYU2cr/yZp0s512PCAb+K53nXBh0byxnHgyNBSahYP1ZH+fH5WMkNHamDAX08LtWSR84NS9N/DjD7q9bFxFaxE8gzNSVdSQksmsrDMUOJBqYIRn4Wx0EkxSLSgkfrCEdXskCqytUbMroS/n5w0BIrztuM=
  • Arc-seal: i=1; a=rsa-sha256; t=1728251424; cv=none; d=zohomail.com; s=zohoarc; b=Cm2yfDgYKVhiWdiJpNXBaqZCh9/wTnSqO8SGzK4i6Z2mEkoDfvn7ZaQtEFd37N1xSBjAiKfMd1b2p5Mg7D1JS9mdth0ESL+yyaBCW3jOP8Rlpf6bBk5DzLR6spYt1rzNg2USfy1EbmK2LdMywHEO220c6vuV/DuOWCPGpocKtt4=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, stefano.stabellini@xxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Sun, 06 Oct 2024 21:52:26 +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 c79678840d31..7833b065eff1 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -34,6 +34,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 4f540c461b26..235b4e41f653 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -318,6 +318,7 @@ static struct boot_info __init 
*multiboot_fill_boot_info(unsigned long mbi_p)
 
     /* map the last mb module for xen entry */
     bi->mods[bi->nr_modules].type = BOOTMOD_XEN;
+    bi->mods[bi->nr_modules].flags |= BOOTMOD_FLAG_X86_CONSUMED;
     bi->mods[bi->nr_modules].mod = &mods[bi->nr_modules];
 
     return bi;
@@ -1196,6 +1197,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
     bitmap_fill(module_map, bi->nr_modules);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
     bi->mods[0].type = BOOTMOD_KERNEL;
+    bi->mods[0].flags |= BOOTMOD_FLAG_X86_CONSUMED;
 
     if ( pvh_boot )
     {
@@ -2085,6 +2087,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
 
     initrdidx = find_first_bit(module_map, bi->nr_modules);
     bi->mods[initrdidx].type = BOOTMOD_RAMDISK;
+    bi->mods[initrdidx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
     if ( bitmap_weight(module_map, bi->nr_modules) > 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®.