Skip to contentSkip to conversation

Add hypervisor sysfs-like support

RFC PATCH In review Juergen Gross 3 participants 24 messages Sep 11, 2019

lore
Share & tools
lore
#0 lore raw

cover Add hypervisor sysfs-like support

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
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

RFC PATCH 1/5 docs: add feature document for Xen hypervisor sysfs-like support

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.

In the beginning there should only be basic support: entries can be added from the hypervisor itself only, there is a simple hypercall interface to read the data.

Add a feature document for setting the base of a discussion regarding the desired functionality and the entries to add.

---
 docs/features/hypervisorfs.pandoc | 110 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 docs/features/hypervisorfs.pandoc
docs/features/hypervisorfs.pandoc new file +110 -0
new file mode 100644
index 0000000000..e13a3c9b0a
@@ -0,0 +1,110 @@
+% Hypervisor FS
+% Revision 1
+
+\clearpage
+
+# Basics
+---------------- ---------------------
+         Status: e.g. **Supported**
+
+  Architectures: all
+
+     Components: Hypervisor, toolstack
+---------------- ---------------------
+
+# Overview
+
+The Hypervisor FS is a hierarchical name-value store for reporting
+information to guests, especially dom0.  It is similar to the Linux
+kernel's sysfs, but without the functionality to directly alter
+entries values. Entries and directories are created by the hypervisor,
+while the toolstack is able to use a hypercall to query the entry
+values.
+
+# User details
+
+With:
+
+    xenfs --ls <path>
+
+the user can list the entries of a specific path of the FS. Using:
+
+    xenfs --cat <path>
+
+the content of an entry can be retrieved.
+
+The FS structure is:
+
+    /
+        buildinfo/           directory containing build-time data
+            config           contents of .config file used to build Xen
+        cpu-bugs/            x86: directory of cpu bug information
+            l1tf             "Vulnerable" or "Not vulnerable"
+            mds              "Vulnerable" or "Not vulnerable"
+            meltdown         "Vulnerable" or "Not vulnerable"
+            spec-store-bypass "Vulnerable" or "Not vulnerable"
+            spectre-v1       "Vulnerable" or "Not vulnerable"
+            spectre-v2       "Vulnerable" or "Not vulnerable"
+            mitigations/     directory of mitigation settings
+                bti-thunk    "N/A", "RETPOLINE", "LFENCE" or "JMP"
+                spec-ctrl    "No", "IBRS+" or IBRS-"
+                ibpb         "No" or "Yes"
+                l1d-flush    "No" or "Yes"
+                md-clear     "No" or "VERW"
+                l1tf-barrier "No" or "Yes"
+            active-hvm/      directory for mitigations active in hvm doamins
+                msr-spec-ctrl "No" or "Yes"
+                rsb          "No" or "Yes"
+                eager-fpu    "No" or "Yes"
+                md-clear     "No" or "Yes"
+            active-pv/       directory for mitigations active in pv doamins
+                msr-spec-ctrl "No" or "Yes"
+                rsb          "No" or "Yes"
+                eager-fpu    "No" or "Yes"
+                md-clear     "No" or "Yes"
+                xpti         "No" or list of "dom0", "domU", "PCID on"
+                l1tf-shadow  "No" or list of "dom0", "domU"
+        parameters/          directory with hypervisor parameter values
+                             (boot/runtime parameters)
+
+# Technical details
+
+Access to the hypervisor filesystem is done via the stable new hypercall
+__HYPERVISOR_filesystem_op.
+
+* hypercall interface specification
+    * `xen/include/public/filesystem.h`
+* hypervisor internal files
+    * `xen/include/xen/filesystem.h`
+    * `xen/common/filesystem.c`
+* `libxenfs`
+    * `tools/libs/libxenfs/*`
+* `xenfs`
+    * `tools/misc/xenfs.c`
+    
+# Testing
+
+Any new parameters or hardware mitigations should be verified to show up
+correctly in the filesystem.
+
+# Areas for improvement
+
+* More detailed access rights
+* Entries per domain and/or per cpupool
+* Possibility to modify values via filesystem access
+
+# Known issues
+
+* None
+
+# References
+
+* None
+
+# History
+
+------------------------------------------------------------------------
+Date       Revision Version  Notes
+---------- -------- -------- -------------------------------------------
+2019-08-29 1        Xen 4.13 Document written
+---------- -------- -------- -------------------------------------------
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

Re: [Xen-devel] [RFC PATCH 1/5] docs: add feature document for Xen hypervisor sysfs-like support

Quoted 10 lines · Juergen Gross
docs/features/hypervisorfs.pandoc new file +10 -0
+# Overview
+
+The Hypervisor FS is a hierarchical name-value store for reporting
+information to guests, especially dom0.  It is similar to the Linux
+kernel's sysfs, but without the functionality to directly alter
+entries values. Entries and directories are created by the hypervisor,
+while the toolstack is able to use a hypercall to query the entry
+values.
+
+# User details

docs/features/hypervisorfs.pandoc line 34

