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

[PATCH 1/2] xen/arm: Fix initrd placeholders generation in make_chosen_node()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 10 Aug 2023 13:25:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=JuleepvHl9watBMb8Yr2FhoB77ZcoX5n+rVEP21MO5Q=; b=alJ8EOZMSn5PWrV6MrHkRx6IDqSBCx2urwD9tKGpwRTnZOWo67XIjgckIT0k+EeAq+Yge28IWFWwoqEf8nQrBRQhfARF7VkBt9A3HPbHsyYswVXKQ6qO9Rty5E5cYg50M64mn4serMtr5f3aRcE2vpkCbRli2vASP04Q3e1WypEuANNxFqEHh4WttPSoDyDXP6VGKM6regp+EbS4FjP19vnT0rdIm1uQQoWt2BsixPvqWvdQBw9YI11/doBDn8QXni8zKGnWCKJ6M1FE1f8mS6JDJaIcYohdtKJKFoElZuxV8TtRX2bnSqywa8UtiM6arxgXz2iy4lbnXZa56/Q8vA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PKp0N4KbQrOEtlgL4PD8o14PHKvZt2JlxB801L+XxBuY8V+ZdHIBdQr5d59CMIpb9AA37NlEOre3hZp5AsVJqWtxFVWECUXwDTTJE9bB3Litylw22DUe4mfdGpBn8nEfbz70n6UFQBemjKes9A2xBjRW5s2jMONlkpibuGvzeqyO6mZ7e0PXPclYCtvv39L701ZbVIiO2Wfa7RtdooTjPn08I4NOm8YrEyvhkd32+Hy8mNgc8B6SdEBvJ8P9KmpKApuAwi2E4JOScl3dEWAyLF124TmdPwbeFcwYoSILk6e2Y/HsxBxYFpYMqD3y9rcE5i7VSvvbJWTn/ThMQRsCWg==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 10 Aug 2023 11:26:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When booting a dom0less domU without initial ramdisk, it was observed
that Xen still creates empty linux,initrd-{start,end} properties under
/chosen node. This is because in make_chosen_node(), generation of initrd
placeholders (later on filled with the real values) is protected with
a check for presence of kernel bootmodule (always present) instead of
initrd bootmodule. Fix it along with renaming the variable from "mod" to
"initrd" to prevent similar mistakes in the future.

Fixes: 48f4bf6bdeb4 ("arm/acpi: Create min DT stub for Dom0")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/domain_build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 39b4ee03a505..c6881de8bd85 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2256,7 +2256,7 @@ int __init make_chosen_node(const struct kernel_info 
*kinfo)
 {
     int res;
     const char *bootargs = NULL;
-    const struct bootmodule *mod = kinfo->kernel_bootmodule;
+    const struct bootmodule *initrd = kinfo->initrd_bootmodule;
     void *fdt = kinfo->fdt;
 
     dt_dprintk("Create chosen node\n");
@@ -2276,7 +2276,7 @@ int __init make_chosen_node(const struct kernel_info 
*kinfo)
      * If the bootloader provides an initrd, we must create a placeholder
      * for the initrd properties. The values will be replaced later.
      */
-    if ( mod && mod->size )
+    if ( initrd && initrd->size )
     {
         u64 a = 0;
         res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
-- 
2.25.1




 


Rackspace

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