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

Re: [PATCH v6 14/44] x86/boot: introduce boot module interator


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Sat, 19 Oct 2024 08:04:40 -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=1729339483; h=Content-Type: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=MOwM/LbPXEACamzONVfkb7fee3UcYZJYnIGCl3yxkkY=; b=JFm1s9KxmwwFIhT4xt/lgkcGmOoILFVX//KJePtPdj1EX2+cIOB943C1Q8lyXckUp7lc+S1Zy6KqreitxsZ/sQ2ftIkRbOZpioksrLvSbKtaofl4HMdPr3qSKXkcYcf0vOIiqSeRqJDIjcyozlVUAWzwoudbqlybDLU0bP2SGWg=
  • Arc-seal: i=1; a=rsa-sha256; t=1729339483; cv=none; d=zohomail.com; s=zohoarc; b=X62RzoancnBFF5utUmqIp2FG4K1vzb9kAgJMnIRbPR+P7BQvktlc0qJ9my5YLE5hzzG3XelQkvnJv/9U6nq2UmYJefbzSo2WE0uv4Jihea69dR8ev3DhWinpHG7DUN3L5uGTF7riCKjjfV0pS4Oq5LhjZMbgffQpoDCztlgIT7g=
  • 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: Sat, 19 Oct 2024 12:04:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/18/24 10:09, Jason Andryuk wrote:
On 2024-10-17 13:02, Daniel P. Smith wrote:
Provide an iterator to go through boot module array searching based on type.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
Changes since v5:
- documented help next_boot_module_index
- switch to unsigned int for next_boot_module_index
- changes identified that BOOTMOD_XEN was not supported, so added support
---
  xen/arch/x86/include/asm/bootinfo.h | 29 ++++++++++++++++++++++++++++-
  1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 5862054b8cef..3010e6f4af9c 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -62,8 +62,35 @@ struct boot_info {
      struct boot_module mods[MAX_NR_BOOTMODS + 1];
  };
-#endif /* __XEN_X86_BOOTINFO_H__ */
+/*
+ * next_boot_module_index:
+ *     Finds the next boot module of type t, starting at array index start.
+ *
+ * Returns:
+ *      Success - index in boot_module array
+ *      Failure - a value greater than MAX_NR_BOOTMODS
+ */
+static inline unsigned int __init next_boot_module_index(
+    const struct boot_info *bi, enum bootmod_type t, unsigned int start)
+{
+    unsigned int i;
+
+    if ( t == BOOTMOD_XEN )
+        return MAX_NR_BOOTMODS;

Your earlier patch "x86/boot: convert mod refs to boot_module mod" put xen at bi->nr_modules.  You'll want these to match.

Yep.

v/r,
dps



 


Rackspace

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