Quoted 10 lines
docs/features/hypervisorfs.pandoc new file +10 -0
+
+With:
+
+    xenfs --ls <path>
+
+the user can list the entries of a specific path of the FS. Using:
+
+    xenfs --cat <path>
+
+the content of an entry can be retrieved.

Just one initial remark: I think the -- prefix to the commands should be omitted; they should be used for option-like arguments only.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

Re: [Xen-devel] [RFC PATCH 1/5] docs: add feature document for Xen hypervisor sysfs-like support

Quoted 17 lines · Jan Beulich
Quoted 16 lines · Juergen Gross
docs/features/hypervisorfs.pandoc new file +16 -0
+# Overview
+
+The Hypervisor FS is a hierarchical name-value store for reporting
+information to guests, especially dom0.  It is similar to the Linux
+kernel's sysfs, but without the functionality to directly alter
+entries values. Entries and directories are created by the hypervisor,
+while the toolstack is able to use a hypercall to query the entry
+values.
+
+# User details
+
+With:
+
+    xenfs --ls <path>
+
+the user can list the entries of a specific path of the FS. Using:
Quoted 8 lines

docs/features/hypervisorfs.pandoc line 34

Quoted 4 lines
docs/features/hypervisorfs.pandoc new file +4 -0
+
+    xenfs --cat <path>
+
+the content of an entry can be retrieved.

Just one initial remark: I think the -- prefix to the commands should be omitted; they should be used for option-like arguments only.

Fine with me.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

RFC PATCH 2/5 xen: add basic hypervisor filesystem support

In reply to Juergen Gross

Add the infrastructure for the hypervisor filesystem.

This includes the hypercall interface and the base functions for entry creation, deletion and modification.

---
 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             |   1 +
 xen/common/filesystem.c         | 270 ++++++++++++++++++++++++++++++++++++++++
 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 ++
 11 files changed, 417 insertions(+)
 create mode 100644 xen/common/filesystem.c
 create mode 100644 xen/include/public/filesystem.h
 create mode 100644 xen/include/xen/filesystem.h
xen/arch/arm/traps.c +1 -0
index a3b961bd06..44b027951f 100644
@@ -1401,6 +1401,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
 #ifdef CONFIG_ARGO
     HYPERCALL(argo_op, 5),
 #endif
+    HYPERCALL(filesystem_op, 5),
 };
 
 #ifndef NDEBUG
xen/arch/x86/hvm/hypercall.c +1 -0
index 33dd2d99d2..936ad10add 100644
@@ -144,6 +144,7 @@ static const hypercall_table_t hvm_hypercall_table[] = {
 #endif
     HYPERCALL(xenpmu_op),
     COMPAT_CALL(dm_op),
+    HYPERCALL(filesystem_op),
     HYPERCALL(arch_1)
 };
 
xen/arch/x86/hypercall.c +1 -0
index d483dbaa6b..640347e514 100644
@@ -73,6 +73,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =
     ARGS(hvm_op, 2),
     ARGS(dm_op, 3),
 #endif
+    ARGS(filesystem_op, 5),
     ARGS(mca, 1),
     ARGS(arch_1, 1),
 };
xen/arch/x86/pv/hypercall.c +1 -0
index 0c84c0b3a0..27c8e893c6 100644
@@ -84,6 +84,7 @@ const hypercall_table_t pv_hypercall_table[] = {
     HYPERCALL(hvm_op),
     COMPAT_CALL(dm_op),
 #endif
+    HYPERCALL(filesystem_op),
     HYPERCALL(mca),
     HYPERCALL(arch_1),
 };
xen/common/Makefile +1 -0
index 62b34e69e9..be43757dff 100644
@@ -11,6 +11,7 @@ obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
 obj-y += event_fifo.o
+obj-y += filesystem.o
 obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
 obj-y += guestcopy.o
xen/common/filesystem.c new file +270 -0

270 lines not on this page · raw message

xen/include/public/errno.h +1 -0
index e1d02fcddf..5c53af6af9 100644
@@ -78,6 +78,7 @@ XEN_ERRNO(EBUSY,	16)	/* Device or resource busy */
 XEN_ERRNO(EEXIST,	17)	/* File exists */
 XEN_ERRNO(EXDEV,	18)	/* Cross-device link */
 XEN_ERRNO(ENODEV,	19)	/* No such device */
+XEN_ERRNO(ENOTDIR,	20)	/* Not a directory */
 XEN_ERRNO(EISDIR,	21)	/* Is a directory */
 XEN_ERRNO(EINVAL,	22)	/* Invalid argument */
 XEN_ERRNO(ENFILE,	23)	/* File table overflow */
xen/include/public/filesystem.h new file +98 -0

98 lines not on this page · raw message

xen/include/public/xen.h +1 -0
index cef65c38e7..232589a95b 100644
@@ -130,6 +130,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define __HYPERVISOR_argo_op              39
 #define __HYPERVISOR_xenpmu_op            40
 #define __HYPERVISOR_dm_op                41
