[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220928195633.2348848-11-quic_eberman@quicinc.com>
Date: Wed, 28 Sep 2022 12:56:29 -0700
From: Elliot Berman <quic_eberman@...cinc.com>
To: Bjorn Andersson <quic_bjorande@...cinc.com>
CC: Elliot Berman <quic_eberman@...cinc.com>,
Murali Nalajala <quic_mnalajal@...cinc.com>,
Trilok Soni <quic_tsoni@...cinc.com>,
"Srivatsa Vaddagiri" <quic_svaddagi@...cinc.com>,
Carl van Schaik <quic_cvanscha@...cinc.com>,
Andy Gross <agross@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Jassi Brar <jassisinghbrar@...il.com>,
<linux-arm-kernel@...ts.infradead.org>,
Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Sudeep Holla <sudeep.holla@....com>,
Marc Zyngier <maz@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Jonathan Corbet <corbet@....net>,
"Will Deacon" <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
"Arnd Bergmann" <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
<devicetree@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v4 10/14] gunyah: sysfs: Add node to describe supported features
Add a sysfs node to list the features that the Gunyah hypervisor and
Linux supports. For now, Linux support cspace (capability IDs) and
message queues, so only report those..
Signed-off-by: Elliot Berman <quic_eberman@...cinc.com>
---
Documentation/ABI/testing/sysfs-hypervisor-gunyah | 15 +++++++++++++++
drivers/virt/gunyah/sysfs.c | 15 +++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-hypervisor-gunyah b/Documentation/ABI/testing/sysfs-hypervisor-gunyah
index 7d74e74e9edd..6d0cde30355a 100644
--- a/Documentation/ABI/testing/sysfs-hypervisor-gunyah
+++ b/Documentation/ABI/testing/sysfs-hypervisor-gunyah
@@ -1,3 +1,18 @@
+What: /sys/hypervisor/gunyah/features
+Date: October 2022
+KernelVersion: 6.1
+Contact: linux-arm-msm@...r.kernel.org
+Description: If running under Gunyah:
+ Space separated list of features supported by Linux and Gunyah:
+ "cspace": Gunyah devices
+ "doorbell": Sending/receiving virtual interrupts via Gunyah doorbells
+ "message-queue": Sending/receiving messages via Gunyah message queues
+ "vic": Interrupt lending
+ "vpm": Virtual platform management
+ "vcpu": Virtual CPU management
+ "memextent": Memory lending/management
+ "trace": Gunyah hypervisor tracing
+
What: /sys/hypervisor/gunyah/api
Date: October 2022
KernelVersion: 6.1
diff --git a/drivers/virt/gunyah/sysfs.c b/drivers/virt/gunyah/sysfs.c
index ec11510cbece..f8ec0553c197 100644
--- a/drivers/virt/gunyah/sysfs.c
+++ b/drivers/virt/gunyah/sysfs.c
@@ -25,9 +25,24 @@ static ssize_t variant_show(struct kobject *kobj, struct kobj_attribute *attr, c
}
static struct kobj_attribute variant_attr = __ATTR_RO(variant);
+static ssize_t features_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+ int len = 0;
+
+ if (GH_IDENTIFY_PARTITION_CSPACE(gunyah_api.flags))
+ len += sysfs_emit_at(buffer, len, "cspace ");
+ if (GH_IDENTIFY_MSGQUEUE(gunyah_api.flags))
+ len += sysfs_emit_at(buffer, len, "message-queue ");
+
+ len += sysfs_emit_at(buffer, len, "\n");
+ return len;
+}
+static struct kobj_attribute features_attr = __ATTR_RO(features);
+
static struct attribute *gunyah_attrs[] = {
&api_attr.attr,
&variant_attr.attr,
+ &features_attr.attr,
NULL
};
--
2.25.1
Powered by blists - more mailing lists