Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1923415pxu; Fri, 27 Nov 2020 20:22:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfignT0KMo8XF0N5vKzMMxZXSkqoaUrKnGq0nQ1UYlnrwLQJImXyxKt22gj1MjBtTeSnln X-Received: by 2002:a17:906:a4b:: with SMTP id x11mr10877288ejf.11.1606537319970; Fri, 27 Nov 2020 20:21:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606537319; cv=none; d=google.com; s=arc-20160816; b=lTvLX/M7XGGUAz92tCgpOtejRovqwp226JG7Gpx7Jym6lg85cTVBhBCOjvv14Ypxqm NAI25Eq25pJeSxpyrwFdwRkKBWUvf7rhME1JNdRdawY7aME/jJ3vhysEPGiweX4ZulYk kErojLAkhzWIZyzuyEODTyB+SvF7n5jdcaDsJiyVdkFKOl9l9si5JNH9vyja/Bb4yLr/ AuPht0PYaePnATE4mdk3W/mC9POlVj5B43Bwlt16lf8GeWzc+gkP8GSJRvJZcFjaYI/O xvAteItgMEtm65KCcdqncxb/I/l0m2qlvWQGOte5Oj7W2NQPJXDUVMCoIIMbnJA9Nxpy zWqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ec1ud86y8iyIGHtravApZVjgzjgBfBbVjx+9jw6dsmY=; b=VAALK4Ww5l6MAuU/qwePYk4w2CurFy1h8KG86mlG58oilKmhjLvFmM/BA/tzMJjDqd 75/eUiMY+NEfjnTZLj1c1qDnq7uIoffP6A/D/XdirpXM5OSA7SyNXcKcK9RZY3x+6mgj F85sgVqfi40pEuaRf86BYEHQFTFz3mYg7llhO8BlkozaNGvlzGaQBQEBR3BssUp5QlFT JI1wL1+QEXU9QiE3nTyo0w88KQG1pCDh5ZPikeMyJSlnk95EfVybaqXWsoShEK+ejq3E ruHLnSkR10Z9DXV8w/p9dfh7HR0sMPfWG5pKEpTvjMfN39xR1hMZMUNp4RElKGuXkT1T +xMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=ftr8qI9b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn18si5957761ejb.676.2020.11.27.20.21.35; Fri, 27 Nov 2020 20:21:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=ftr8qI9b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731493AbgK1EEB (ORCPT + 99 others); Fri, 27 Nov 2020 23:04:01 -0500 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]:51911 "EHLO mx0b-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731107AbgK1Dnu (ORCPT ); Fri, 27 Nov 2020 22:43:50 -0500 Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AS3d2P1011982; Sat, 28 Nov 2020 03:42:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=ec1ud86y8iyIGHtravApZVjgzjgBfBbVjx+9jw6dsmY=; b=ftr8qI9bXSmIiVLBIstm67lvm2WipXRB082XuyzVZiVl4tPWjEX41gyrPlk0mONZchAL pTdtr6XwWiGK8Cft/nyttOPZhFG/5hl7A/SMSnsBK/zzdtiNyQzo6QOKF8aRWr5kU3zq 5MZW0ZbEWG6tNTT1uGJSiFvG3VBZ3H/yXqtFnb0ZlSIO4k1Gly1D84Ocz4COOL3G948z cOSYatRsaW+YOE2Djx7r0Yryfkdj9+/T5G0k40UyBVbibmzDlhOP6ouasDHKn8AKlxrW JGZ4ApwZGXREkfQWcYf6afCUFGl30F2gogNJjtYFaBu7Ws/Rw15Se6dJqF5JMLv57r7e Cw== Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 3532m2m0dd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 28 Nov 2020 03:42:55 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id F30B651; Sat, 28 Nov 2020 03:42:54 +0000 (UTC) Received: from dog.eag.rdlabs.hpecorp.net (dog.eag.rdlabs.hpecorp.net [128.162.243.181]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 03D204A; Sat, 28 Nov 2020 03:42:53 +0000 (UTC) From: Mike Travis To: Hans de Goede , Justin Ernst , Mark Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Steve Wahl Cc: Mike Travis , Dimitri Sivanich , Russ Anderson , "H. Peter Anvin" , Mauro Carvalho Chehab , Suzuki K Poulose , Ilya Dryomov , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH v2 2/5] x86/platform/uv: Add sysfs leaves to replace those in procfs Date: Fri, 27 Nov 2020 21:42:24 -0600 Message-Id: <20201128034227.120869-3-mike.travis@hpe.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20201128034227.120869-1-mike.travis@hpe.com> References: <20201128034227.120869-1-mike.travis@hpe.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-28_02:2020-11-26,2020-11-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 spamscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011280025 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add uv_sysfs leaves to display the info. Signed-off-by: Mike Travis Reviewed-by: Steve Wahl --- drivers/platform/x86/uv_sysfs.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index 54c342579f1c..115754cdcd89 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -735,17 +735,35 @@ static ssize_t uv_type_show(struct kobject *kobj, return scnprintf(buf, PAGE_SIZE, "%s\n", uv_type_string()); } +static ssize_t uv_archtype_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return uv_get_archtype(buf, PAGE_SIZE); +} + +static ssize_t uv_hub_type_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return scnprintf(buf, PAGE_SIZE, "0x%x\n", uv_hub_type()); +} + static struct kobj_attribute partition_id_attr = __ATTR(partition_id, 0444, partition_id_show, NULL); static struct kobj_attribute coherence_id_attr = __ATTR(coherence_id, 0444, coherence_id_show, NULL); static struct kobj_attribute uv_type_attr = __ATTR(uv_type, 0444, uv_type_show, NULL); +static struct kobj_attribute uv_archtype_attr = + __ATTR(archtype, 0444, uv_archtype_show, NULL); +static struct kobj_attribute uv_hub_type_attr = + __ATTR(hub_type, 0444, uv_hub_type_show, NULL); static struct attribute *base_attrs[] = { &partition_id_attr.attr, &coherence_id_attr.attr, &uv_type_attr.attr, + &uv_archtype_attr.attr, + &uv_hub_type_attr.attr, NULL, }; -- 2.21.0