+#define __HYPERVISOR_filesystem_op        42
 
 /* Architecture-specific hypercall definitions. */
 #define __HYPERVISOR_arch_0               48
xen/include/xen/filesystem.h new file +34 -0
new file mode 100644
index 0000000000..24e0e2c62d
@@ -0,0 +1,34 @@
+#ifndef __XEN_FILESYSTEM_H__
+#define __XEN_FILESYSTEM_H__
+
+#include <xen/list.h>
+
+struct fs_dir {
+    unsigned int content_size;
+    struct list_head list;
+};
+
+enum fs_entry_type {
+    fs_type_dir,
+    fs_type_string
+};
+
+struct fs_entry {
+    enum fs_entry_type type;
+    const char *name;
+    struct list_head list;
+    struct fs_dir *parent;
+    union {
+        void *content;
+        struct fs_dir *dir;
+        const char *val;
+    };
+};
+
+extern struct fs_dir fs_root;
+
+int fs_new_dir(struct fs_dir *parent, const char *name, struct fs_dir *dir);
+int fs_new_entry(struct fs_dir *parent, const char *name, const char *val);
+struct fs_entry *fs_get_entry(char *path);
+
+#endif /* __XEN_FILESYSTEM_H__ */
xen/include/xen/hypercall.h +8 -0
index ad8ad27b23..56129ef82f 100644
@@ -150,6 +150,14 @@ do_dm_op(
     unsigned int nr_bufs,
     XEN_GUEST_HANDLE_PARAM(xen_dm_op_buf_t) bufs);
 
+extern long
+do_filesystem_op(
+    unsigned int cmd,
+    XEN_GUEST_HANDLE_PARAM(void) arg1,
+    unsigned long arg2,
+    XEN_GUEST_HANDLE_PARAM(void) arg3,
+    unsigned long arg4);
+
 #ifdef CONFIG_COMPAT
 
 extern int
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw

RFC PATCH 3/5 libs: add libxenfs

In reply to Juergen Gross

Add the new library libxenfs for access to the hypervisor filesystem.

---
 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 +++
 7 files changed, 294 insertions(+)
 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
tools/Rules.mk +6 -0
index cf8935d6a3..60ab97e80f 100644
@@ -19,6 +19,7 @@ XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
 XEN_LIBXENCALL     = $(XEN_ROOT)/tools/libs/call
 XEN_LIBXENFOREIGNMEMORY = $(XEN_ROOT)/tools/libs/foreignmemory
 XEN_LIBXENDEVICEMODEL = $(XEN_ROOT)/tools/libs/devicemodel
+XEN_LIBXENFS       = $(XEN_ROOT)/tools/libs/fs
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 # Currently libxlutil lives in the same directory as libxenlight
@@ -134,6 +135,11 @@ SHDEPS_libxendevicemodel = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SHLI
 LDLIBS_libxendevicemodel = $(SHDEPS_libxendevicemodel) $(XEN_LIBXENDEVICEMODEL)/libxendevicemodel$(libextension)
 SHLIB_libxendevicemodel  = $(SHDEPS_libxendevicemodel) -Wl,-rpath-link=$(XEN_LIBXENDEVICEMODEL)
 
+CFLAGS_libxenfs = -I$(XEN_LIBXENFS)/include $(CFLAGS_xeninclude)
+SHDEPS_libxenfs = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SHLIB_xencall)
+LDLIBS_libxenfs = $(SHDEPS_libxenfs) $(XEN_LIBXENFS)/libxenfs$(libextension)
+SHLIB_libxenfs  = $(SHDEPS_libxenfs) -Wl,-rpath-link=$(XEN_LIBXENFS)
+
 # code which compiles against libxenctrl get __XEN_TOOLS__ and
 # therefore sees the unstable hypercall interfaces.
 CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -D__XEN_TOOLS__
tools/libs/Makefile +1 -0
index 88901e7341..e21fd0516e 100644
@@ -9,6 +9,7 @@ SUBDIRS-y += gnttab
 SUBDIRS-y += call
 SUBDIRS-y += foreignmemory
 SUBDIRS-y += devicemodel
+SUBDIRS-y += fs
 
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := toolcore
tools/libs/fs/Makefile new file +14 -0
new file mode 100644
index 0000000000..26ac677bcc
@@ -0,0 +1,14 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+LIBNAME  := fs
+USELIBS  := toollog toolcore call
+
+SRCS-y                 += core.c
+
+include ../libs.mk
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENFS)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
tools/libs/fs/core.c new file +198 -0

198 lines not on this page · raw message

tools/libs/fs/include/xenfs.h new file +57 -0

57 lines not on this page · raw message

tools/libs/fs/libxenfs.map new file +8 -0
new file mode 100644
index 0000000000..ac42d9163e
@@ -0,0 +1,8 @@
+VERS_1.0 {
+	global:
+		xenfs_open;
+		xenfs_close;
+		xenfs_read;
+		xenfs_readdir;
+	local: *; /* Do not expose anything by default */
+};
tools/libs/fs/xenfs.pc.in new file +10 -0
new file mode 100644
index 0000000000..ea3c17b253
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xenfs
+Description: The Xenfs library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxenfs
+Requires.private: xentoolcore,xentoollog,xencall
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#6 lore raw

