From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DDB5C433EF for ; Thu, 14 Jul 2022 10:52:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B83239401A2; Thu, 14 Jul 2022 06:52:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B3338940134; Thu, 14 Jul 2022 06:52:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FB5E9401A2; Thu, 14 Jul 2022 06:52:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8FAA5940134 for ; Thu, 14 Jul 2022 06:52:34 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 55D26610A7 for ; Thu, 14 Jul 2022 10:52:34 +0000 (UTC) X-FDA: 79685391828.15.F0F6EEA Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf18.hostedemail.com (Postfix) with ESMTP id 878381C00A5 for ; Thu, 14 Jul 2022 10:52:33 +0000 (UTC) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26EAEiLs022351; Thu, 14 Jul 2022 10:52:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=C2anyf1yrzZL+ykuU7hePx5FGIyAtJfSq27x8aEWYlQ=; b=P+ZYnhyBkj4uD5ekcbvFSTTxYGHuN861MbkdF2iduFHrivA4mhzRkaDIhRbmN8LomR3/ vzh8H/p3tEzY4RQKMkmiTAaAfCiocBLx8xoPRii8CKHC+p2L51th1PkmwfoT2svS5tB/ ivz7c3n6LCsJu+MnYXF4ds0XSDvcb7Gygm8UkGCXztzbsZK4ms/9slyi81eqBF3OAf/j cVU95fXN6fRzbcoNu2AFz3PijP7TBwRLW/uZyH+l116v5/x2aWjeJXjk3bAHg3GLalk9 dvpGbHYJDRGri/FkUGMzCrDEIwyMAtw5cpL6wsQIlThdmc45wYSISf8mbkoqu+OUiufK xw== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hah7g8tks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Jul 2022 10:52:31 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26EAotOF013987; Thu, 14 Jul 2022 10:52:29 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma06ams.nl.ibm.com with ESMTP id 3h70xhxytf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Jul 2022 10:52:29 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26EAqQuc23986492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Jul 2022 10:52:26 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3326D42041; Thu, 14 Jul 2022 10:52:26 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8A634203F; Thu, 14 Jul 2022 10:52:25 +0000 (GMT) Received: from osiris (unknown [9.152.212.242]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 14 Jul 2022 10:52:25 +0000 (GMT) Date: Thu, 14 Jul 2022 12:52:25 +0200 From: Heiko Carstens To: Steffen Eiden Cc: Alexander Gordeev , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Vasily Gorbik , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, nrb@linux.ibm.com Subject: Re: [PATCH 1/3] s390/cpufeature: rework to allow more than only hwcap bits Message-ID: References: <20220712105220.325010-1-seiden@linux.ibm.com> <20220712105220.325010-2-seiden@linux.ibm.com> <4132ba2a-f5ad-25ba-7f74-72369b8a140b@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4132ba2a-f5ad-25ba-7f74-72369b8a140b@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: yRg23_3jnu08hiJYNPJsp6LzK6eLTS1l X-Proofpoint-ORIG-GUID: yRg23_3jnu08hiJYNPJsp6LzK6eLTS1l 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-07-14_08,2022-07-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 mlxlogscore=990 priorityscore=1501 lowpriorityscore=0 bulkscore=0 mlxscore=0 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207140044 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657795953; a=rsa-sha256; cv=none; b=IUV6AlnwSc87025OnAEB2Av6lLLo4DDKrGSWuG8FaYU0EWyTp6KD3bccDyUQGAm9UHcseF PjCR9VtgsllHcnTrQlnT2p6cpl4euRt/AYKJ3cqV7OZ94Pef1yJkYtuIzH2vZHO95K5I6J Ew5kpMuLOid/NyoBdlx5QKW96ZjZyCw= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=P+ZYnhyB; spf=pass (imf18.hostedemail.com: domain of hca@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=hca@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657795953; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=C2anyf1yrzZL+ykuU7hePx5FGIyAtJfSq27x8aEWYlQ=; b=r8vyGFd0NqByo7y5GkjmaFbn1Im46sJk2v9mtzcpX1smO4kaJTTvMHL0iEi0YKXBbLHF5j whd/yR1FHP2VIMr5Zq8nNjtgUGV3q1YbenXhwjIHWuHAUPzv+HlY4mXbarwKKkUdjobRGI nApvsBX53WW3jA8dbxx7L37Pchq6xCw= X-Rspamd-Queue-Id: 878381C00A5 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=P+ZYnhyB; spf=pass (imf18.hostedemail.com: domain of hca@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=hca@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam02 X-Rspam-User: X-Stat-Signature: csea9pyns1tukt7cgdu9aejq4citf8rc X-HE-Tag: 1657795953-884977 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > > > +static struct s390_cpu_feature s390_cpu_features[MAX_CPU_FEATURES] = { > > > + [S390_CPU_FEATURE_ESAN3] = {.type = TYPE_HWCAP, .num = HWCAP_NR_ESAN3}, > > > + [S390_CPU_FEATURE_ZARCH] = {.type = TYPE_HWCAP, .num = HWCAP_NR_ZARCH}, ... > > I only realized now that you added all HWCAP bits here. It was > > intentional that I added only the two bits which are currently used > > for several reasons: > > > > - Keep the array as small as possible. > > - No need to keep this array in sync with HWCAPs, if new ones are added. > > - There is a for loop in print_cpu_modalias() which iterates over all > > MAX_CPU_FEATURES entries; this should be as fast as possible. Adding > > extra entries burns cycles for no added value. > The loop in print_cpu_modalias() was the reason why I added all > current HWCAPs. The current implementation runs through all HWCAPs > using cpu_have_feature() and I feared that reducing to just MSA and > VXRS has effects in the reporting of CPU-features to userspace. > > I double checked the output of 'grep features /proc/cpuinfo' and it > stays the same, for 5.19-rc6, 5.19-rc6+this series, 5.19-rc6+this series > with just the two S390_CPU_FEATUREs. I might have misunderstood what happens > in that loop in print_cpu_modalias(). It is used on cpu hotplug to generate a MODALIAS environment variable. You can check that by running "udevadm monitor -p" and then switching a cpu off/on. This environment variable is then used by systemd/udev to load feature matching modules via kmod.