Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp244947pxr; Sun, 10 Apr 2022 13:32:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdPe8MjDKTdD1KVmDclyGWR1WXjV5KNz0E/GyFBVESTTxjfBJHFLa7uxhqFMzdNyRrBPgb X-Received: by 2002:a17:907:948c:b0:6e7:fe2b:68f0 with SMTP id dm12-20020a170907948c00b006e7fe2b68f0mr27145231ejc.749.1649622777200; Sun, 10 Apr 2022 13:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649622777; cv=none; d=google.com; s=arc-20160816; b=bYf6XIilhSNMsZ+PKzz1hY2ma8NZ6FgwxL0cBTEAOBpKUbnDNGnU9HWqZoSmAYCPRP 8loCCkjdoUwsZCtGO9FKK41Wivp5Cmm1Uy1M6OMDi6R/2hh+yk7rjBfeAFudnoaIEx4K q6GqkXpPi7wPM8LrbFZtjaGFHzVzC7iTin1pvT9m95Yd0+988xLfavHKrmE5tbxMxJXv 5vVoXjjW+fx1V4bGMNZJHFQRWf+Ek8+TntqyyOiSQl9oOPLTg0JoO92mVefTwSrAhYOf zfXbgvUCuJ0BWgiY2j026g2Xo+uZ+xl4JZNJSXfjfuUDcNTRiC/KoUWZWfI0SjQJGtqZ AfhQ== 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=VQDI6YuAr8Eowoco7O858WVzXH3UkvuYAnRhC5A1scM=; b=LM07QEk5/LSgxDD4AZDrXq/KRix3/0ELnCtazw99O575hKNpH4PNoPPcJPnXL5Shr4 HT2ULkgHxWYmGM7Yb+0LJXUHapBXZlyhlFGjDjEU5rQuO2e5khopyLvMx28NtoDfAW9b mZ+Nj6YiK1OSZw5Mc9eYQMjadSOYRrr591muK44StzldN3mJUmJt/TsQOh1r8wd7D3g4 MSNhTErM9sSQdXR6oMuVGQu9C2S2jqHApiWli2QjkiMqnIKYy/ZKYCNyzg/lUtY6Ne3U JZrueK5cNwBHX7gW6jbeapUn7bR2ml5FTxoVrHdP113kkI5R49zSmGl3Nphlnozv9gM8 Vekg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=aWdwJeUD; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a1709063ad300b006e886e43fa2si1827246ejd.664.2022.04.10.13.32.31; Sun, 10 Apr 2022 13:32:57 -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=@ziepe.ca header.s=google header.b=aWdwJeUD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235916AbiDHMuc (ORCPT + 99 others); Fri, 8 Apr 2022 08:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232606AbiDHMua (ORCPT ); Fri, 8 Apr 2022 08:50:30 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49BF395A1D for ; Fri, 8 Apr 2022 05:48:26 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id a38so4657693qkp.5 for ; Fri, 08 Apr 2022 05:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VQDI6YuAr8Eowoco7O858WVzXH3UkvuYAnRhC5A1scM=; b=aWdwJeUD/a4zIRed0XxjGwJ74BNKFq4B7EWPMeUNhdeY5dJDzcb3riXc6hBpMpVD5G GheWkYvfEpgEmKVdPZECt2I2HbY1Sfm0HOaNxsvQfQFPVYs9y1e5x1QE5V3K8F/n2T2R dxMa64HX3TMuHD/uIKXUgWlm5hAY1L9/dt29oPX2IKpwwjh7lZ6exu/d0DeikubO2po1 A6AuK8MDLCkex64rjVBcdClMdJtIU6d8+B+bA0IaFnCox9kDbXi9Y33pd4zKQ76MizSb hDu71MPFRVq0bUGbopVKGwnusYQ5foX2jGOXKyTkRm8CUSsZqFdud7vzMSNPBsNjiFOv HOtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VQDI6YuAr8Eowoco7O858WVzXH3UkvuYAnRhC5A1scM=; b=zvC4hWnRD65Z2jMBbXcYZhHWhToLLDY/dZ064rQAEvRLh/W9rJY2ZlIWkFiteVXil+ RqVSBol/79/SbG4biJbXuJmJ9IlwfQxGs4Q8JtA9F0feXkBQ0+qDQzYyvWC4zaSA12vC CZAuWjXotst7pUcUfXBlhdodfZFPfDGKCc9fGF7rbew7s+5OMAAIlQqzUsApCbaLf4In g7H1lFmhc8/KmN6DO+dg+Wdmds4nKwOlsxX31j44PSFVoFHAO7dPC7/1+vfhtjl8yseC jlu9Mmy/cGOobeA5XJO8IZM/uuJbVivnjrRqp/h4AJJp2k7aVeORIJdkW42Df0R6gKnd /aOw== X-Gm-Message-State: AOAM531dIw5hvbV0TlLOJ584ltWqEjoVxyXx2kQjczVfh4HR0sixyamD 1qMP6K0fWGvN5952fnmMJo8GZA== X-Received: by 2002:a05:620a:bce:b0:662:e587:fbbf with SMTP id s14-20020a05620a0bce00b00662e587fbbfmr12558832qki.757.1649422105456; Fri, 08 Apr 2022 05:48:25 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id v3-20020a05622a014300b002e1dcd4cfa9sm18777436qtw.64.2022.04.08.05.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 05:48:24 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1nco2K-00Eytz-9H; Fri, 08 Apr 2022 09:48:24 -0300 Date: Fri, 8 Apr 2022 09:48:24 -0300 From: Jason Gunthorpe To: Niklas Schnelle Cc: Matthew Rosato , linux-s390@vger.kernel.org, alex.williamson@redhat.com, cohuck@redhat.com, farman@linux.ibm.com, pmorel@linux.ibm.com, borntraeger@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com, frankja@linux.ibm.com, david@redhat.com, imbrenda@linux.ibm.com, vneethv@linux.ibm.com, oberpar@linux.ibm.com, freude@linux.ibm.com, thuth@redhat.com, pasic@linux.ibm.com, pbonzini@redhat.com, corbet@lwn.net, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v5 14/21] KVM: s390: pci: provide routines for enabling/disabling interrupt forwarding Message-ID: <20220408124824.GZ64706@ziepe.ca> References: <20220404174349.58530-1-mjrosato@linux.ibm.com> <20220404174349.58530-15-mjrosato@linux.ibm.com> <9a551f04c3878ecb3a26fed6aff2834fbfe41f18.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a551f04c3878ecb3a26fed6aff2834fbfe41f18.camel@linux.ibm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, Apr 05, 2022 at 03:39:19PM +0200, Niklas Schnelle wrote: > On Mon, 2022-04-04 at 13:43 -0400, Matthew Rosato wrote: > > These routines will be wired into a kvm ioctl in order to respond to > > requests to enable / disable a device for Adapter Event Notifications / > > Adapter Interuption Forwarding. > > > > Signed-off-by: Matthew Rosato > > arch/s390/kvm/pci.c | 247 +++++++++++++++++++++++++++++++++++++++ > > arch/s390/kvm/pci.h | 1 + > > arch/s390/pci/pci_insn.c | 1 + > > 3 files changed, 249 insertions(+) > > > > diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c > > index 01bd8a2f503b..f0fd68569a9d 100644 > > +++ b/arch/s390/kvm/pci.c > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > #include "pci.h" > > > > struct zpci_aift *aift; > > @@ -152,6 +153,252 @@ int kvm_s390_pci_aen_init(u8 nisc) > > return rc; > > } > > > > +/* Modify PCI: Register floating adapter interruption forwarding */ > > +static int kvm_zpci_set_airq(struct zpci_dev *zdev) > > +{ > > + u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_REG_INT); > > + struct zpci_fib fib = {}; > > Hmm this one uses '{}' as initializer while all current callers of > zpci_mod_fc() use '{0}'. As far as I know the empty braces are a GNU > extension so should work for the kernel but for consistency I'd go with > '{0}' or possibly '{.foo = bar, ...}' where that is more readable. > There too uninitialized fields will be set to 0. Unless of course there > is a conflicting KVM convention that I don't know about. {} is not a GNU extension, it is the preferred way to write it. The standard has a weird distinction between {} and {0} that results in different behavior. Jason