From nobody Fri Oct 31 23:30:44 2025 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=1745101309; cv=pass; d=zohomail.com; s=zohoarc; b=js0mBJknr9HjAlA3xDD4sO7UmsEKp1EHH21z7iFj6qKkEaqewT01M/61vRXpjw2GVf3GUcL94zY5F7G+2GGA5BFs+Oi7in3Juj+oOj6jIkHjHFY9SLrxsOn6V0ToG8qtBXs1a4bUOov1/qXw1hm1eYjBVxy45LZ5CvrjTVsUq+s= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745101309; 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=lqmxREyAE0WjRdlDATtWmFP941B+/fkRIhZO5eZCnWA=; b=XWaw+1uw2Dljy/o/8/aJAb+EYUapI5pCpDz0O1gYcubevWgVotQjnf2BtLU/ohwipolEu8wAQn4UfTwq9tbP5XgXtY1QyVLeE1iac3qZdO92cvhJVB4bQ8SWI/Sw9G/oTLYQgn/tTsCJVTKLNSS8J3bdsiLwO4JsBxxTRQoLrRw= 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 1745101309731135.50129435654333; Sat, 19 Apr 2025 15:21:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.960273.1352382 (Exim 4.92) (envelope-from ) id 1u6GZ6-0006jS-TQ; Sat, 19 Apr 2025 22:21:36 +0000 Received: by outflank-mailman (output) from mailman id 960273.1352382; Sat, 19 Apr 2025 22:21:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u6GZ6-0006iW-Oi; Sat, 19 Apr 2025 22:21:36 +0000 Received: by outflank-mailman (input) for mailman id 960273; Sat, 19 Apr 2025 22:21:35 +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 1u6GRp-0004yY-7a for xen-devel@lists.xenproject.org; Sat, 19 Apr 2025 22:14:05 +0000 Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com [136.143.188.50]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 99dcf2b1-1d6b-11f0-9eb0-5ba50f476ded; Sun, 20 Apr 2025 00:14:04 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 17451005681919.729422362614287; Sat, 19 Apr 2025 15:09:28 -0700 (PDT) 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: 99dcf2b1-1d6b-11f0-9eb0-5ba50f476ded ARC-Seal: i=1; a=rsa-sha256; t=1745100571; cv=none; d=zohomail.com; s=zohoarc; b=IeC677nf98P/AOhN210mWuPZjzW3XkZvyeBoTAPX42mwIDr/DA4h+bWDvezCNyORG3dsCnW2kOhzVA/TXgjehU3dJ8PwpeYXjQJOeFWOi2D0uNUf+hcAOpVN2ts93iE90mwyRkC+aEhpn4GvN9cl2XHo/HxSH4QlS0a4FVYYF24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745100571; 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=lqmxREyAE0WjRdlDATtWmFP941B+/fkRIhZO5eZCnWA=; b=FPWgwbab7TgW70DOAImMDgvCzOT30qSfqfAFyE1HzGjTgdajGdUZwnKhq5eGFSBD+IZfVHMkdME77Ofql2gd9KyBU8Z27lP7E+c+g+AnT2FeDDJ39e2Ke5TzoMldaasVWMo1SLAqBkD8aSAJXnhhgmn49nLGRL4Ig7izl44Obic= 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=1745100571; 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=lqmxREyAE0WjRdlDATtWmFP941B+/fkRIhZO5eZCnWA=; b=P3kEEki7Aklx1SZji5YoSDUrUiCWXt2CK/dZ/nV2NgfvkcUDPeRe9MdlJE9T45qc Lc8ywD+kPmMOwmV/b69mRRLCR5K/yR9taaSrCw3NqNcTImZyYIw4KL+j/F4b09u6vYm 5OHY1hv4vcUVR3/8S1tLmH+cmf649GKyHCVlg8Rc= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, stefano.stabellini@amd.com, agarciav@amd.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [RFC 36/38] x86/hyperlaunch: enable unpausing mulitple domains Date: Sat, 19 Apr 2025 18:08:18 -0400 Message-Id: <20250419220820.4234-37-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250419220820.4234-1-dpsmith@apertussolutions.com> References: <20250419220820.4234-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: 1745101311503019100 Content-Type: text/plain; charset="utf-8" This commit enables the domain builder to unpause all domains that have been flagged to start on boot. Signed-off-by: Daniel P. Smith --- xen/arch/x86/domain-builder/core.c | 20 ++++++++++++++++++++ xen/arch/x86/include/asm/boot-domain.h | 8 +++++--- xen/arch/x86/include/asm/domain-builder.h | 1 + xen/arch/x86/setup.c | 8 +++++++- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/domain-builder/core.c b/xen/arch/x86/domain-build= er/core.c index 2712703e17e6..fa01b8390a23 100644 --- a/xen/arch/x86/domain-builder/core.c +++ b/xen/arch/x86/domain-builder/core.c @@ -6,6 +6,7 @@ #include #include #include +#include =20 #include #include @@ -206,6 +207,25 @@ unsigned int __init builder_create_domains(struct boot= _info *bi) return build_count; } =20 +int __init builder_unpause_domains(struct boot_info *bi) +{ + int i, count =3D 0; + + for ( i =3D 0; i < bi->nr_domains; i++ ) + { + struct boot_domain *bd =3D &bi->domains[i]; + + if ( bd->capabilities & BUILD_CAPS_HARDWARE || + bd->mode & BUILD_MODE_START_ON_BOOT ) + { + domain_unpause_by_systemcontroller(bd->d); + count++; + } + } + + return count; +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/= asm/boot-domain.h index a574f4941ed3..b592aef84b27 100644 --- a/xen/arch/x86/include/asm/boot-domain.h +++ b/xen/arch/x86/include/asm/boot-domain.h @@ -22,9 +22,11 @@ struct boot_domain { #define BUILD_CAPS_XENSTORE (1 << 2) uint32_t capabilities; =20 - /* On | Off */ -#define BUILD_MODE_PARAVIRT (1 << 0) /* PV | PVH/HVM */ -#define BUILD_MODE_ENABLE_DM (1 << 1) /* HVM | PVH */ + /* On | Off */ +#define BUILD_MODE_PARAVIRT (1 << 0) /* PV | PVH/HVM */ +#define BUILD_MODE_ENABLE_DM (1 << 1) /* HVM | PVH */ +#define BUILD_MODE_LONG (1 << 2) /* 64 BIT | 32 BIT */ +#define BUILD_MODE_START_ON_BOOT (1 << 3) /* UNPAUSED | PAUSED */ uint32_t mode; =20 unsigned long mem_pages; diff --git a/xen/arch/x86/include/asm/domain-builder.h b/xen/arch/x86/inclu= de/asm/domain-builder.h index 5dc5661bec07..df55cf52460c 100644 --- a/xen/arch/x86/include/asm/domain-builder.h +++ b/xen/arch/x86/include/asm/domain-builder.h @@ -9,6 +9,7 @@ int __init builder_get_cmdline( =20 void builder_init(struct boot_info *bi); unsigned int builder_create_domains(struct boot_info *bi); +int builder_unpause_domains(struct boot_info *bi); =20 struct domain *arch_create_dom( struct boot_info *bi, struct boot_domain *bd); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 09b1fc94426d..ba0dd427c81b 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -787,6 +787,7 @@ static inline bool using_2M_mapping(void) =20 static void noreturn init_done(void) { + struct boot_info *bi =3D &xen_boot_info; void *va; unsigned long start, end; int err; @@ -800,7 +801,12 @@ static void noreturn init_done(void) if ( IS_ENABLED(CONFIG_SELF_TESTS) && cpu_has_xen_shstk ) stub_selftest(); =20 - domain_unpause_by_systemcontroller(dom0); + err =3D builder_unpause_domains(bi); + if ( err =3D=3D 0 ) + panic("domain builder: failed to schedule any domain to start\n"); + else + printk("domain builder: unpaused %d of %d domains at boot\n", err, + bi->nr_domains); =20 /* MUST be done prior to removing .init data. */ unregister_init_virtual_region(); --=20 2.30.2