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

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


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 25 Nov 2024 18:12:26 -0500
  • 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=mHRqSmZ63PNFzToCaS6V3geseK8g2UrZqo9L4RjURac=; b=ixQs6TARl5aqLuvVwG4A4MBGV+iYM+zaztyCwoH1XFfeMJNDwi9Q9w+/R4mWEQkKJltbmBrVn+daSS5+C2UFfQcuOJf6jgInO8dd8QsTe9DShmvzjYUeTDRw/53FpxBWoPLAQUVb6NDc1+gjy56wrtuHDl3bKciYyJc2tgHDqidrUZZc0IpqlXkqqMvei+xMCnTpyOvYAQNREaO7KsepbPdUPeNKESFhqVFmVYUDTSUOL8Pyi4i3BfEENLErsvJfNl/uGilnEalYV8l8ZF5oScLtwcKINXMlxJk4ajvByMfqt+oHNHXVIxd4Zt1CCVBy6mUK2W4b87esXbikn4GYZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S98IAb8s77rrsU69amP2A1Qumla6FbP7/yDbywqSlFbVHuDnz/LYmkNoCNaDpBcjYmBLrw6yHGWtLsTM2E0+dYfEZ3egCNdKHWXBUID2FW/GrcoYfFi2COY0iaz3eu/EwhTpmtMgKrhHQ+deoiGvdPDy7HYPyeVa9d/1PidGR/bRc1Gu9B2BYNzhEbWrdke15/HsgVMorWP+QJKHhb9YdgQiXYVnH5qdkWkx8ONZqKz4IJQ+x59WEXRlYh2+dB2PyR1qW8N0+3O369uqN5Ktkc0rzqqCeaeEDtnTxsCQoNh75xPuOhy0FXiOcepG7qGuUiieL1RyZ79tzA3BUNYEJA==
  • 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: Tue, 26 Nov 2024 00:54:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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().

+    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>

Regards,
Jason



 


Rackspace

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