From patchwork Wed Sep 11 06:19:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11140327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2577E1395 for ; Wed, 11 Sep 2019 06:21:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B3A821A4C for ; Wed, 11 Sep 2019 06:21:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B3A821A4C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7vz8-0003cn-Da; Wed, 11 Sep 2019 06:20:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7vz6-0003ci-T9 for xen-devel@lists.xenproject.org; Wed, 11 Sep 2019 06:20:08 +0000 X-Inumbo-ID: 3214b538-d45c-11e9-b299-bc764e2007e4 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3214b538-d45c-11e9-b299-bc764e2007e4; Wed, 11 Sep 2019 06:20:05 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CD84EAF3F; Wed, 11 Sep 2019 06:20:04 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 11 Sep 2019 08:19:56 +0200 Message-Id: <20190911062001.25931-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [RFC PATCH 0/5] Add hypervisor sysfs-like support 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 , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On the 2019 Xen developer summit there was agreement that the Xen hypervisor should gain support for a hierarchical name-value store similar to the Linux kernel's sysfs. This is a first implementation of that idea adding the basic functionality to hypervisor and tools side. The interface to any user program making use of that "xen-sysfs" is a new library "libxenfs" with a stable interface. There are still some pending questions, those are: - access rights: + should we allow access to dom0 only, or to all domains, or should that be possible to set per entry? + how to integrate with xsm? - dynamical entries: + do we want support for e.g. per-domain and/or per-cpupool entries? + do we want support for debug aids (lock-profiling, debugtrace ..)? - write access: + runtime parameters? + debugging aids? I have added a simple example in the last patch of the series by supporting access to the .config file used for building the hypervisor. Juergen Gross (5): docs: add feature document for Xen hypervisor sysfs-like support xen: add basic hypervisor filesystem support libs: add libxenfs tools: add xenfs tool xen: add /buildinfo/config entry to hypervisor filesystem .gitignore | 2 + docs/features/hypervisorfs.pandoc | 110 +++++++++++++++ tools/Rules.mk | 6 + tools/libs/Makefile | 1 + tools/libs/fs/Makefile | 14 ++ tools/libs/fs/core.c | 198 ++++++++++++++++++++++++++ tools/libs/fs/include/xenfs.h | 57 ++++++++ tools/libs/fs/libxenfs.map | 8 ++ tools/libs/fs/xenfs.pc.in | 10 ++ tools/misc/Makefile | 6 + tools/misc/xenfs.c | 102 ++++++++++++++ xen/arch/arm/traps.c | 1 + xen/arch/x86/hvm/hypercall.c | 1 + xen/arch/x86/hypercall.c | 1 + xen/arch/x86/pv/hypercall.c | 1 + xen/common/Makefile | 7 + xen/common/filesystem.c | 287 ++++++++++++++++++++++++++++++++++++++ xen/include/public/errno.h | 1 + xen/include/public/filesystem.h | 98 +++++++++++++ xen/include/public/xen.h | 1 + xen/include/xen/filesystem.h | 34 +++++ xen/include/xen/hypercall.h | 8 ++ xen/include/xen/kernel.h | 2 + xen/tools/Makefile | 9 +- xen/tools/bin2c.c | 28 ++++ 25 files changed, 991 insertions(+), 2 deletions(-) create mode 100644 docs/features/hypervisorfs.pandoc create mode 100644 tools/libs/fs/Makefile create mode 100644 tools/libs/fs/core.c create mode 100644 tools/libs/fs/include/xenfs.h create mode 100644 tools/libs/fs/libxenfs.map create mode 100644 tools/libs/fs/xenfs.pc.in create mode 100644 tools/misc/xenfs.c create mode 100644 xen/common/filesystem.c create mode 100644 xen/include/public/filesystem.h create mode 100644 xen/include/xen/filesystem.h create mode 100644 xen/tools/bin2c.c