From nobody Mon Feb 9 20:35:07 2026 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=1570015288; cv=none; d=zoho.com; s=zohoarc; b=ISewJxC45WA8dzWG4qYK7OC153IlVQeB9wQw+sLErhOZjuO5VYPudy2u7HXlZfjABKo8A/n68v1nuyiSI+wdLK8L4W9XAKfOIT9j0x1KOeclRbLq6Gu8uuntvv0AkWBVaec9ikNk1cpg+1uRjYjYYwhwvPqJqzkgzqyNFgGqq+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570015288; 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=GsTFnuLptAV26SZOfl5w/cppAjVwIrlLos2ugGIDPcw=; b=GlLJXBUQhjUgIucsDUHBqiPPg5uqc7gAZgmaL3AV90JlUh0QXC0/+aqFWT+Rj6PxNUg5h8W+XLLGzSVV6mYmLfBAhSoYtntGUJ/sbupvjReRz0aA4cYwNykiPNrfwNSlKIMiwAOFUwun4xjID8Jz68gezjoSfHKS1T1bWmWVvA8= 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 1570015288359231.55558704887028; Wed, 2 Oct 2019 04:21:28 -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 1iFcgA-0001A9-O6; Wed, 02 Oct 2019 11:20:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFcg9-00018v-5O for xen-devel@lists.xenproject.org; Wed, 02 Oct 2019 11:20:21 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by localhost (Halon) with ESMTPS id 98ea5906-e506-11e9-bf31-bc764e2007e4; Wed, 02 Oct 2019 11:20:11 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 71ABFAE5E; Wed, 2 Oct 2019 11:20:08 +0000 (UTC) X-Inumbo-ID: 98ea5906-e506-11e9-bf31-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 2 Oct 2019 13:20:04 +0200 Message-Id: <20191002112004.25793-7-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191002112004.25793-1-jgross@suse.com> References: <20191002112004.25793-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v2 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 , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , 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 | 9 +++++++++ xen/common/kernel.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/docs/misc/hypfs-paths.pandoc b/docs/misc/hypfs-paths.pandoc index 81353546ef..c12014505e 100644 --- a/docs/misc/hypfs-paths.pandoc +++ b/docs/misc/hypfs-paths.pandoc @@ -102,3 +102,12 @@ 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). + +#### /params/* + +The single 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..e2e6d171a7 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,44 @@ 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++ ) + { + switch ( param->type ) + { + case OPT_UINT: + if ( param->len =3D=3D sizeof(unsigned int) ) + ret =3D hypfs_new_entry_uint(&hypfs_params, param->name, + (unsigned int *)(param->par.var= )); + break; + + case OPT_STR: + ret =3D hypfs_new_entry_uint(&hypfs_params, param->name, + param->par.var); + break; + + default: + break; + } + + 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