From nobody Wed Dec 4 19:03:53 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=1725054789; cv=pass; d=zohomail.com; s=zohoarc; b=WBj2F4lNSHJWvGMCUhmaWFK2dIrJq5+ngL3OS2x/R+TTLq3LCYPdU8iahQNQmOz5oNHAGfdz6P0vCvNdTuBYKEiINUsJMeHEykwpYUJYS6qKq9q8RQ4/MJ4ZL7rOQy66umJX6/TGzjzTW9ywp38ebbfYdbg/O/BScyfPJ1FTAOk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725054789; 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=FMMyV/u+IcJlzna8xPedLWbpzcFdbye2wRnqCcAWCr4=; b=d0h1U+1roGt6zIry2fWHepUK2JrBmwlKlsOSQLaTFBWTXyz5MVZxYAp3t0Ddu0VpzNW8I4gUrI2yVypi1yKInJg0759AfBjWFMT+y3oGsgpyI+j98tU9MxeTnNcg9+oJ1eUcymobwx7AqAFqRNxBMWftXbUlJp3XtWxeGOq8ZOY= 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 1725054789919782.0222733398646; Fri, 30 Aug 2024 14:53:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.786726.1196434 (Exim 4.92) (envelope-from ) id 1sk9YB-0006D6-Lq; Fri, 30 Aug 2024 21:52:59 +0000 Received: by outflank-mailman (output) from mailman id 786726.1196434; Fri, 30 Aug 2024 21:52:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sk9YB-0006Ct-IV; Fri, 30 Aug 2024 21:52:59 +0000 Received: by outflank-mailman (input) for mailman id 786726; Fri, 30 Aug 2024 21:52:58 +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 1sk9YA-0005aM-PN for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:58 +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 36efc773-671a-11ef-a0b1-8be0dac302b0; Fri, 30 Aug 2024 23:52:57 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 1725054505001907.1045928467133; Fri, 30 Aug 2024 14:48:25 -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: 36efc773-671a-11ef-a0b1-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; t=1725054506; cv=none; d=zohomail.com; s=zohoarc; b=XomcCrLeVpW08ad/3v70oAvP5emB5KRDdrW2/JPT5js1srnSkvp5X6aWhc50ZSnK+Dgd9WlAs1rfoIQv4ZcARJCh4HbdQA1TXcmUiSifX8m1+A0u40XkCkqtoR2AaDrWX1T5DcxTor1bB+seMX5fZuVqhQEvJXv1/NXM/G5Nr+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725054506; 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=FMMyV/u+IcJlzna8xPedLWbpzcFdbye2wRnqCcAWCr4=; b=dhIu1CJp6gv0Pj5rDEeAgXcnLINWMqbKLQRH/zJRnMBT+AZVgLlseL1+Xt76s8ZLO+4hq9mIzDsFpLD+B8EOD8cBMx9XlECxWJ0mM/C6aG0Oic/a5HxAS0Oj2K2iXzlTqrBlhL8fM6TmAYWjuOZPxnOKnCQCtfyPxot7mwilYJY= 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=1725054506; 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=FMMyV/u+IcJlzna8xPedLWbpzcFdbye2wRnqCcAWCr4=; b=Q9ecpxi+qWrHVcOUKwjYqwtCFh7Q4MQWgNZ2569OoDPGnO24NUa3yN2MWX7hktiJ RF1atkVKx107UYLFz36EdEebw7DZdb148q24qP/aamrV1AoNJw9q61mnv56N3FBixyw aS8IEBLtWN/3JHJmU8D1NLRTKBbxp4+cZUbLckPQ= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, christopher.w.clark@gmail.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v4 41/44] x86/boot: add struct domain to struct boot_domain Date: Fri, 30 Aug 2024 17:47:26 -0400 Message-Id: <20240830214730.1621-42-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com> References: <20240830214730.1621-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: 1725054792082116600 Content-Type: text/plain; charset="utf-8" Store a reference to the created domain in struct boot_domain. Signed-off-by: Daniel P. Smith --- xen/arch/x86/include/asm/bootdomain.h | 3 +++ xen/arch/x86/setup.c | 15 +++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/a= sm/bootdomain.h index 00f7d9267965..2322c459e36a 100644 --- a/xen/arch/x86/include/asm/bootdomain.h +++ b/xen/arch/x86/include/asm/bootdomain.h @@ -10,6 +10,7 @@ =20 #include =20 +struct domain; struct boot_module; =20 struct boot_domain { @@ -19,6 +20,8 @@ struct boot_domain { =20 struct boot_module *kernel; struct boot_module *ramdisk; + + struct domain *d; }; =20 #endif diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 2c1aa1475c4e..872d51310628 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -963,7 +963,6 @@ static struct domain *__init create_dom0(const struct b= oot_info *bi) }, }; struct boot_domain *bd =3D &bi->domains[0]; - struct domain *d; =20 if ( opt_dom0_pvh ) { @@ -980,13 +979,13 @@ static struct domain *__init create_dom0(const struct= boot_info *bi) =20 /* Create initial domain. Not d0 for pvshim. */ bd->domid =3D get_initial_domain_id(); - d =3D domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged= ); - if ( IS_ERR(d) ) - panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d)); + bd->d =3D domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privil= eged); + if ( IS_ERR(bd->d) ) + panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(bd->d)); =20 - init_dom0_cpuid_policy(d); + init_dom0_cpuid_policy(bd->d); =20 - if ( alloc_dom0_vcpu0(d) =3D=3D NULL ) + if ( alloc_dom0_vcpu0(bd->d) =3D=3D NULL ) panic("Error creating d%uv0\n", bd->domid); =20 /* Grab the DOM0 command line. */ @@ -1029,7 +1028,7 @@ static struct domain *__init create_dom0(const struct= boot_info *bi) write_cr4(read_cr4() & ~X86_CR4_SMAP); } =20 - if ( construct_dom0(d, bd->kernel, bd->ramdisk, bd->cmdline) !=3D 0 ) + if ( construct_dom0(bd->d, bd->kernel, bd->ramdisk, bd->cmdline) !=3D = 0 ) panic("Could not construct domain 0\n"); =20 if ( cpu_has_smap ) @@ -1038,7 +1037,7 @@ static struct domain *__init create_dom0(const struct= boot_info *bi) cr4_pv32_mask |=3D X86_CR4_SMAP; } =20 - return d; + return bd->d; } =20 /* How much of the directmap is prebuilt at compile time. */ --=20 2.30.2