This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Fri Apr 26 21:44:52 2024 >From mailfetcher Fri Dec 10 09:36:53 2021 Envelope-to: lkml@grols.ch Delivery-date: Fri, 10 Dec 2021 09:36:40 +0100 Received: from stout.grols.ch [195.201.141.146] by 72459556e3a9 with IMAP (fetchmail-6.3.26) for (single-drop); Fri, 10 Dec 2021 09:36:53 +0100 (CET) Received: from vger.kernel.org ([23.128.96.18]) by stout.grols.ch with esmtp (Exim 4.92) (envelope-from ) id 1mvbOS-0004qu-Nr for lkml@grols.ch; Fri, 10 Dec 2021 09:36:40 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238538AbhLJIkN (ORCPT ); Fri, 10 Dec 2021 03:40:13 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57004 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbhLJIkM (ORCPT ); Fri, 10 Dec 2021 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BA6wkPR040266; Fri, 10 Dec 2021 08:36:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=FJ2WBO1seFaD3EU10SvBw7CNtQkrcZB2rnVjxCeLqfM=; b=nao+kDG5ZdrSVf Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cv23nhrty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Dec 2021 08:36:37 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BA7Rgpl021771; Fri, 10 Dec 2021 08:36:37 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cv23nhrss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Dec 2021 08:3 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BA8S65c011156; Fri, 10 Dec 2021 08:36:34 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma06fra.de.ibm.com with ESMTP id 3cqykget2n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Dec 2021 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BA8aV4g27591064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA38 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D772A4054; Fri, 10 Dec 2021 08:36:31 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC182A4067; Fri, 10 Dec 2021 08:36:29 +0000 (GMT) Received: from sig-9-145-163-175.de.ibm.com (unknown [9.145.163.175]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 10 Dec 2021 08:36:29 +0000 (GMT) Message-Id: Subject: Re: [PATCH 14/32] KVM: s390: pci: do initial setup for AEN interpretation From: Niklas Schnelle To: Matthew Rosato , Christian Borntraeger , linux-s390@vger.kernel.org Cc: alex.williamson@redhat.com, cohuck@redhat.com, farman@linux.ibm.com, pmorel@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, agordeev@linux.ibm.com, frankja@linux.ibm.com, david@redhat.com, Date: Fri, 10 Dec 2021 09:36:29 +0100 In-Reply-To: <31980a07-e2e8-cef3-f0b4-370dad4cb14c@linux.ibm.com> References: <20211207205743.150299-1-mjrosato@linux.ibm.com> <20211207205743.150299-15-mjrosato@linux.ibm.com> <596857e3-ab13-7513-eeda-ed407fe22732@linux.ibm.com> <31980a07-e2e8-cef3-f0b4-370dad4cb14c@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: toWC4W74o5bzcLAcc3TR0xGgU_7EsKtc X-Proofpoint-GUID: 5qo78H_0h78S6eR4H29CDSe9yDRDJF7C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-10_03,2021-12-08_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 mlxscore=0 priorityscore=1501 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=m Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org Received-SPF: pass client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org X-Spam-Score: -3.5 X-Spam-Score-Bar: --- X-Spam-Action: no action X-Spam-Report: Action: no action Symbol: ARC_NA(0.00) Symbol: FORGED_SENDER_MAILLIST(0.00) Symbol: R_DKIM_ALLOW(-0.20) Symbol: BAYES_HAM(-2.99) Symbol: FROM_HAS_DN(0.00) Symbol: TO_DN_SOME(0.00) Symbol: MV_CASE(0.50) Symbol: PRECEDENCE_BULK(0.00) Symbol: MIME_GOOD(-0.1 On Thu, 2021-12-09 at 15:20 -0500, Matthew Rosato wrote: > On 12/9/21 2:54 PM, Christian Borntraeger wrote: > > Am 07.12.21 um 21:57 schrieb Matthew Rosato: > > > Initial setup for Adapter Event Notification Interpretation for zPCI > > > passthrough devices. Specifically, allocate a structure for > > > forwarding of > > > adapter events and pass the address of this structure to firmware. > > > > > > Signed-off-by: Matthew Rosato > > > --- > > > arch/s390/include/asm/pci_insn.h | 12 ++++ > > > arch/s390/kvm/interrupt.c | 17 +++++ > > > arch/s390/kvm/kvm-s390.c | 3 + > > > arch/s390/kvm/pci.c | 113 +++++++++++++++++++++++++++++++ > > > arch/s390/kvm/pci.h | 42 ++++++++++++ > > > 5 files changed, 187 insertions(+) > > > create mode 100644 arch/s390/kvm/pci.h > > > ---8<--- > > > int kvm_s390_pci_dev_open(struct zpci_dev *zdev) > > > { > > > @@ -55,3 +162,9 @@ int kvm_s390_pci_attach_kvm(struct zpci_dev *zdev, > > > struct kvm *kvm) > > > return 0; > > > } > > > EXPORT_SYMBOL_GPL(kvm_s390_pci_attach_kvm); > > > + > > > +void kvm_s390_pci_init(void) > > > +{ > > > + spin_lock_init(&aift.gait_lock); > > > + mutex_init(&aift.lock); > > > +} > > > > Can we maybe use designated initializer for the static definition of > > aift, e.g. something > > like > > static struct zpci_aift aift = { > > .gait_lock = __SPIN_LOCK_UNLOCKED(aift.gait_lock), > > .lock = __MUTEX_INITIALIZER(aift.lock), > > } > > and get rid of the init function? > > > Maybe -- I can certainly do the above, but I do add a call to > zpci_get_mdd() in the init function (patch 23), so if I want to in patch > 23 instead add .mdd = zpci_get_mdd() to this designated initializer I'd > have to re-work zpci_get_mdd (patch 12) to return the mdd rather than > the CLP LIST PCI return code. We want at least a warning if we're > setting a 0 for mdd because the CLP failed for some bizarre reason. > > I guess one option would be to move the WARN_ON into the zpci_get_mdd() > function itself and then now we can do Hmm, if we do change zpci_get_mdd() which I'm generally fine with I feel like the initializer would be weird mix of truly static lock initialization and a function that actually does a CLP. I'm also a little worried about initialization order if kvm is built- in. The CLP should work even with PCI not initialized but what if for example the facility isn't even there? Also if you do change zpci_get-mdd() I'd prefer a pr_err() instead of a WARN_ON(), no reason to crash the system for this if it runs with panic-on-warn. So I think overall keeping it as is makes more sense.