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

Re: [PATCH 09/15] x86/hyperlaunch: obtain cmdline from device tree


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 11 Dec 2024 10:46:10 -0500
  • 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=1733931974; 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=jZZ4ULguLTW7jlwVwf7sQnKBcPkBv2PSOMsKjNnRy+M=; b=LdsjtHwW2qTGo4Z4drEvt+FDYSG50Ki3OydITkRk+ultpsYWWBjwnvulHEomYCqgVQN3g+Ad6znzXejvBNjzihJwX8XWe9yZzpIzNvsp5WXehFxU2Ici1+r13NJ791jGwdpw5rJIUoMxpox3rinrfXfGVt/eKTN0j0iJhE8ODG8=
  • Arc-seal: i=1; a=rsa-sha256; t=1733931974; cv=none; d=zohomail.com; s=zohoarc; b=mpQs8stcLn/6BtVsQcrvcZN9JW09FG1GNJMJ/fIl5Sy4Ey8Y/aXU56XuUmrolnKKsyanB3977q+t+NFCY4poR1+DqYcrbpXF9YM0CcsvHA3FS6YJmBJX3UKUdX9qs1h0AXld4a+mNnHPxc0rAwmFWkn/+uH9zKwv8d3HfO3NXPw=
  • 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: Wed, 11 Dec 2024 15:46:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/25/24 18:12, Jason Andryuk wrote:
On 2024-11-23 13:20, Daniel P. Smith wrote:
If a command line is not provided through the bootloader's mechanism, e.g. muiltboot module string field, then use one from the device tree if present.
The device tree command line is located in the bootargs property of the
`multiboot,kernel` node.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
  xen/arch/x86/domain_builder/core.c       | 28 +++++++++++++++++++
  xen/arch/x86/domain_builder/fdt.c        | 34 ++++++++++++++++++++++++
  xen/arch/x86/domain_builder/fdt.h        | 24 +++++++++++++++++
  xen/arch/x86/include/asm/bootinfo.h      |  6 +++--
  xen/arch/x86/include/asm/domainbuilder.h |  4 +++
  xen/arch/x86/setup.c                     | 10 +++++--
  6 files changed, 102 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/domain_builder/core.c b/xen/arch/x86/ domain_builder/core.c
index 9335f3a9ebef..95cab06e6159 100644
--- a/xen/arch/x86/domain_builder/core.c
+++ b/xen/arch/x86/domain_builder/core.c
@@ -8,9 +8,37 @@
  #include <xen/lib.h>
  #include <asm/bootinfo.h>
+#include <asm/setup.h>
  #include "fdt.h"
+size_t __init builder_get_cmdline_size(struct boot_info *bi, int offset)
+{
+#ifdef CONFIG_DOMAIN_BUILDER

I wasnted to suggest:

if ( !IS_ENABLED(CONFIG_DOMAIN_BUILDER) )
     return 0;

but that fails to compile for a missing fdt_cmdline_prop_size().

Yes, I wanted to do the same as well.

+    const void *fdt = bootstrap_map_bm(&bi- >mods[HYPERLAUNCH_MODULE_IDX]);
+    int size = fdt_cmdline_prop_size(fdt, offset);
+
+    bootstrap_unmap();
+    return size < 0 ? 0 : (size_t) size;
+#else
+    return 0;
+#endif
+}
+
+int __init builder_get_cmdline(
+    struct boot_info *bi, int offset, char *cmdline, size_t size)
+{
+#ifdef CONFIG_DOMAIN_BUILDER

and here fdt_cmdline_prop_copy().  I'm not sure the addition of more stubs offsets these ifdefs, so:

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks!

v/r,
dps




 


Rackspace

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