Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3505951ioo; Wed, 25 May 2022 02:03:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTkGQzxqd/6NPHWokLFwN0mVoKOZRAUACFlf8FRAZhG7AjN5Lbw3EsRuSij7oqD2nafUIS X-Received: by 2002:a17:906:8a53:b0:6fe:83b0:7328 with SMTP id gx19-20020a1709068a5300b006fe83b07328mr28433190ejc.387.1653469423526; Wed, 25 May 2022 02:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653469423; cv=none; d=google.com; s=arc-20160816; b=p02p7Mmh+oR78SFvFdSNozka9x7pbQuU/lGkltif/HTt3oDJQQi4Ajk8GCRfAmDPvI Fnt0AeB/iiqwT6k2c6NkmTxS6M6rmxY0cPbWJvwf0iGaq7wpwCys4uoJsslPYs4eoGfW X51IpqHFY41plR6wYQNvt9+NUyJyFzJJI8ozM34K+iOWD6we8g2iPHuY2IPhTRW9QMFo En2wH4VrPE26nXqSARYgmrEX4JP4bW/oRrUoGWiZetBMMMI3U3hGkHwOQqfUzzZzbUKc ow2QKzO8KZ8XB1TbY2MfkJHQTMd07GtfuWN01fwhN3Aj8QE8625aphqvnKQGg4dFKgmb Akfg== 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=BCd+QNLniNzlF6W7H/ca6kckSQBoa9VguXTAzz3osLE=; b=XG7SIJ04Pwgz1RCX1uBywRwmCTza9+fDSuELoX1gWMqNaIM6euV2eXtWs9kh3K/9s+ 4fcuAN7soCkPSdbKIL5jcJmekMcyYI0Jyonws3Fr6dF47ZKPz0frm6N0aHo435+8MhOv 2UJ+729iS77TDsth8OAztpzrW7BIie0DrgN+cjynDWG3VS5KtOlQKXAD7FeUSt6OVRRC rWvSNIl7csKFwbjTlGqwVpvdjcBsZEC+oAEUPS75Pw8O55Zu2sgpkkTvYkrE7DVZ48W3 wRroh69jz55WE7lTNsxbcQMAQtxil33iceUO5F8z4hLGRS1XSE7yn9TCZ/hsbgKOU/MW Q8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z7vLg+zV; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd7-20020a1709076e0700b006fea3ba34b3si16324454ejc.661.2022.05.25.02.03.17; Wed, 25 May 2022 02:03:43 -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=@redhat.com header.s=mimecast20190719 header.b=Z7vLg+zV; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242484AbiEXWvB (ORCPT + 99 others); Tue, 24 May 2022 18:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242479AbiEXWuw (ORCPT ); Tue, 24 May 2022 18:50:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE36566FAF for ; Tue, 24 May 2022 15:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653432650; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCd+QNLniNzlF6W7H/ca6kckSQBoa9VguXTAzz3osLE=; b=Z7vLg+zV1JtJ9V3YcMKs/fnuwR4PZNKdNO35HkE7SkNZFG46Rf8uc2rEzNFRa3eO5k19Jb 6bvWpZGRklaNrgfy4Wq4XZftH1qcPduQnXbNP2Z6ISPlD6SoS6wt0jNHQj+h7YxYmiSF8T TmkomxbAgetFQpUSqy3Adyjv3jjH4jA= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-631-rlKdk0ojNay3HpZYUsL7bA-1; Tue, 24 May 2022 18:50:49 -0400 X-MC-Unique: rlKdk0ojNay3HpZYUsL7bA-1 Received: by mail-il1-f198.google.com with SMTP id b13-20020a92c56d000000b002d125a2ab95so11615817ilj.13 for ; Tue, 24 May 2022 15:50:49 -0700 (PDT) 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=BCd+QNLniNzlF6W7H/ca6kckSQBoa9VguXTAzz3osLE=; b=0Rp6pdl+A15xZ9/wPJQmH6Phr+Na/rRWeaObjLKp4CygSABqtoDoOMTWm0s7jaM/TW 0a/t1aeVLVRAlSHDNC4fgNZe1FAFib+t85wpc5Skjxw+oTcYf/SjjrYazkgDPg1+3P6q ES3s77ao2mc54FH6duc98G5oCTUZFi6qkh+sXiDFNPvZwT2Mlf75afo/bwuOMoWIoqAw 9WqJlSoBI/mlggiAuZFEZX+cT7EDoK27KGoBoI/FiDfmrwnkDa0FeLh9/BpBaHwJl+HE pIhXexPvnxd2btDUsa66bXlzq5I6REHCEFyi2ZOzgGht308UEZo9egwNMCUGYgk2lior QsAw== X-Gm-Message-State: AOAM531jqgc6hb2L6etncXGbdwrO0V2J1AtNKPIR51AiUzukWE2orVXy PSzci6ykzMGmXh806V32qzZFnU1ARs3s/zfNbL8jbuLkdCb05v+CvTGWYs00uaHtsI4MQvVIiPV kDKiPjBoxMomra1noOmdpp9qy X-Received: by 2002:a02:bb19:0:b0:32e:8618:9f92 with SMTP id y25-20020a02bb19000000b0032e86189f92mr14374595jan.320.1653432648749; Tue, 24 May 2022 15:50:48 -0700 (PDT) X-Received: by 2002:a02:bb19:0:b0:32e:8618:9f92 with SMTP id y25-20020a02bb19000000b0032e86189f92mr14374574jan.320.1653432648498; Tue, 24 May 2022 15:50:48 -0700 (PDT) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id q46-20020a027b2e000000b0032e43cb7344sm3731662jac.146.2022.05.24.15.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 15:50:48 -0700 (PDT) Date: Tue, 24 May 2022 16:50:46 -0600 From: Alex Williamson To: Matthew Rosato Cc: linux-s390@vger.kernel.org, cohuck@redhat.com, schnelle@linux.ibm.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, jgg@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v8 11/22] KVM: s390: pci: add basic kvm_zdev structure Message-ID: <20220524165046.69f0d84a.alex.williamson@redhat.com> In-Reply-To: <20220524185907.140285-12-mjrosato@linux.ibm.com> References: <20220524185907.140285-1-mjrosato@linux.ibm.com> <20220524185907.140285-12-mjrosato@linux.ibm.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 24 May 2022 14:58:56 -0400 Matthew Rosato wrote: > diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c > new file mode 100644 > index 000000000000..21c2be5c2713 > --- /dev/null > +++ b/arch/s390/kvm/pci.c > @@ -0,0 +1,36 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * s390 kvm PCI passthrough support > + * > + * Copyright IBM Corp. 2022 > + * > + * Author(s): Matthew Rosato > + */ > + > +#include > +#include > +#include "pci.h" > + > +static int kvm_s390_pci_dev_open(struct zpci_dev *zdev) > +{ > + struct kvm_zdev *kzdev; > + > + kzdev = kzalloc(sizeof(struct kvm_zdev), GFP_KERNEL); > + if (!kzdev) > + return -ENOMEM; > + > + kzdev->zdev = zdev; > + zdev->kzdev = kzdev; > + > + return 0; > +} > + > +static void kvm_s390_pci_dev_release(struct zpci_dev *zdev) > +{ > + struct kvm_zdev *kzdev; > + > + kzdev = zdev->kzdev; > + WARN_ON(kzdev->zdev != zdev); > + zdev->kzdev = 0; I imagine this should be s/0/NULL/, right? I feel like there was a recent similar discussion, but I can't think of any unique search terms to sort it out of my inbox. Thanks, Alex