From nobody Tue Nov 11 08:45:26 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569574932; cv=none; d=zoho.com; s=zohoarc; b=mrjpGYhqAxsreLtvAtZKSy4KkDO9BJ2wVy0a+p/UoaUizWNxwY2oD47WiNq24GKpRBClq+JgBlMhgyzDllhhhjGp/+PfUUwgK9pnPmKvLPldmsTdRA9l3EMLwRbsC3GeN7m1C0KdFS7uWC8/U7EFPOJ2uXusfzOmHRYnJ8+DpTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569574932; h=Content-Type: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:ARC-Authentication-Results; bh=oJiiLBdisaibzpno13xq7sQVuNCguKZ+pObgZ5yqC80=; b=Dd0X1Ii/S7zMln0Lc6SQfM2GkmlPwyxDWJCAwcBQYt9Fb+i6eW2BorjL+kdYqaJUidC8aPhBGdoDCMQiwcxVRRn4BsWy5N3zReIY6Gv2CYdx7AyUuHc/OMjfEzZuUBHRl5GE0jSZ1UvjPhED/Ysew3JuYG2rvHnDPZRyFrdRSa0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569574932495756.1640469861213; Fri, 27 Sep 2019 02:02:12 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDm7X-0005Oc-TF; Fri, 27 Sep 2019 09:00:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDm7W-0005Nu-Vd for xen-devel@lists.xenproject.org; Fri, 27 Sep 2019 09:00:59 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by localhost (Halon) with ESMTPS id 4e3d9b85-e105-11e9-9670-12813bfff9fa; Fri, 27 Sep 2019 09:00:52 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2CC5AAFF1; Fri, 27 Sep 2019 09:00:52 +0000 (UTC) X-Inumbo-ID: 4e3d9b85-e105-11e9-9670-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 27 Sep 2019 11:00:48 +0200 Message-Id: <20190927090048.28872-7-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190927090048.28872-1-jgross@suse.com> References: <20190927090048.28872-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v1 6/6] xen: add runtime parameter reading support to hypfs X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add support to read values of hypervisor runtime parameters via the hypervisor file system for all unsigned integer type runtime parameters. Signed-off-by: Juergen Gross --- docs/misc/hypfs-paths.pandoc | 6 ++++++ xen/common/kernel.c | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/docs/misc/hypfs-paths.pandoc b/docs/misc/hypfs-paths.pandoc index 56ebdcd8be..d710b83185 100644 --- a/docs/misc/hypfs-paths.pandoc +++ b/docs/misc/hypfs-paths.pandoc @@ -62,3 +62,9 @@ hypervisor. #### /buildinfo/config =3D STRING =20 The contents of the `xen/.config` file at the time of the hypervisor build. + +#### /params/ + +A directory of runtime parameters (those can be set via xl set-parameters). +The description of the different parameters can be found in +`docs/misc/xen-command-line.pandoc`. diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 760917dab5..09787b5a34 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -320,6 +321,32 @@ int cmdline_strcmp(const char *frag, const char *name) } } =20 +static struct hypfs_dir hypfs_params =3D { + .list =3D LIST_HEAD_INIT(hypfs_params.list), +}; + +static int __init runtime_param_hypfs_add(void) +{ + const struct kernel_param *param; + int ret; + + ret =3D hypfs_new_dir(&hypfs_root, "params", &hypfs_params); + BUG_ON(ret); + + for ( param =3D __param_start; param < __param_end; param++ ) + { + if ( param->type =3D=3D OPT_UINT && param->len =3D=3D sizeof(unsig= ned int) ) + { + ret =3D hypfs_new_entry_uint(&hypfs_params, param->name, + (unsigned int *)(param->par.var)); + BUG_ON(ret); + } + } + + return 0; +} +__initcall(runtime_param_hypfs_add); + unsigned int tainted; =20 /** --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel