|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] drivers/xen/hypervisor: Expose VM SIF flags to userspace
On 29.11.22 16:00, Per Bilse wrote: /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/properties/flags, which will coexist with /proc/xen while dependencies are being migrated. Possible values are "privileged", "initdomain", "multiboot", "mod_start_pfn", and "virtmap", with "initdomain" being the equivalent of "control_d". Signed-off-by: Per Bilse <per.bilse@xxxxxxxxxx> --- drivers/xen/sys-hypervisor.c | 26 ++++++++++++++++++++++++++ include/xen/interface/xen.h | 13 ++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c index fcb0792f090e..7393e04bdb6d 100644 --- a/drivers/xen/sys-hypervisor.c +++ b/drivers/xen/sys-hypervisor.c @@ -379,6 +379,31 @@ static ssize_t buildid_show(struct hyp_sysfs_attr *attr, char *buffer)HYPERVISOR_ATTR_RO(buildid); +static ssize_t flags_show(struct hyp_sysfs_attr *attr, char *buffer) Please don't change this header, as it is based on its master located in the Xen repository. An acceptable solution would be to send a Xen patch first doing the xen.h changes, and when that patch has been taken to modify the related Linux header accordingly. In case you want to go that route, please add a "XEN_" prefix to the enum members. Juergen Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc Attachment:
OpenPGP_signature
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |