From patchwork Tue May 28 14:54:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasilis LIaskovitis X-Patchwork-Id: 10965105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C61092A for ; Tue, 28 May 2019 14:56:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D7AE28437 for ; Tue, 28 May 2019 14:56:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6198728538; Tue, 28 May 2019 14:56:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF1A928358 for ; Tue, 28 May 2019 14:56:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVdUq-0000Us-6D; Tue, 28 May 2019 14:54:36 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVdUo-0000Ul-Sa for xen-devel@lists.xenproject.org; Tue, 28 May 2019 14:54:34 +0000 X-Inumbo-ID: 802c995a-8158-11e9-8980-bc764e045a96 Received: from smtp.nue.novell.com (unknown [195.135.221.5]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 802c995a-8158-11e9-8980-bc764e045a96; Tue, 28 May 2019 14:54:32 +0000 (UTC) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 28 May 2019 16:54:31 +0200 Received: from linux-nq5u.suse.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Tue, 28 May 2019 15:54:22 +0100 From: Vasilis Liaskovitis To: xen-devel@lists.xenproject.org Date: Tue, 28 May 2019 16:54:12 +0200 Message-Id: <20190528145416.16918-1-vliaskovitis@suse.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 0/4] Support for reading runtime hypervisor parameters 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: jgross@suse.com, sstabellini@kernel.org, wei.liu2@citrix.com, jbeulich@suse.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, vliaskovitis@suse.com, anthony.perard@citrix.com, dgdegra@tycho.nsa.gov Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Currently runtime parameters of the hypervisor cannot be inspected through an xl command, however they can be changed with the "xl set-parameter" command. Being able to check these parameters at runtime would be a useful diagnostic tool. This patch series implements a new xl command "xl get-parameters" which takes a string of input parameters and returns their current values in the hypervisor settings. Examples: xl get-parameters "gnttab_max_frames gnttab_max_maptrack_frames" gnttab_max_frames gnttab_max_maptrack_frames : 64 1024 xl set-parameters gnttab_max_frames=128 xl get-parameters gnttab_max_frames gnttab_max_frames : 128 xl get-parameters "gnttab_max_frames gnttab_max_maptrack_frames" gnttab_max_frames gnttab_max_maptrack_frames : 128 1024 Changes v3->v4: - Fix return value and logging in new libxl function. Changes v2->v3: - Several style / formatting fixes - Limitations for signed integer parameters added in code and commit log. Changes v1->v2: - fixed snprintf issues, fixed memory leaks and error handling - removed unnecessary wrapper function - OPT_SIZE is handled Limitations: - Custom runtime parameters (OPT_CUSTOM) are not supported yet. I'd like to do this in a follow-up series. See also discussion at https://lists.xenproject.org/archives/html/xen-devel/2019-03/msg01383.html - For integer parameters (OPT_UINT), only unsigned parameters are printed correctly at the moment. Vasilis Liaskovitis (4): xen: add hypercall for getting parameters at runtime libxc: add function to get hypervisor parameters libxl: add libxl_get_parameters() function xl: add new xl command get-parameters docs/man/xl.1.pod.in | 5 ++ tools/flask/policy/modules/dom0.te | 2 +- tools/libxc/include/xenctrl.h | 1 + tools/libxc/xc_misc.c | 26 ++++++ tools/libxl/libxl.c | 19 +++++ tools/libxl/libxl.h | 1 + tools/xl/xl.h | 1 + tools/xl/xl_cmdtable.c | 5 ++ tools/xl/xl_misc.c | 25 ++++++ xen/common/kernel.c | 118 ++++++++++++++++++++++++++++ xen/common/sysctl.c | 52 +++++++++++- xen/include/public/sysctl.h | 18 +++++ xen/include/xen/lib.h | 1 + xen/xsm/flask/hooks.c | 3 + xen/xsm/flask/policy/access_vectors | 2 + 15 files changed, 276 insertions(+), 3 deletions(-)