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

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


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 7 Oct 2024 17:06:27 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=w/jLrYv6sruhQhCvgUJhLINQZL/WmccbcXi5xSDIPKI=; b=GKrBLfHbpBCYZCauMdquTAmb84o0pHEu06JN6PqQ9r0BQcGFDNdpDY5FIMx7m61gCFAud5l9AwlUB2E0AYDfDM5uPCwdoKtwvt+rG1AtjyYyXSjbRrTTsQtDPvvf2wHePtr679PTn1vf8n1TS+CNwyE4dAhdez9GQisse74wmZoDcjfB9T2eF5aWz0JsOAQbElaXtqydvwRGN+CLFS33iJQfDFJa7QCY6L8xICna4IQNJ9H4JUzGBpP5ySv5wXmafMaiI5qys6uvz0/iMNAZ17ZYxMF8qg8V177EVKAo+peXuVflc0WAWGWoq4qa8t1UpKE4HmtdhsSNFWHKPF8gcw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e4dU5kKLDEhQaq6NYdB1hqPGA4NcAt6XaqDXZeIXzg0+bSkJt5mTOj6xQYrOiQrBYBv9Ev2/bVsDIU3cl+Kvr5rEviDEIZbA+RPq9g4NJFrcVjXCjsiNybPZNaXrz654z4tediY6n45wzvNyznBEMeHKM6ZeyNmzEt4I7CFnz4NioSnkuTeBtW+A2zo6dKQqjXsH9ITzDrUOD/pgWjGJaOGQj0ziQ4RxJPfWIfS82YZWuliCWMyqrSOtg28GF98VBePmh9baebWiZ9isBs0JqVIa7i8iKS9f3XehrU01/udkPThzStOBu/vDb6Eg7gcNcd26hikAr+KltPmHaRl7Hg==
  • Cc: <christopher.w.clark@xxxxxxxxx>, <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 07 Oct 2024 21:06:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-10-06 17:49, Daniel P. Smith wrote:
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;

I think these first two can be straight assignments since they occur before relocation.

      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",

This one is after relocation, so |= is necessary.

Regards,
Jason



 


Rackspace

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