drivers/xen/hypervisor: Expose Xen SIF flags to userspace
PATCH v2 1/1 drivers/xen/hypervisor: Expose Xen SIF flags to userspace
/proc/xen is a legacy pseudo filesystem which predates Xen support getting merged into Linux. It has largely been replaced with more normal locations for data (/sys/hypervisor/ for info, /dev/xen/ for user devices). We want to compile xenfs support out of the dom0 kernel.
There is one item which only exists in /proc/xen, namely /proc/xen/capabilities with "control_d" being the signal of "you're in the control domain". This ultimately comes from the SIF flags provided at VM start.
This patch exposes all SIF flags in /sys/hypervisor/start_flags/ as boolean files, one for each bit, returning '1' if set, '0' otherwise. Two known flags, 'privileged' and 'initdomain', are explicitly named, and all remaining flags can be accessed via generically named files, as suggested by Andrew Cooper.
---
v2: minor fix to layout, incorporate suggestions from Juergen Gross
--- Documentation/ABI/stable/sysfs-hypervisor-xen | 13 ++++ drivers/xen/sys-hypervisor.c | 69 +++++++++++++++++-- 2 files changed, 78 insertions(+), 4 deletions(-)
Documentation/ABI/stable/sysfs-hypervisor-xen +13 -0
@@ -120,3 +120,16 @@ Contact: [email protected] Description: If running under Xen: The Xen version is in the format <major>.<minor><extra> This is the <minor> part of it. + +What: /sys/hypervisor/start_flags/* +Date: December 2022 +KernelVersion: 6.1.0 +Contact: [email protected] +Description: If running under Xen: + All bits in Xen's start-flags are represented as + boolean files, returning '1' if set, '0' otherwise. + This takes the place of the defunct /proc/xen/capabilities, + which would contain "control_d" on dom0, and be empty + otherwise. This flag is now exposed as "initdomain" in + addition to the "privileged" flag; all other possible flags + are accessible as "unknownXX".
drivers/xen/sys-hypervisor.c +65 -4
96 lines not on this page · raw message
Signature · 1 line
2.31.1