From nobody Mon Feb 9 05:46:17 2026 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=1735233052; cv=pass; d=zohomail.com; s=zohoarc; b=n8cUC3PtTIjFvonIhvicbSshTvZc+pTAT+iLK9uBQJ+WfzNyEPO8eX8FXfqyXrIIw5G/i2n0Yrmb09o3EbisNDYw2jl5yLD4s6fQlRHZO8Q9Y+1w4ADwbAYZspXBkFCe/6xnkCBRJkGqzjjhiyQBpUnPire8z9RoqL9nfuivhA8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1735233052; 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=hXdbAJzSfNTcSeY3krNKNli9zbh1A0XPeYZ31pxiNfM=; b=OLw5MN9zH2+YeehnO6aPWKaNLuI9AuY0vwN180vPjj7sBihpQf3gTwj9BNP8pbNps/v6z/ZO1suO0sBUraY/Miy+kIVgpzEmUfCi+vRfv6ynNu+RTr/JU5CiyNFYwycuDqMMGYw3NSbbIc4tH1l4dMZeSLztencX+Udit/NJbqE= 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 1735233052316933.911003732535; Thu, 26 Dec 2024 09:10:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.863332.1274788 (Exim 4.92) (envelope-from ) id 1tQrNX-0003Yh-4R; Thu, 26 Dec 2024 17:10:31 +0000 Received: by outflank-mailman (output) from mailman id 863332.1274788; Thu, 26 Dec 2024 17:10: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 1tQrNX-0003Ya-09; Thu, 26 Dec 2024 17:10:31 +0000 Received: by outflank-mailman (input) for mailman id 863332; Thu, 26 Dec 2024 17:10: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 1tQrEE-0005x0-Te for xen-devel@lists.xenproject.org; Thu, 26 Dec 2024 17:00:54 +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 f7093153-c3aa-11ef-a0da-8be0dac302b0; Thu, 26 Dec 2024 18:00:54 +0100 (CET) Received: by mx.zohomail.com with SMTPS id 17352322892101014.8069874254229; Thu, 26 Dec 2024 08:58:09 -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: f7093153-c3aa-11ef-a0da-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; t=1735232294; cv=none; d=zohomail.com; s=zohoarc; b=bEsb+5V8TjawamDf4z6EdBZYmMuMB8eV7fPNaaqsUTzeVgaDz+pQvztXqs8r6j8ey2D495Jd9DFUjQcv47Pb173T5J1wycjQXE0jjuSKFgCx/5RtiixRofKtLtFPnM9JrEKNDhie4HW03G0U880Gw1bzqp3ubiuXRtLi3taGa80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1735232294; 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=hXdbAJzSfNTcSeY3krNKNli9zbh1A0XPeYZ31pxiNfM=; b=KkNlPFMSTV2k0JrSlbRi5SCLP6+BFG2AWtz5PGLF/o4GVKgjMb7wFOczd4h8hjLmrsr/fxS1kmdC9sYhsCdeUalbRqckAL7XHGnpZS3ZfSqVv9Ap7VelpXiYwA3ZOBwHHbhdqqajmuQtHC6tM+tiZd5PX+ZFERXjJiNRxkO/d7Y= 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=1735232294; 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=hXdbAJzSfNTcSeY3krNKNli9zbh1A0XPeYZ31pxiNfM=; b=AHp9SqhMtXqFD/cwJHnmmy7w3dsFJpdG7fYX8NpgqugAiE3wa77MNYfsMaUmG39K EEoquxwGq46Tw4XuicLIogV4X9FfI9NdaMOTtIKbCILQkXynSrZqWm1bsg9MUB5be3R E7KN2YQ3/kU+BnQRaGmzSar8VAgiMYxtPNSXci68= 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 v2 14/15] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree Date: Thu, 26 Dec 2024 11:57:39 -0500 Message-Id: <20241226165740.29812-15-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241226165740.29812-1-dpsmith@apertussolutions.com> References: <20241226165740.29812-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: 1735233054488116600 Content-Type: text/plain; charset="utf-8" Introduce the `cpus` property, named as such for dom0less compatibility, th= at represents the maximum number of vpcus to allocate for a domain. In the dev= ice tree, it will be encoded as a u32 value. Signed-off-by: Daniel P. Smith Reviewed-by: Jason Andryuk --- Changes since v1: - switched from match_fdt to strncmp - switched to nested else if - dropped ternary for name selection --- xen/arch/x86/dom0_build.c | 3 +++ xen/arch/x86/domain-builder/fdt.c | 11 +++++++++++ xen/arch/x86/include/asm/bootdomain.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 1c3b7ff0e658..7ff052016bfd 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -617,6 +617,9 @@ int __init construct_dom0(struct boot_domain *bd) if ( !get_memsize(&dom0_max_size, LONG_MAX) && bd->max_pages ) dom0_size.nr_pages =3D bd->max_pages; =20 + if ( opt_dom0_max_vcpus_max =3D=3D UINT_MAX && bd->max_vcpus ) + opt_dom0_max_vcpus_max =3D bd->max_vcpus; + if ( is_hvm_domain(d) ) rc =3D dom0_construct_pvh(bd); else if ( is_pv_domain(d) ) diff --git a/xen/arch/x86/domain-builder/fdt.c b/xen/arch/x86/domain-builde= r/fdt.c index aff1b8c3235d..70a793db199b 100644 --- a/xen/arch/x86/domain-builder/fdt.c +++ b/xen/arch/x86/domain-builder/fdt.c @@ -147,6 +147,17 @@ static int __init process_domain_node( bd->max_pages =3D PFN_DOWN(kb * SZ_1K); printk(" max memory: %ld kb\n", kb); } + else if ( strncmp(prop_name, "cpus", name_len) =3D=3D 0 ) + { + uint32_t val =3D UINT_MAX; + if ( fdt_prop_as_u32(prop, &val) !=3D 0 ) + { + printk(" failed processing max_vcpus for domain %s\n", na= me); + return -EINVAL; + } + bd->max_vcpus =3D val; + printk(" max vcpus: %d\n", bd->max_vcpus); + } } =20 fdt_for_each_subnode(node, fdt, dom_node) diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/a= sm/bootdomain.h index d7092bc32ad7..1a15273043f5 100644 --- a/xen/arch/x86/include/asm/bootdomain.h +++ b/xen/arch/x86/include/asm/bootdomain.h @@ -24,6 +24,8 @@ struct boot_domain { unsigned long min_pages; unsigned long max_pages; =20 + unsigned int max_vcpus; + struct boot_module *kernel; struct boot_module *ramdisk; =20 --=20 2.30.2