Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2077569rdf; Mon, 6 Nov 2023 04:18:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHj+IccmjpsVeKP+j30bYraFCXlzlFuHkxCgIkHigbtuzCI93D5Bu7aSrcyqp177ESp45jb X-Received: by 2002:aa7:8881:0:b0:691:2d4:23b2 with SMTP id z1-20020aa78881000000b0069102d423b2mr25911065pfe.15.1699273126049; Mon, 06 Nov 2023 04:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699273126; cv=none; d=google.com; s=arc-20160816; b=OpBWDaQsMUdHkoQR6gSqgR0fOtG6YB09DmL2KJTeBfJXQRj00q5AU2CFelYqOw4+U9 Qnbu8TkFGp5clt9LMAZD9gWyfxEiyFzU42PygvFz6A5OSzwFyt6bTKwA5omlriCRxU/k nKwtgXgUlF5LXC4nvUIahbmZRS9jirZkZGGC0PspnmwenvbJ0JiFrtrhpp0ZWnbr+pQU z4VoOLrLuaMtrYqtcb6GWd874oJYSgMvS9FML107RfgBipsRYJ1Tu+2HzIaKJIwkqvMS 9uCQCk9zdneuDsrmYaxLAeSEYafMDqemUcB1fJuJsz2uw62fStKz5bMU+4bW+HgxRPZS ZONA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=n1HCNS2C1DIwKMuK9T+3ZhC1Zs59rbEWAeWHmBM+lqw=; fh=MqNuOCfeMfj5gJaDUoX/khQrtOnn2oXnZN5EnLaC8I0=; b=bBpGY5qMe+BvkuArIgi1fpIue3VlBPhIPnymcDMMlnIldvR9Huem0Lm/+eDnT52lF5 EvA0cvbmjBgMQiQ5M/ktpIoxMdiYC/Rbn+uZXbKZDTi5KN9Mr5QKCxtTuCtnosMPqIO2 TcG3563ytSvrMRjTj1vLuSLw0SGc6jO/KwQrb4iipfFcBxBazT5XfswstcXw3phgUTgm HZMG4iEZ8uL1v0R05f/EYYcZ+wLp5DoU794b4mZTDAlIXH5DWIRZXuwAF/tzkEc9YVdY bnKaDprZChPjMi+YJFhJXtTBLlg0vgWb5AF2erla0ODy3phGL7wtOYUdjYVOMcXTFD7U /vQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=i5AHHhBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cg11-20020a056a00290b00b006bdd721a84asi8167558pfb.299.2023.11.06.04.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 04:18:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=i5AHHhBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D25FD8029DC9; Mon, 6 Nov 2023 04:18:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231577AbjKFMSn (ORCPT + 99 others); Mon, 6 Nov 2023 07:18:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231887AbjKFMSS (ORCPT ); Mon, 6 Nov 2023 07:18:18 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3112710DD; Mon, 6 Nov 2023 04:18:14 -0800 (PST) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A6Bkw2U008679; Mon, 6 Nov 2023 12:18:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=n1HCNS2C1DIwKMuK9T+3ZhC1Zs59rbEWAeWHmBM+lqw=; b=i5AHHhBnIONfmYlm0w/zpnikchMh3ADiH7/S4H+lS3sZrDzcNiJSkFoJuw/Oz8eb9WxL 53MrMnOPDOVChRktJtMhh6O0EGh/6tEQTMWNt6LhjdzygTeWF/SX+LDNvg3Hs/sf4Fz7 Q6WT+4Fl+VzABax5a3VhL55Oi4EmdJMWeYcjYYatPzRVT8Ngkzj7MEhjcew5alX2ZUOt VLhFHczCFOZ4ZmUNSywxM662PVtD8FwYgNhLBhLW1MNvGdVsfluIjfeHl00iNjtNLQrD vX23YBmWaohAPPfAzmbpYvn2YDz3i2ovWuwygV9omZurByskW9QQu4edo8iDXj+SGj1U 9Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u6yjtrwn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Nov 2023 12:18:13 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A6BlZ8a011477; Mon, 6 Nov 2023 12:18:12 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u6yjtrwmt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Nov 2023 12:18:12 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A6AbsxW007958; Mon, 6 Nov 2023 12:18:12 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3u60ny996j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Nov 2023 12:18:11 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A6CI5P614090842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Nov 2023 12:18:05 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBD492004B; Mon, 6 Nov 2023 12:18:05 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 620C620040; Mon, 6 Nov 2023 12:18:05 +0000 (GMT) Received: from p-imbrenda (unknown [9.152.224.66]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Nov 2023 12:18:05 +0000 (GMT) Date: Mon, 6 Nov 2023 13:18:03 +0100 From: Claudio Imbrenda To: Nina Schoetterl-Glausch Cc: Christian Borntraeger , Janosch Frank , Heiko Carstens , Alexander Gordeev , Vasily Gorbik , David Hildenbrand , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, Cornelia Huck , Sven Schnelle , Michael Mueller , David Hildenbrand Subject: Re: [PATCH 4/4] KVM: s390: Minor refactor of base/ext facility lists Message-ID: <20231106131803.15985f2e@p-imbrenda> In-Reply-To: <44148ab315f28a6d77627675cbde26977418c5df.camel@linux.ibm.com> References: <20231103173008.630217-1-nsg@linux.ibm.com> <20231103173008.630217-5-nsg@linux.ibm.com> <20231103193254.7deef2e5@p-imbrenda> <44148ab315f28a6d77627675cbde26977418c5df.camel@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zCB3qCG0MBJbK2Og1pgD2i0QNMNE7wAS X-Proofpoint-ORIG-GUID: VNPB-bMD6Dt-6lDqQztXxZ7bqmVTtsQx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-06_10,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 mlxlogscore=773 clxscore=1015 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311060100 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 04:18:45 -0800 (PST) On Mon, 06 Nov 2023 12:38:55 +0100 Nina Schoetterl-Glausch wrote: [...] > > this was sized to [SIZE_INTERNAL], now it doesn't have a fixed size. is > > this intentional? > > Yes, it's as big as it needs to be, that way it cannot be too small, so one > less thing to consider. fair enough > [...] > > > /* available cpu features supported by kvm */ > > > static DECLARE_BITMAP(kvm_s390_available_cpu_feat, KVM_S390_VM_CPU_FEAT_NR_BITS); > > > @@ -3341,13 +3333,16 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) > > > kvm->arch.sie_page2->kvm = kvm; > > > kvm->arch.model.fac_list = kvm->arch.sie_page2->fac_list; > > > > > > - for (i = 0; i < kvm_s390_fac_size(); i++) { > > > + for (i = 0; i < ARRAY_SIZE(kvm_s390_fac_base); i++) { > > > kvm->arch.model.fac_mask[i] = stfle_fac_list[i] & > > > - (kvm_s390_fac_base[i] | > > > - kvm_s390_fac_ext[i]); > > > + kvm_s390_fac_base[i]; > > > kvm->arch.model.fac_list[i] = stfle_fac_list[i] & > > > kvm_s390_fac_base[i]; > > > } > > > + for (i = 0; i < ARRAY_SIZE(kvm_s390_fac_ext); i++) { > > > + kvm->arch.model.fac_mask[i] |= stfle_fac_list[i] & > > > + kvm_s390_fac_ext[i]; > > > + } > > > > I like it better when it's all in one place, instead of having two loops > > Hmm, it's the result of the arrays being different lengths now. ah, I had missed that, the names are very similar. > > [...] > > > > - for (i = 0; i < 16; i++) > > > - kvm_s390_fac_base[i] |= > > > - stfle_fac_list[i] & nonhyp_mask(i); > > > + for (i = 0; i < HMFAI_DWORDS; i++) > > > + kvm_s390_fac_base[i] |= nonhyp_mask(i); > > > > where did the stfle_fac_list[i] go? > > I deleted it. That's what I meant by "Get rid of implicit double > anding of stfle_fac_list". > Besides it being redundant I didn't like it conceptually. > kvm_s390_fac_base specifies the facilities we support, regardless > if they're installed in the configuration. The hypervisor managed > ones are unconditionally declared via FACILITIES_KVM and we can add > the non hypervisor managed ones unconditionally, too. makes sense > > > > r = __kvm_s390_init(); > > > if (r) > > >