From patchwork Thu Aug 11 21:41:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliot Berman X-Patchwork-Id: 12941760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0F7AC25B07 for ; Thu, 11 Aug 2022 21:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gR8wtbR7nd60ol0e0nLsBzGO8SCNfb5qIdzBjweFauk=; b=CXTOETOtagM1hR FvVy6YXxznH35Hdk4Lsyp85uWeQiVgGiM6zQ6j/8Zbki3JR4GZunpB68A7DMuhXD4CtKehmAHOBWv undbTvwtyOPAUKTmBQO5a2oj0xrlovQTUuDy/6AbYmBhi6YuaMIpcRUylCCJ1DkKXRUMQoHgNT7Ep bgsXaEeB0XrYm3IHBy0bnDtXE83fFzbVayMZcQE+DZVs8wrLvGqfLPYFoiWh7mlu9XwswoyzABryF 9Cxq+xwRW4EglvAv6JDh4l8Qbo0X5yaDTn7layZo7Y50tYlwASBEXKj9TK7FQ7TQ7rppxKtsUZ8ie mTesr6uHk9I1vw7R5NhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMG1x-005maF-67; Thu, 11 Aug 2022 21:47:53 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMG1D-005m2R-06 for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 21:47:08 +0000 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BL07GH025299; Thu, 11 Aug 2022 21:47:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Ca2C2tx5BzQbZuV4HRZgNfAx1TlE2A/94biwGzQALew=; b=P1W5C9CzWVyqo2W+erOXYZLIKvxriyJCfsinmtuj0xqX/bBap8OANFtkmxuIl/IugCmv E/6Zr1w4IbcN4b30UjysVfhHVwY+h7JYI/lCBNtfbmPU3GBJzFTN4FnNvmxMGS6A/nlZ Nwn+2pIwMsqkUnu2nu1tALYBFFWIsC647CSz/jVE2K+4NY50sPW/1uJ2eIKLH491iU4W XtcPu3hbyy/Uh9fpK54A8CtqNqv0RIc5UYtF9PLVPMV76RaYzk5KgOaKvYJ8FJsbp6P1 munWhh+Hdzu5oyJNgUtT6NYElbypBA7bD6asZST2MfXICPXi0ldacMUOAuEvVkm4Jfqr pQ== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3hv95ywwdu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 21:47:01 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 27BLg0GW018016 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 21:42:00 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 11 Aug 2022 14:41:59 -0700 From: Elliot Berman To: Bjorn Andersson CC: Elliot Berman , Murali Nalajala , Trilok Soni , "Srivatsa Vaddagiri" , Carl van Schaik , Andy Gross , Dmitry Baryshkov , , "Mark Rutland" , Lorenzo Pieralisi , Sudeep Holla , "Marc Zyngier" , Rob Herring , "Krzysztof Kozlowski" , Jonathan Corbet , Will Deacon , Catalin Marinas , , , Subject: [PATCH v3 08/12] gunyah: sysfs: Add node to describe supported features Date: Thu, 11 Aug 2022 14:41:03 -0700 Message-ID: <20220811214107.1074343-9-quic_eberman@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220811214107.1074343-1-quic_eberman@quicinc.com> References: <20220811214107.1074343-1-quic_eberman@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: A0WIgKTzhM8ZsUpTGpNNvemYtk6oQ-QD X-Proofpoint-GUID: A0WIgKTzhM8ZsUpTGpNNvemYtk6oQ-QD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_13,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 impostorscore=0 suspectscore=0 mlxlogscore=962 priorityscore=1501 spamscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208110065 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220811_144707_135292_6BA689C6 X-CRM114-Status: GOOD ( 17.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 219465783a9e..7c14027b3daa 100644 --- a/Documentation/ABI/testing/sysfs-hypervisor-gunyah +++ b/Documentation/ABI/testing/sysfs-hypervisor-gunyah @@ -6,6 +6,21 @@ Description: If running under Gunyah: Type of hypervisor: "gunyah": Gunyah hypervisor +What: /sys/hypervisor/gunyah/features +Date: August 2022 +KernelVersion: 6.0 +Contact: linux-arm-msm@vger.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: August 2022 KernelVersion: 6.0 diff --git a/drivers/virt/gunyah/sysfs.c b/drivers/virt/gunyah/sysfs.c index 9de700fdbfcb..8c6ea141ec66 100644 --- a/drivers/virt/gunyah/sysfs.c +++ b/drivers/virt/gunyah/sysfs.c @@ -31,9 +31,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 };