Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1097381rdb; Wed, 1 Nov 2023 11:09:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXihmune3MS5VC/2RJng6Dh9IVtKtQdR+gAtqhC7WEyfHKWoR3VKkHB0uwdVlwR7tmG7Ie X-Received: by 2002:a17:902:e88f:b0:1cc:5b5a:62a5 with SMTP id w15-20020a170902e88f00b001cc5b5a62a5mr9138526plg.9.1698862155757; Wed, 01 Nov 2023 11:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698862155; cv=none; d=google.com; s=arc-20160816; b=RgfIbS1PgPVtXGmJL3uzycaiWo/dYDnf/Zz2dNdCJb/88sfUlTpUQLYCIdFJHy/m0o ol9nMuopIztnXGH3awh7MqWQMVWtvjZBpEl1r2l36DetWHgF6gB/Kvt0h6unMCKWgS9P B5IMYlHMs0K4knYtEhfU+2Bo2Wztn/osrBeGZ7S3z1iacRUzGNk4+VMZ3yCv+0/I6sWd aOZDNgVrMwk8LCr6oQa5iTMPGVLbpll4zYN+wd1Hp4SUY7KvHvrexr4ddoFvF3ASaQbx S+V66WYsYMWN7IZ8h51zcA+Z3SaAZiOy0HtZwc1gQyfabkhaTy6XgDTTIHSSOWeC0CPe osvg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=cNirxrwnGNxPhSeDEuyk3fyxTyLRlM+krbj6sC5I3yE=; fh=I11Q/LjzHnfSNW4ZHPmGtAeH6HTAmuvsyeJ01TdUCBM=; b=v9hV/hAaNZ6w4xGdD97pkysXiGvT8ZpfVFCqtQG6QZ/BfBj61vu0+phXpqOBfsIlob rmeyzkpHOQ24ICkb+d6i9e/B4aCme7L0NxCZsq9umguYYtTNaL0DwxABXuoQE5M27Jxj BrV7o7OQKuE9iJJVF/pSpTwcoGsXQEZ5XKp/E9xxSjVfmGCrV4Gz69LXo3FG/Zrmw0RM gq6zYVZLtd5kbQoaQOPbhMiguBShqVPSYghFMgUuANe/zhD7hV3SeYfDLUE3PyF3ff3i FaiMIdue6rmZYbTNLwdifsjaIcUPDfslE6oDL6MPy7nPGf49uDOxs353cnWgBidCEcHm tEiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gq7pRJQr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q9-20020a17090311c900b001b89551a392si3631003plh.113.2023.11.01.11.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 11:09:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gq7pRJQr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 10B83803D037; Wed, 1 Nov 2023 11:08:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344998AbjKASIM (ORCPT + 99 others); Wed, 1 Nov 2023 14:08:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344969AbjKASIL (ORCPT ); Wed, 1 Nov 2023 14:08:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3552D111 for ; Wed, 1 Nov 2023 11:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698862039; 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=cNirxrwnGNxPhSeDEuyk3fyxTyLRlM+krbj6sC5I3yE=; b=gq7pRJQrflrgl7/lHRLzQWlqmI+uzRM6aVtvFRixwBbnob8i3yAzCYrQIo/fKXKyVS2wD9 12CCzDbOwd30J6SisCybnzd0EvPEpql2yGKlcqbR6hlsPkfljsr5TK88HHRBpLBB4wQu64 YFbR7SxAFGusq2mqZVXeHqd5BWJAAqA= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-540-LxoX-KBpPWaUinYfoUDkXw-1; Wed, 01 Nov 2023 14:07:18 -0400 X-MC-Unique: LxoX-KBpPWaUinYfoUDkXw-1 Received: by mail-il1-f199.google.com with SMTP id e9e14a558f8ab-35904504891so609335ab.1 for ; Wed, 01 Nov 2023 11:07:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698862037; x=1699466837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cNirxrwnGNxPhSeDEuyk3fyxTyLRlM+krbj6sC5I3yE=; b=IQHKXvj6m3lYQwoxnm0xMJv+omLXotnMZ8Au2a8BJiMckjMecp8T6OU5XyMU+o5fR7 VQ4Q9xhm1pvaMI+FUtyOfgAFl4OFJVyKrhUVmGTKv7MleUqnSjhVCs4sX6iJx6vq7e9p HhY3fraibibx7Y+Txcx8z0o6w44ZDvYhwBCy6spI16ga3rn9JVRdna7O4YM2evvilvkR AAxouaHE2tXzBUmKUTQuAOEFZ9EfWizhxdQ3Mj/4TF7wUN/0T1b6P1ygmex11V85xUpA qxKJaQeHNxzp16LObd+5Pv8Q/bKRjfoPyJiNIfKzkvqtKiOflXPTYTz6FeK7V8/SK2aa 1Ndw== X-Gm-Message-State: AOJu0YxbPgHYft+Bn4RAXVj/yYF41l7VCx/zBT76ajzHy4i8laAf6edt 3MKH/O7qSRBZHKLqIEkA7M6R86gE3xz04CUWnMWJaTZfFBDSIxxtO5ZpWSz7kz7w7Ut/CdEBIPP klt5QWHpZahRwV1oBlftC5Sf1 X-Received: by 2002:a05:6e02:310e:b0:359:39af:ffba with SMTP id bg14-20020a056e02310e00b0035939afffbamr6214774ilb.7.1698862037339; Wed, 01 Nov 2023 11:07:17 -0700 (PDT) X-Received: by 2002:a05:6e02:310e:b0:359:39af:ffba with SMTP id bg14-20020a056e02310e00b0035939afffbamr6214753ilb.7.1698862037083; Wed, 01 Nov 2023 11:07:17 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id a18-20020a92c712000000b0034e2572bb50sm649746ilp.13.2023.11.01.11.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 11:07:16 -0700 (PDT) Date: Wed, 1 Nov 2023 12:07:14 -0600 From: Alex Williamson To: "Tian, Kevin" Cc: "Chatre, Reinette" , "jgg@nvidia.com" , "yishaih@nvidia.com" , "shameerali.kolothum.thodi@huawei.com" , "kvm@vger.kernel.org" , "Jiang, Dave" , "Liu, Jing2" , "Raj, Ashok" , "Yu, Fenghua" , "tom.zanussi@linux.intel.com" , "linux-kernel@vger.kernel.org" , "patches@lists.linux.dev" Subject: Re: [RFC PATCH V3 00/26] vfio/pci: Back guest interrupts from Interrupt Message Store (IMS) Message-ID: <20231101120714.7763ed35.alex.williamson@redhat.com> In-Reply-To: References: X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 groat.vger.email 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 (groat.vger.email [0.0.0.0]); Wed, 01 Nov 2023 11:08:58 -0700 (PDT) On Tue, 31 Oct 2023 07:31:24 +0000 "Tian, Kevin" wrote: > > From: Chatre, Reinette > > Sent: Saturday, October 28, 2023 1:01 AM > > > > Changes since RFC V2: > > - RFC V2: > > https://lore.kernel.org/lkml/cover.1696609476.git.reinette.chatre@intel.com > > / > > - Still submiting this as RFC series. I believe that this now matches the > > expectatations raised during earlier reviews. If you agree this is > > the right direction then I can drop the RFC prefix on next submission. > > If you do not agree then please do let me know where I missed > > expectations. > > Overall this matches my expectation. Let's wait for Alex/Jason's thoughts > before moving to next-level refinement. It feels like there's a lot of gratuitous change without any clear purpose. We create an ops structure so that a variant/mdev driver can make use of the vfio-pci-core set_irqs ioctl piecemeal, but then the two entry points that are actually implemented by the ims version are the same as the core version, so the ops appear to be at the wrong level. The use of the priv pointer for the core callbacks looks like it's just trying to justify the existence of the opaque pointer, it should really just be using container_of(). We drill down into various support functions for MSI (ie. enable, disable, request_interrupt, free_interrupt, device name), but INTx is largely ignored, where we haven't even kept is_intx() consistent with the other helpers. Without an in-tree user of this code, we're just chopping up code for no real purpose. There's no reason that a variant driver requiring IMS couldn't initially implement their own SET_IRQS ioctl. Doing that might lead to a more organic solution where we create interfaces where they're actually needed. The existing mdev sample drivers should also be considered in any schemes to refactor the core code into a generic SET_IRQS helper for devices exposing a vfio-pci API. Thanks, Alex