From nobody Fri Nov 29 08:31:08 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; 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; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1648773559; cv=none; d=zohomail.com; s=zohoarc; b=jnTibBd6/ec9NFnhyrtPSAANEczOI7a3OqkTHVCfP9BQsDb55K3zxv5OGXUinrbXEOq1QDALCV+s3E112z7mod2DjDiucLW9nlvsag/WMmdgk7CC2KsiXVGYCwjoQpKdmkw6NJJHlhZkh3nybccPvk8Onu5DQQWJTfUDIlFrMDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648773559; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+w6ZXA4Iv1dtbT/AFkch1k9NpUF0dryIutwJrRT7Avw=; b=na2UrIY3Rgbhuwdk4ifYmnPatgHTqrfMo4v5wdN6XTvIltDMVaKLXmwxZ02GQjByn/QNtLtDQUVJOJChDhJAyCgy1vGG1mEVljBiN443EVofe4y0MK9ekVf7FoRZiIWf5QY7+0c+n40mmHS/vzQVPPvsNBG+cx3L+X88uTvwN0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1648773559061566.980176256894; Thu, 31 Mar 2022 17:39:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.297158.506130 (Exim 4.92) (envelope-from ) id 1na5JZ-0000M7-Hv; Fri, 01 Apr 2022 00:38:57 +0000 Received: by outflank-mailman (output) from mailman id 297158.506130; Fri, 01 Apr 2022 00:38:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1na5JZ-0000Ix-4o; Fri, 01 Apr 2022 00:38:57 +0000 Received: by outflank-mailman (input) for mailman id 297158; Fri, 01 Apr 2022 00:38:54 +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 1na5JW-00087e-HM for xen-devel@lists.xenproject.org; Fri, 01 Apr 2022 00:38:54 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1aa9e15e-b154-11ec-a405-831a346695d4; Fri, 01 Apr 2022 02:38:53 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1EB84618B4; Fri, 1 Apr 2022 00:38:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94378C340F3; Fri, 1 Apr 2022 00:38:51 +0000 (UTC) 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: 1aa9e15e-b154-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648773531; bh=4iBLNVmcXHYfyGJi5ahq2ucMYYpPYTlArhpqmmGmD68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nugHhDmuLVPBKwkBQFWcN8GC9tJA2q4fcSaHcK1pdagbiVrSuwuVgnIop0kIBoH/A aJHeqD8LdELqK4dxoaghbBO3GwG+TR2bHcIfjeCbEjBWkO1UvO5DGiUzH5YWGcqA1Q rv7xy4fNT/pXsPDiRrlot0E+ZO5M4Mm7K5A4IgklNkUyjMtyQ+oP0cYm3A1hb/6s66 jo7xAfSO6mmPiLY4uK0xbsN/nkpW/cCpBMbXKKiFyZg4+6Z8xNpgsyOcCwSUhcQekv Rfkv/xxDn79yK18/6YuXoX6M+ScGfnifrhJYX0vHMmQYmaVpcjq99PyjhVcqZj8E5N M05PTB8JymzxQ== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, jgross@suse.com, Bertrand.Marquis@arm.com, julien@xen.org, Volodymyr_Babchuk@epam.com, Stefano Stabellini , Bertrand Marquis Subject: [PATCH v4 5/9] xen: introduce xen,enhanced dom0less property Date: Thu, 31 Mar 2022 17:38:43 -0700 Message-Id: <20220401003847.38393-5-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1648773560821100004 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini Introduce a new "xen,enhanced" dom0less property to enable/disable PV driver interfaces for dom0less guests. Currently only "enabled" and "disabled" are supported property values (and empty). Leave the option open to implement further possible values in the future (e.g. "xenstore" to enable only xenstore.) The configurable option is for domUs only. For dom0 we always set the corresponding property in the Xen code to true (PV interfaces enabled.) This patch only parses the property. Next patches will make use of it. Signed-off-by: Stefano Stabellini Reviewed-by: Bertrand Marquis CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis --- Changes in v4: - move xen,enhanced to the bottom of the list - do not set kinfo.dom0less_enhanced for dom0 Changes in v3: - improve commit message Changes in v2: - rename kinfo.enhanced to kinfo.dom0less_enhanced - set kinfo.dom0less_enhanced to true for dom0 - handle -ENODATA in addition to -EILSEQ --- docs/misc/arm/device-tree/booting.txt | 18 ++++++++++++++++++ xen/arch/arm/domain_build.c | 7 +++++++ xen/arch/arm/include/asm/kernel.h | 3 +++ 3 files changed, 28 insertions(+) diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-t= ree/booting.txt index a94125394e..92097c4969 100644 --- a/docs/misc/arm/device-tree/booting.txt +++ b/docs/misc/arm/device-tree/booting.txt @@ -188,6 +188,24 @@ with the following properties: An empty property to request the memory of the domain to be direct-map (guest physical address =3D=3D physical address). =20 +- xen,enhanced + + A string property. Possible property values are: + + - "enabled" (or missing property value) + Xen PV interfaces, including grant-table and xenstore, will be + enabled for the VM. + + - "disabled" + Xen PV interfaces are disabled. + + If the xen,enhanced property is present with no value, it defaults + to "enabled". If the xen,enhanced property is not present, PV + interfaces are disabled. + + In the future other possible property values might be added to + enable only selected interfaces. + Under the "xen,domain" compatible node, one or more sub-nodes are present for the DomU kernel and ramdisk. =20 diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 100a4959a8..b22fe95d92 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -3150,6 +3150,7 @@ static int __init construct_domU(struct domain *d, const struct dt_device_node *node) { struct kernel_info kinfo =3D {}; + const char *dom0less_enhanced; int rc; u64 mem; =20 @@ -3165,6 +3166,12 @@ static int __init construct_domU(struct domain *d, =20 kinfo.vpl011 =3D dt_property_read_bool(node, "vpl011"); =20 + rc =3D dt_property_read_string(node, "xen,enhanced", &dom0less_enhance= d); + if ( rc =3D=3D -EILSEQ || + rc =3D=3D -ENODATA || + (rc =3D=3D 0 && !strcmp(dom0less_enhanced, "enabled")) ) + kinfo.dom0less_enhanced =3D true; + if ( vcpu_create(d, 0) =3D=3D NULL ) return -ENOMEM; =20 diff --git a/xen/arch/arm/include/asm/kernel.h b/xen/arch/arm/include/asm/k= ernel.h index 874aa108a7..c4dc039b54 100644 --- a/xen/arch/arm/include/asm/kernel.h +++ b/xen/arch/arm/include/asm/kernel.h @@ -36,6 +36,9 @@ struct kernel_info { /* Enable pl011 emulation */ bool vpl011; =20 + /* Enable PV drivers */ + bool dom0less_enhanced; + /* GIC phandle */ uint32_t phandle_gic; =20 --=20 2.25.1