From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82078C4332F for ; Wed, 1 Nov 2023 18:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345016AbjKASIN (ORCPT ); Wed, 1 Nov 2023 14:08:13 -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-Google-Smtp-Source: AGHT+IGDtPEU6mYCp0PSMGNZDkTtE/bY4ZfUUnVuiRWcA3PR8aPIt2pxI5neewOpstUTBhrwmao2ig== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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