From nobody Fri Dec 27 12:35:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=dpsmith@apertussolutions.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=apertussolutions.com) ARC-Seal: i=2; a=rsa-sha256; t=1732386643; cv=pass; d=zohomail.com; s=zohoarc; b=PNdeHcx/KmieeWB3GkI4nlXsxMJDC2LWWwXuG/Ik4/ipZXI5B2qxM0knLmnx94stBd9P7ckRaeCzwVcq5QzeNHgurp3uOdN9THHa82UpT1p88SXIr2O5uaZYZh8gPffDspRjjf7QOfY1xkEwxFU3sdRnYehmJMdJoJqLEHj3B4A= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732386643; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=scVK3BeFw1PvCPw+5+IJFV23lyxFsbSuS2LWmdnsIGU=; b=LdNroZAQ/mCZMSE9bLFOXn9n9UaP7fV6kEJDjOtZ+pM9QWvMdEHxmNPZLjv28pPURMRufF7qQhRhHfmTzCXUktt2hHW0Kbas6n0HWglFjtcPTNEsgqqycG7Sc2ei4dYZtxD9OO7aO5Pzn37zxdnBm8MC7DUo9CBtGlnIv9MyluY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dpsmith@apertussolutions.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=apertussolutions.com) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1732386643341289.8972624403757; Sat, 23 Nov 2024 10:30:43 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.842162.1257613 (Exim 4.92) (envelope-from ) id 1tEutr-00027W-Oj; Sat, 23 Nov 2024 18:30:31 +0000 Received: by outflank-mailman (output) from mailman id 842162.1257613; Sat, 23 Nov 2024 18:30:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tEutr-00027E-Ky; Sat, 23 Nov 2024 18:30:31 +0000 Received: by outflank-mailman (input) for mailman id 842162; Sat, 23 Nov 2024 18:30:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tEumZ-0006MT-Es for xen-devel@lists.xenproject.org; Sat, 23 Nov 2024 18:22:59 +0000 Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f5953219-a9c7-11ef-a0cc-8be0dac302b0; Sat, 23 Nov 2024 19:22:57 +0100 (CET) Received: by mx.zohomail.com with SMTPS id 1732386068616924.1851128683724; Sat, 23 Nov 2024 10:21:08 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f5953219-a9c7-11ef-a0cc-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjEzNi4xNDMuMTg4LjUxIiwiaGVsbyI6InNlbmRlcjQtb2YtbzUxLnpvaG8uY29tIn0= X-Custom-Transaction: eyJpZCI6ImY1OTUzMjE5LWE5YzctMTFlZi1hMGNjLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyMzg2MTc3LjIzOTQyNiwic2VuZGVyIjoiZHBzbWl0aEBhcGVydHVzc29sdXRpb25zLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 ARC-Seal: i=1; a=rsa-sha256; t=1732386073; cv=none; d=zohomail.com; s=zohoarc; b=O2H3MgRv1sOoO7bTYKOWHf8SEqYjZeaNb5QEwUVLaWUHqNNdDCPCkbuqq7zVs3nu6PG9d4gvzo06ME8I+UxlgNFoYKpGzAyC5GvNutgNa0XxQvhYdrcqb9JvRZTpbuPUO/SXy26XlYLfZ83UtkbFH7YSHKZzbGxJCN/v4ZtGOTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732386073; h=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=scVK3BeFw1PvCPw+5+IJFV23lyxFsbSuS2LWmdnsIGU=; b=WAGg98RlGwHi+eBGWTjI5a90lKB1xyPtHab/BmbdRdNDmBkc2ksi57bRXLazi/m4ff9ELwyyHl4/Ij/c+m++6+oWEndd2qHJ7NB1dORxkfkW5stb0qJm4656027ZhFe0bp5k3ZANNRXojTTbzl8LM9BxHp1xi/NaqKQ6wlb5k1s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1732386072; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=scVK3BeFw1PvCPw+5+IJFV23lyxFsbSuS2LWmdnsIGU=; b=oPaf+LuNH1U8j4O9iPJgi844HDJIy9ob5SKz5Wr0pVlo5NtUYgxp5NElWPVH7fAA FisYz8cvC9diNy6SLXC1e904Q0zFGaGpeRViEXaTfmp8xA1xAV41cn9yY9CCghsXbQS ZSs1/rXeeu3zWQmXY0rxYLbDxTu9czevbKf5RQiA= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, christopher.w.clark@gmail.com, stefano.stabellini@amd.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 10/15] x86/hyperlaunch: locate dom0 initrd with hyperlaunch Date: Sat, 23 Nov 2024 13:20:39 -0500 Message-Id: <20241123182044.30687-11-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241123182044.30687-1-dpsmith@apertussolutions.com> References: <20241123182044.30687-1-dpsmith@apertussolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-ZohoMail-DKIM: pass (identity dpsmith@apertussolutions.com) X-ZM-MESSAGEID: 1732386645871116600 Content-Type: text/plain; charset="utf-8" Look for a subnode of type `multiboot,ramdisk` within a domain node. If found, process the reg property for the MB1 module index. Signed-off-by: Daniel P. Smith --- xen/arch/x86/domain_builder/fdt.c | 25 ++++++++++++++++++++++ xen/arch/x86/setup.c | 35 +++++++++++++++++-------------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/domain_builder/fdt.c b/xen/arch/x86/domain_builde= r/fdt.c index f8ddb11b339e..bc8054a80ec1 100644 --- a/xen/arch/x86/domain_builder/fdt.c +++ b/xen/arch/x86/domain_builder/fdt.c @@ -152,6 +152,31 @@ static int __init process_domain_node( if ( ret > 0 ) bd->kernel->fdt_cmdline =3D true; } + + continue; + } + if ( fdt_node_check_compatible(fdt, node, "multiboot,ramdisk") =3D= =3D 0 ) + { + int idx =3D dom0less_module_node(fdt, node, size_size, address= _size); + if ( idx < 0 ) + { + printk(" failed processing ramdisk module for domain %s\n= ", + name =3D=3D NULL ? "unknown" : name); + return -EINVAL; + } + + if ( idx > bi->nr_modules ) + { + printk(" invalid ramdisk module index for domain node (%d= )\n", + bi->nr_domains); + return -EINVAL; + } + + printk(" ramdisk: boot module %d\n", idx); + bi->mods[idx].type =3D BOOTMOD_RAMDISK; + bd->ramdisk =3D &bi->mods[idx]; + + continue; } } =20 diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index fda4fc71e205..eaac87b02f78 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1094,7 +1094,7 @@ void asmlinkage __init noreturn __start_xen(void) char *kextra; void *bsp_stack; struct cpu_info *info =3D get_cpu_info(), *bsp_info; - unsigned int initrdidx, num_parked =3D 0; + unsigned int num_parked =3D 0; struct boot_info *bi; unsigned long nr_pages, raw_max_page; int i, j, e820_warn =3D 0, bytes =3D 0; @@ -2137,22 +2137,25 @@ void asmlinkage __init noreturn __start_xen(void) cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ", cpu_has_nx ? "" : "not "); =20 - /* - * At this point all capabilities that consume boot modules should have - * claimed their boot modules. Find the first unclaimed boot module and - * claim it as the initrd ramdisk. Do a second search to see if there = are - * any remaining unclaimed boot modules, and report them as unusued in= itrd - * candidates. - */ - initrdidx =3D first_boot_module_index(bi, BOOTMOD_UNKNOWN); - if ( initrdidx < MAX_NR_BOOTMODS ) + if ( !bi->hyperlaunch_enabled ) { - bi->mods[initrdidx].type =3D BOOTMOD_RAMDISK; - bi->domains[0].ramdisk =3D &bi->mods[initrdidx]; - if ( first_boot_module_index(bi, BOOTMOD_UNKNOWN) < MAX_NR_BOOTMOD= S ) - printk(XENLOG_WARNING - "Multiple initrd candidates, picking module #%u\n", - initrdidx); + /* + * At this point all capabilities that consume boot modules should= have + * claimed their boot modules. Find the first unclaimed boot modul= e and + * claim it as the initrd ramdisk. Do a second search to see if th= ere are + * any remaining unclaimed boot modules, and report them as unusue= d initrd + * candidates. + */ + unsigned int initrdidx =3D first_boot_module_index(bi, BOOTMOD_UNK= NOWN); + if ( initrdidx < MAX_NR_BOOTMODS ) + { + bi->mods[initrdidx].type =3D BOOTMOD_RAMDISK; + bi->domains[0].ramdisk =3D &bi->mods[initrdidx]; + if ( first_boot_module_index(bi, BOOTMOD_UNKNOWN) < MAX_NR_BOO= TMODS ) + printk(XENLOG_WARNING + "Multiple initrd candidates, picking module #%u\n", + initrdidx); + } } =20 /* --=20 2.30.2