RFC PATCH 4/5 tools: add xenfs tool

In reply to Juergen Gross

Add the xenfs tool for accessing the hypervisor filesystem.

---
 tools/misc/Makefile |   6 ++++
 tools/misc/xenfs.c  | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+)
 create mode 100644 tools/misc/xenfs.c
tools/misc/Makefile +6 -0
index 63947bfadc..9f3abd5bcf 100644
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
 INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs
 INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
 INSTALL_SBIN                   += xenpm
@@ -86,6 +87,9 @@ xenperf: xenperf.o
 xenpm: xenpm.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
+xenfs: xenfs.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenfs) $(APPEND_LDFLAGS)
+
 xenlockprof: xenlockprof.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
@@ -94,6 +98,8 @@ xen-hptool.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
 xen-hptool: xen-hptool.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
 
+xenfs.o: CFLAGS += $(CFLAGS_libxenfs)
+
 # xen-mfndump incorrectly uses libxc internals
 xen-mfndump.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
 xen-mfndump: xen-mfndump.o
tools/misc/xenfs.c new file +102 -0

102 lines not on this page · raw message

Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw

Re: [Xen-devel] [RFC PATCH 4/5] tools: add xenfs tool

tools/misc/Makefile INSTALL_SBIN-$(CONFIG_X86) += xen-lowmemd · line 27

Quoted 7 lines · Juergen Gross
tools/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
 INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs

Why SBIN? Is there anything wrong with allowing unprivileged users r/o access? Or is this because in order to access the hypercall interface one needs to be root? If so, we may want to consider relaxing/avoiding/bypassing this in some sensible way.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw

Re: [Xen-devel] [RFC PATCH 4/5] tools: add xenfs tool

Quoted 14 lines · Jan Beulich

tools/misc/Makefile INSTALL_SBIN-$(CONFIG_X86) += xen-lowmemd · line 27

Quoted 7 lines · Juergen Gross
tools/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
  INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
  INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
  INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs

Why SBIN? Is there anything wrong with allowing unprivileged users r/o access? Or is this because in order to access the hypercall interface one needs to be root? If so, we may want to consider relaxing/avoiding/bypassing this in some sensible way.

Installing to bin is fine with me, but relaxing the root restriction might be more difficult and/or questionable.

I was thinking of "mounting" the xen-sysfs to either Xenstore or the kernel's sysfs (probably the latter, as Xenstore in a stubdom would need to enable access to xen-sysfs for that stubdom ,too).

This would then enable accessing some or all entries from non-root.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw

Re: [Xen-devel] [RFC PATCH 4/5] tools: add xenfs tool

Quoted 16 lines · Juergen Gross
Quoted 14 lines · Jan Beulich

tools/misc/Makefile INSTALL_SBIN-$(CONFIG_X86) += xen-lowmemd · line 27

Quoted 7 lines · Juergen Gross
tools/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
  INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
  INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
  INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs

Why SBIN? Is there anything wrong with allowing unprivileged users r/o access? Or is this because in order to access the hypercall interface one needs to be root? If so, we may want to consider relaxing/avoiding/bypassing this in some sensible way.

Quoted 8 lines

Installing to bin is fine with me, but relaxing the root restriction might be more difficult and/or questionable.

I was thinking of "mounting" the xen-sysfs to either Xenstore or the kernel's sysfs (probably the latter, as Xenstore in a stubdom would need to enable access to xen-sysfs for that stubdom ,too).

This would then enable accessing some or all entries from non-root.

Right, going through the kernel's sysfs is what I too was considering (I don't think xenstore is appropriate for this). The main issue I'd see with this is the split brain permissions handling. I'd prefer for there to be just one party determining who is allowed to see what, but even if the hypervisor told the kernel, there would still be a dependency upon the kernel also respecting the request. While not much of a problem as long as all of this is Dom0-only, with DomU-s in mind this would need taking care of.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#10 lore raw

Re: [Xen-devel] [RFC PATCH 4/5] tools: add xenfs tool

Quoted 26 lines · Jan Beulich
Quoted 16 lines · Juergen Gross
Quoted 14 lines · Jan Beulich

tools/misc/Makefile INSTALL_SBIN-$(CONFIG_X86) += xen-lowmemd · line 27

Quoted 7 lines · Juergen Gross
tools/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
   INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
   INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
   INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs

Why SBIN? Is there anything wrong with allowing unprivileged users r/o access? Or is this because in order to access the hypercall interface one needs to be root? If so, we may want to consider relaxing/avoiding/bypassing this in some sensible way.

Quoted 8 lines

Installing to bin is fine with me, but relaxing the root restriction might be more difficult and/or questionable.

I was thinking of "mounting" the xen-sysfs to either Xenstore or the kernel's sysfs (probably the latter, as Xenstore in a stubdom would need to enable access to xen-sysfs for that stubdom ,too).

This would then enable accessing some or all entries from non-root.

Quoted 9 lines

Right, going through the kernel's sysfs is what I too was considering (I don't think xenstore is appropriate for this). The main issue I'd see with this is the split brain permissions handling. I'd prefer for there to be just one party determining who is allowed to see what, but even if the hypervisor told the kernel, there would still be a dependency upon the kernel also respecting the request. While not much of a problem as long as all of this is Dom0-only, with DomU-s in mind this would need taking care of.

Hmm, why? I think we agree that DomUs should get access only to either global data (read-only) which doesn't do any harm, or to data related only to them (so per-domain data). Maybe driver-domains or device model stubdoms would need access to data related to the domains they are serving.

Whether a domU lets a user access that data or not should only be decided by the domU (applies to dom0, too).

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#11 lore raw

Re: [Xen-devel] [RFC PATCH 4/5] tools: add xenfs tool

Quoted 37 lines · Juergen Gross
Quoted 26 lines · Jan Beulich
Quoted 16 lines · Juergen Gross
Quoted 14 lines · Jan Beulich

tools/misc/Makefile INSTALL_SBIN-$(CONFIG_X86) += xen-lowmemd · line 27

Quoted 7 lines · Juergen Gross
tools/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
   INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
   INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
   INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs

Why SBIN? Is there anything wrong with allowing unprivileged users r/o access? Or is this because in order to access the hypercall interface one needs to be root? If so, we may want to consider relaxing/avoiding/bypassing this in some sensible way.

Quoted 8 lines

Installing to bin is fine with me, but relaxing the root restriction might be more difficult and/or questionable.

I was thinking of "mounting" the xen-sysfs to either Xenstore or the kernel's sysfs (probably the latter, as Xenstore in a stubdom would need to enable access to xen-sysfs for that stubdom ,too).

This would then enable accessing some or all entries from non-root.

Quoted 9 lines

Right, going through the kernel's sysfs is what I too was considering (I don't think xenstore is appropriate for this). The main issue I'd see with this is the split brain permissions handling. I'd prefer for there to be just one party determining who is allowed to see what, but even if the hypervisor told the kernel, there would still be a dependency upon the kernel also respecting the request. While not much of a problem as long as all of this is Dom0-only, with DomU-s in mind this would need taking care of.

Quoted 2 lines

Hmm, why? I think we agree that DomUs should get access only to either global data (read-only) which doesn't do any harm,

I guess opinions tend to differ here: There may well be people thinking that certain things shouldn't be seen by everyone.

Quoted 7 lines

or to data related
only to them (so per-domain data). Maybe driver-domains or device model stubdoms would need access to data related to the domains they are serving.

Whether a domU lets a user access that data or not should only be decided by the domU (applies to dom0, too).

Like above, there may be different views here as well.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#12 lore raw

Re: [Xen-devel] [RFC PATCH 4/5] tools: add xenfs tool

Quoted 38 lines · Jan Beulich
Quoted 37 lines · Juergen Gross
Quoted 35 lines · Jan Beulich
Quoted 16 lines · Juergen Gross
Quoted 14 lines · Jan Beulich

tools/misc/Makefile INSTALL_SBIN-$(CONFIG_X86) += xen-lowmemd · line 27

Quoted 7 lines · Juergen Gross
tools/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
    INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
    INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
    INSTALL_SBIN                   += xencov
+INSTALL_SBIN                   += xenfs

Why SBIN? Is there anything wrong with allowing unprivileged users r/o access? Or is this because in order to access the hypercall interface one needs to be root? If so, we may want to consider relaxing/avoiding/bypassing this in some sensible way.

Quoted 8 lines

Installing to bin is fine with me, but relaxing the root restriction might be more difficult and/or questionable.

I was thinking of "mounting" the xen-sysfs to either Xenstore or the kernel's sysfs (probably the latter, as Xenstore in a stubdom would need to enable access to xen-sysfs for that stubdom ,too).

This would then enable accessing some or all entries from non-root.

Right, going through the kernel's sysfs is what I too was considering (I don't think xenstore is appropriate for this). The main issue I'd see with this is the split brain permissions handling. I'd prefer for there to be just one party determining who is allowed to see what, but even if the hypervisor told the kernel, there would still be a dependency upon the kernel also respecting the request. While not much of a problem as long as all of this is Dom0-only, with DomU-s in mind this would need taking care of.

Quoted 5 lines
Quoted 2 lines

Hmm, why? I think we agree that DomUs should get access only to either global data (read-only) which doesn't do any harm,

I guess opinions tend to differ here: There may well be people thinking that certain things shouldn't be seen by everyone.

I didn't mean to give them access to all global data, but to selected items only. This would be controlled by the hypervisor.

Quoted 10 lines
Quoted 8 lines

