Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp220118imw; Fri, 15 Jul 2022 01:37:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u36XBH6YLQtxtX+6mQWFfGKa4wAK73OJkLRpSdq+lY9NVudwfQUX2OQUT2ONwWb1saa8BV X-Received: by 2002:a17:907:2bf4:b0:72b:3336:ca9e with SMTP id gv52-20020a1709072bf400b0072b3336ca9emr12499191ejc.341.1657874258588; Fri, 15 Jul 2022 01:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657874258; cv=none; d=google.com; s=arc-20160816; b=1GCgbjGL/Xo84DZZ9rlG51qM+X/rm0HP4V2/K0ASk8gRYds1Qcpr1EC+PJFFwUgFjS JL2MB56KW5UdZRhsy0V8/+LOFu9TR0jx+PWw9LMU+wpz6zO8t6lwzX/UNme6fub7WFZ6 aAI5jUMzdcFrZu2PYtVh2poGUztDQtNIflxevim58yb1ufR0DkJnF9Ks9TEOH3Z+PXoT slSkJQ1iatSjhgrulFU2JNff1RslCbS2iR+eaA2CvGAJOrDTlc9dVKNStJAVK8vTNPjB a5QCLDnOXCI6zzLx9AvxAbuC+IEBdK6Y2jsodYtAYKK2x5pw2WtjgV3MY8U0WkAxGcX+ wntw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fVYrmCLytRMdV2BuUoTmeC7LqWv1xHlIm6mX4jyrEIU=; b=kVahLygIfwZUk6qsPdFSAj3rsW0FvAYgbztN0RGjrG5IQExTNHdOTJwKbdcubWjMfs fYgJg06kKgZECpGSELsiDE9OL4GtzOGbt/ELZKnyOMCwdWcz7jejVOOkhJb92ura0DXK RlAdKmyocilVZKa2tKwonZSOACw2bFY0gqjsqLWNdH5kJBkPpN/kWYxysz3q2TmGGCN1 2RitPG/bNDYjOZYsehG4K2vjelE/FLkUkD4v/P/dhqXabngT+MqoSzBmXakimb5zGWCL H+qklefFEk74ydYorrA4/abtuvheYixDd8CcwuCGzNbm0kbjlTP5N9U1UQX7RDZZ0Odl SJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=CaLEcwDA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc17-20020a1709078a1100b00726a3abf022si5624315ejc.781.2022.07.15.01.37.13; Fri, 15 Jul 2022 01:37:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=CaLEcwDA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbiGOIAA (ORCPT + 99 others); Fri, 15 Jul 2022 04:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbiGOH77 (ORCPT ); Fri, 15 Jul 2022 03:59:59 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A52757E00A; Fri, 15 Jul 2022 00:59:58 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26F7DL0h022959; Fri, 15 Jul 2022 07:59:57 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=fVYrmCLytRMdV2BuUoTmeC7LqWv1xHlIm6mX4jyrEIU=; b=CaLEcwDAoHcAOweuugtUI4MgffuSpzZp1JePN15H0U2bv6FPP1llgP4oIVCleiIhddvr MYeDJtjpK2e6zJEYQuNlaR9unkbYqfXpVMpLZFyE63cW8DbDN/i9iRimShfkWCGx2IWw nqUIfF4iQL4YC7oOBwMpQHU2LqYFHSh8I+3SGIQvQ+XNXs+f608q6VWqfM6FZciRQa4D 324smx7NftRKGwCm8KsQl+OrgA+zo6U90iCiMTi4Qdi/pdD+3sfoLX4RFMxBakU0Y+cY itqm3lYIXHEs9G3yM2CT1iZUOtfGzUyjwoF7fC3LgwbCyqIyGAmAriNfxIuMH2HfT1jw yw== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3hb3nd8uff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jul 2022 07:59:56 +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 26F7wUPD024616; Fri, 15 Jul 2022 07:59:55 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 3h70xj03xa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jul 2022 07:59:55 +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 26F7xpca25297284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jul 2022 07:59:52 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E28F042045; Fri, 15 Jul 2022 07:59:51 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC1C642042; Fri, 15 Jul 2022 07:59:51 +0000 (GMT) Received: from vela (unknown [9.145.26.36]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 15 Jul 2022 07:59:51 +0000 (GMT) Received: from brueckner by vela with local (Exim 4.94.2) (envelope-from ) id 1oCGEo-0002br-2L; Fri, 15 Jul 2022 09:59:50 +0200 Date: Fri, 15 Jul 2022 09:59:49 +0200 From: Hendrik Brueckner To: Steffen Eiden Cc: Heiko Carstens , 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 v2 1/3] s390/cpufeature: rework to allow more than only hwcap bits Message-ID: References: <20220713125644.16121-1-seiden@linux.ibm.com> <20220713125644.16121-2-seiden@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220713125644.16121-2-seiden@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Q_DGKmW8O11JVK0pBqw0XchW-w0XMO0R X-Proofpoint-ORIG-GUID: Q_DGKmW8O11JVK0pBqw0XchW-w0XMO0R 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-15_02,2022-07-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 malwarescore=0 bulkscore=0 adultscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207150031 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2022 at 02:56:42PM +0200, Steffen Eiden wrote: > From: Heiko Carstens > > Rework cpufeature implementation to allow for various cpu feature > indications, which is not only limited to hwcap bits. This is achieved > by adding a sequential list of cpu feature numbers, where each of them > is mapped to an entry which indicates what this number is about. > > Each entry contains a type member, which indicates what feature > name space to look into (e.g. hwcap, or cpu facility). If wanted this > allows also to automatically load modules only in e.g. z/VM > configurations. > > Signed-off-by: Heiko Carstens > Signed-off-by: Steffen Eiden > --- > arch/s390/crypto/aes_s390.c | 2 +- > arch/s390/crypto/chacha-glue.c | 2 +- > arch/s390/crypto/crc32-vx.c | 2 +- > arch/s390/crypto/des_s390.c | 2 +- > arch/s390/crypto/ghash_s390.c | 2 +- > arch/s390/crypto/prng.c | 2 +- > arch/s390/crypto/sha1_s390.c | 2 +- > arch/s390/crypto/sha256_s390.c | 2 +- > arch/s390/crypto/sha3_256_s390.c | 2 +- > arch/s390/crypto/sha3_512_s390.c | 2 +- > arch/s390/crypto/sha512_s390.c | 2 +- Regarding facility bits for cpu features: Initially, I used MSA hwcap to cover all ciphers among all hw generations. With facility bit checks, it makes more sense to fine-tune and load based on respective MSA level or CPACF functions that is required for ciphers/hashes. E.g. like > diff --git a/arch/s390/crypto/sha512_s390.c b/arch/s390/crypto/sha512_s390.c > index 43ce4956df73..04f11c407763 100644 > --- a/arch/s390/crypto/sha512_s390.c > +++ b/arch/s390/crypto/sha512_s390.c > @@ -142,7 +142,7 @@ static void __exit fini(void) > crypto_unregister_shash(&sha384_alg); > } > > -module_cpu_feature_match(MSA, init); > +module_cpu_feature_match(S390_CPU_FEATURE_MSA, init); > module_exit(fini); which becomes automatically loaded if (any) MSA is available and then performs this check: cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_512 which in the worst case would fail. This might be a very useful follow-up patch to remove those mod init checks into the cpu feature. Other than that, Reviewed-by: Hendrik Brueckner