or to data related
only to them (so per-domain data). Maybe driver-domains or device model stubdoms would need access to data related to the domains they are serving.

Whether a domU lets a user access that data or not should only be decided by the domU (applies to dom0, too).

Like above, there may be different views here as well.

But how should Xen make a choice for the guest here? The guest is free to not give its users access to the data, but like data returned via a hypercall Xen has absolutely no way to control whether the data is accessible by a guest's user process or not.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#13 lore raw

RFC PATCH 5/5 xen: add /buildinfo/config entry to hypervisor filesystem

In reply to Juergen Gross

Add the /buildinfo/config entry to the hypervisor filesystem. This entry contains the .config file used to build the hypervisor.

---
 .gitignore               |  2 ++
 xen/common/Makefile      |  6 ++++++
 xen/common/filesystem.c  | 17 +++++++++++++++++
 xen/include/xen/kernel.h |  2 ++
 xen/tools/Makefile       |  9 +++++++--
 xen/tools/bin2c.c        | 28 ++++++++++++++++++++++++++++
 6 files changed, 62 insertions(+), 2 deletions(-)
 create mode 100644 xen/tools/bin2c.c
.gitignore +2 -0
index 3c947ac948..7150dd0548 100644
@@ -295,6 +295,7 @@ xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/efi.h
 xen/arch/*/efi/runtime.c
+xen/common/config_data.c
 xen/include/headers*.chk
 xen/include/asm
 xen/include/asm-*/asm-offsets.h
@@ -312,6 +313,7 @@ xen/test/livepatch/xen_bye_world.livepatch
 xen/test/livepatch/xen_hello_world.livepatch
 xen/test/livepatch/xen_nop.livepatch
 xen/test/livepatch/xen_replace_world.livepatch
+xen/tools/bin2c
 xen/tools/kconfig/.tmp_gtkcheck
 xen/tools/kconfig/.tmp_qtcheck
 xen/tools/symbols
xen/common/Makefile +6 -0
index be43757dff..9bce9db43b 100644
@@ -1,6 +1,7 @@
 obj-$(CONFIG_ARGO) += argo.o
 obj-y += bitmap.o
 obj-y += bsearch.o
+obj-y += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
 obj-y += cpupool.o
@@ -79,3 +80,8 @@ subdir-$(CONFIG_UBSAN) += ubsan
 
 subdir-$(CONFIG_NEEDS_LIBELF) += libelf
 subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt
+
+config_data.c: ../.config
+	( echo "const char xen_config_data[] ="; \
+	  ../tools/bin2c <$<; \
+	  echo ";" ) > $@
xen/common/filesystem.c +17 -0
index d833992ab1..4ab18eb82a 100644
@@ -25,6 +25,10 @@ static struct fs_entry fs_root_entry = {
     .dir = &fs_root,
 };
 
+static struct fs_dir fs_buildinfo = {
+    .list = LIST_HEAD_INIT(fs_buildinfo.list),
+};
+
 static int fs_add_entry(struct fs_dir *parent, struct fs_entry *new)
 {
     int ret = -ENOENT;
@@ -268,3 +272,16 @@ long do_filesystem_op(unsigned int cmd,
 
     return ret;
 }
+
+static int __init fs_init(void)
+{
+    int ret;
+
+    ret = fs_new_dir(&fs_root, "buildinfo", &fs_buildinfo);
+    BUG_ON(ret);
+    ret = fs_new_entry(&fs_buildinfo, "config", xen_config_data);
+    BUG_ON(ret);
+
+    return 0;
+}
+__initcall(fs_init);
xen/include/xen/kernel.h +2 -0
index 548b64da9f..00817d06c8 100644
@@ -100,5 +100,7 @@ extern enum system_state {
 
 bool_t is_active_kernel_text(unsigned long addr);
 
+extern const char xen_config_data[];
+
 #endif /* _LINUX_KERNEL_H */
 
xen/tools/Makefile +7 -2
index e940939d61..cd2bbbf647 100644
@@ -1,13 +1,18 @@
 
 include $(XEN_ROOT)/Config.mk
 
+PROGS = symbols bin2c
+
 .PHONY: default
 default:
-	$(MAKE) symbols
+	$(MAKE) $(PROGS)
 
 .PHONY: clean
 clean:
-	rm -f *.o symbols
+	rm -f *.o $(PROGS)
 
 symbols: symbols.c
 	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+
+bin2c: bin2c.c
+	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
xen/tools/bin2c.c new file +28 -0
new file mode 100644
index 0000000000..c332399b70
@@ -0,0 +1,28 @@
+/*
+ * Unloved program to convert a binary on stdin to a C include on stdout
+ *
+ * Jan 1999 Matt Mackall <[email protected]>
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ */
+
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+	int ch, total = 0;
+
+	do {
+		printf("\t\"");
+		while ((ch = getchar()) != EOF) {
+			total++;
+			printf("\\x%02x", ch);
+			if (total % 16 == 0)
+				break;
+		}
+		printf("\"\n");
+	} while (ch != EOF);
+
+	return 0;
+}
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#14 lore raw
In reply to Juergen Gross
Quoted 9 lines · Juergen Gross

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.

Quoted 5 lines

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?

Dom0 only for now, I'd say. But if possible don't put in road blocks making relaxing this more difficult.

Quoted 1 line

+ how to integrate with xsm?

When Dom0 only, perhaps not needed more than wiring this through the same hook as e.g. the sysctl-s use?

Quoted 2 lines

- dynamical entries:
+ do we want support for e.g. per-domain and/or per-cpupool entries?

Down the road - perhaps.

Quoted 1 line

+ do we want support for debug aids (lock-profiling, debugtrace ..)?

Seeing you introduce a file system abstraction, have such go through a debugfs-like one?

Quoted 3 lines

- write access:
+ runtime parameters?
+ debugging aids?

For both - down the road, perhaps.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#15 lore raw
Quoted 10 lines · Jan Beulich
Quoted 9 lines · Juergen Gross

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.

Quoted 8 lines
Quoted 5 lines

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?

Dom0 only for now, I'd say. But if possible don't put in road blocks making relaxing this more difficult.

Sure.

Quoted 5 lines
Quoted 2 lines

+ how to integrate with xsm?

When Dom0 only, perhaps not needed more than wiring this through the same hook as e.g. the sysctl-s use?

Yes, or adding another hook for that purpose.

Quoted 10 lines
Quoted 3 lines

- dynamical entries:
+ do we want support for e.g. per-domain and/or per-cpupool entries?

Down the road - perhaps.

Quoted 1 line

+ do we want support for debug aids (lock-profiling, debugtrace ..)?

Seeing you introduce a file system abstraction, have such go through a debugfs-like one?

Well, I was more thinking of a "debug" directory for that purpose.

Quoted 6 lines
Quoted 4 lines

- write access:
+ runtime parameters?
+ debugging aids?

For both - down the road, perhaps.

Okay.

Thanks for the feedback,

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#16 lore raw
In reply to Juergen Gross
Quoted 8 lines · Juergen Gross

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.

Thankyou for looking into this.  It is a good step forwards.

First of all, I'd suggest that we have a document along the lines of xenstored-paths as the point of authority describing the path/file ABI.

Second, is xenfs really the best name here?  It is ambiguous with the still-essential (even though it really needs to disappear) Linux filesystem by the name xenfs.

Quoted 13 lines

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?

To answer some of these, we could really do with setting expectations on the scope of the work.  For reading configuration, I think is great. Even for modification of configuration, it looks to be a good interface which won't require every option to gain a new ad-hoc hypercall.

However, for anything which is expected to operate periodically (outside of debugging circumstances), I'm not sure its the best interface.

Stats collection in particular would be better using shared memory pages than constantly polling /domain/$domid/stats.  (Currently, its a slew of DOMCTL/etc hypercalls.  On systems with more than a dozen guests or so, stats collection is the primary source of domctl lock contention.)

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#17 lore raw
Quoted 10 lines · Andrew Cooper
Quoted 8 lines · Juergen Gross

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.

Quoted 4 lines

Thankyou for looking into this.  It is a good step forwards.

First of all, I'd suggest that we have a document along the lines of xenstored-paths as the point of authority describing the path/file ABI.

Fine with me.

Quoted 4 lines

Second, is xenfs really the best name here?  It is ambiguous with the still-essential (even though it really needs to disappear) Linux filesystem by the name xenfs.

Yes, I'm aware of that ambiguity. I'm absolutely in favor of finding a better name.

Maybe xensysfs?

Quoted 15 lines
Quoted 4 lines

There are still some pending questions, those are:

Quoted 10 lines

- 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?

Quoted 4 lines

To answer some of these, we could really do with setting expectations on the scope of the work.  For reading configuration, I think is great. Even for modification of configuration, it looks to be a good interface which won't require every option to gain a new ad-hoc hypercall.

Yes, that was the idea.

Quoted 2 lines

However, for anything which is expected to operate periodically (outside of debugging circumstances), I'm not sure its the best interface.

I completely agree.

Quoted 4 lines

Stats collection in particular would be better using shared memory pages than constantly polling /domain/$domid/stats.  (Currently, its a slew of DOMCTL/etc hypercalls.  On systems with more than a dozen guests or so, stats collection is the primary source of domctl lock contention.)

Sounds like another nice project. Maybe something for outreachy or some student looking for a larger project (wasn't there one recently?)

This could result in something like debugfs in the end.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#18 lore raw
Quoted 9 lines · Juergen Gross
Quoted 3 lines · Andrew Cooper

Second, is xenfs really the best name here?  It is ambiguous with the still-essential (even though it really needs to disappear) Linux filesystem by the name xenfs.

Yes, I'm aware of that ambiguity. I'm absolutely in favor of finding a better name.

Maybe xensysfs?

Or just xensys (albeit that's likely getting ambiguous)? I'm not fully convinced calling this a file system is a good idea. Windows' name-value pair store is called registry, for example, despite it also resembling a file system to a certain degree.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#19 lore raw
Quoted 9 lines · Jan Beulich
Quoted 8 lines · Juergen Gross
Quoted 3 lines · Andrew Cooper

Second, is xenfs really the best name here?  It is ambiguous with the still-essential (even though it really needs to disappear) Linux filesystem by the name xenfs.

Yes, I'm aware of that ambiguity. I'm absolutely in favor of finding a better name.

Quoted 7 lines
Quoted 1 line

Maybe xensysfs?

Or just xensys (albeit that's likely getting ambiguous)? I'm not fully convinced calling this a file system is a good idea. Windows' name-value pair store is called registry, for example, despite it also resembling a file system to a certain degree.

"Registry" doesn't seem correct regarding the potential dynamically generated entries.

And with the idea to "mount" it in the dom0 kernel's sysfs I think xensysfs (or xenhypfs?) seems appropriate.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#20 lore raw
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
Quoted 9 lines · Juergen Gross
Quoted 3 lines · Andrew Cooper

Second, is xenfs really the best name here?  It is ambiguous with the still-essential (even though it really needs to disappear) Linux filesystem by the name xenfs.

Yes, I'm aware of that ambiguity. I'm absolutely in favor of finding a better name.

Maybe xensysfs?

Quoted 8 lines
Quoted 5 lines

Or just xensys (albeit that's likely getting ambiguous)? I'm not fully convinced calling this a file system is a good idea. Windows' name-value pair store is called registry, for example, despite it also resembling a file system to a certain degree.

"Registry" doesn't seem correct regarding the potential dynamically generated entries.

I also didn't mean to suggest "registry" as a name. The Windows registry does, however (and despite its name), contain dynamic data afaik (certain performance counters for example).

Quoted 2 lines

And with the idea to "mount" it in the dom0 kernel's sysfs I think xensysfs (or xenhypfs?) seems appropriate.

Well, such "mounting" is going to be indirect, I would assume? I.e. not directly forward filesystem like requests as such to Xen?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#21 lore raw
Quoted 26 lines · Jan Beulich
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
Quoted 9 lines · Juergen Gross
Quoted 3 lines · Andrew Cooper

Second, is xenfs really the best name here?  It is ambiguous with the still-essential (even though it really needs to disappear) Linux filesystem by the name xenfs.

Yes, I'm aware of that ambiguity. I'm absolutely in favor of finding a better name.

Maybe xensysfs?

Quoted 8 lines
Quoted 5 lines

Or just xensys (albeit that's likely getting ambiguous)? I'm not fully convinced calling this a file system is a good idea. Windows' name-value pair store is called registry, for example, despite it also resembling a file system to a certain degree.

"Registry" doesn't seem correct regarding the potential dynamically generated entries.

I also didn't mean to suggest "registry" as a name. The Windows registry does, however (and despite its name), contain dynamic data afaik (certain performance counters for example).

Quoted 6 lines
Quoted 2 lines

And with the idea to "mount" it in the dom0 kernel's sysfs I think xensysfs (or xenhypfs?) seems appropriate.

Well, such "mounting" is going to be indirect, I would assume? I.e. not directly forward filesystem like requests as such to Xen?

For plain entries (reads and eventually writes) I surely would just forward them. In case this is possible for directories, too, I'd rather do no caching in the kernel, so forwarding them would seem to be appropriate (rejecting anything but reading a directory, of course).

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#22 lore raw
Quoted 5 lines · Juergen Gross
Quoted 4 lines · Jan Beulich
Quoted 2 lines · Juergen Gross

And with the idea to "mount" it in the dom0 kernel's sysfs I think xensysfs (or xenhypfs?) seems appropriate.

Quoted 8 lines
Quoted 3 lines

Well, such "mounting" is going to be indirect, I would assume? I.e. not directly forward filesystem like requests as such to Xen?

For plain entries (reads and eventually writes) I surely would just forward them. In case this is possible for directories, too, I'd rather do no caching in the kernel, so forwarding them would seem to be appropriate (rejecting anything but reading a directory, of course).

But that's still a kernel based file system, simply taking its data from Xen. It's not like file system requests as such would be forwarded.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#23 lore raw
Quoted 10 lines · Jan Beulich
Quoted 9 lines · Juergen Gross
Quoted 7 lines · Jan Beulich
Quoted 2 lines · Juergen Gross

And with the idea to "mount" it in the dom0 kernel's sysfs I think xensysfs (or xenhypfs?) seems appropriate.

Well, such "mounting" is going to be indirect, I would assume? I.e. not directly forward filesystem like requests as such to Xen?

Quoted 8 lines
Quoted 4 lines

For plain entries (reads and eventually writes) I surely would just forward them. In case this is possible for directories, too, I'd rather do no caching in the kernel, so forwarding them would seem to be appropriate (rejecting anything but reading a directory, of course).

But that's still a kernel based file system, simply taking its data from Xen. It's not like file system requests as such would be forwarded.

True.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel