mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"yishaih@nvidia.com" <yishaih@nvidia.com>,
	"shameerali.kolothum.thodi@huawei.com" 
	<shameerali.kolothum.thodi@huawei.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Jiang, Dave" <dave.jiang@intel.com>,
	"Liu, Jing2" <jing2.liu@intel.com>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	"tom.zanussi@linux.intel.com" <tom.zanussi@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"patches@lists.linux.dev" <patches@lists.linux.dev>
Subject: Re: [RFC PATCH V2 14/18] vfio/pci: Add core IMS support
Date: Mon, 16 Oct 2023 10:48:57 -0700	[thread overview]
Message-ID: <4cc6e8ce-7e51-46c9-8587-0d37f0f39dfa@intel.com> (raw)
In-Reply-To: <BN9PR11MB5276891129DCF849D9E6375D8CD2A@BN9PR11MB5276.namprd11.prod.outlook.com>

Hi Kevin,

On 10/13/2023 1:10 AM, Tian, Kevin wrote:
>> From: Chatre, Reinette <reinette.chatre@intel.com>
>> Sent: Saturday, October 7, 2023 12:41 AM
>>
>> A virtual device driver starts by initializing the backend
>> using new vfio_pci_ims_init_intr_ctx(), cleanup using new
>> vfio_pci_ims_release_intr_ctx(). Once initialized the virtual
>> device driver can call vfio_pci_set_irqs_ioctl() to handle the
>> VFIO_DEVICE_SET_IRQS ioctl() after it has validated the parameters
>> to be appropriate for the particular device.
> 
> I wonder whether the code sharing can go deeper from
> vfio_pci_set_irqs_ioctl() all the way down to set_vector_signal()
> with proper abstraction. 

There is a foundational difference in the MSI and IMS interrupt
management that is handled by the separate set_vector_signal()
implementations.

For MSI interrupts the interrupts stay allocated but the individual
interrupt context is always freed and re-allocated.

For IMS the interrupts are always freed and re-allocated (to ensure that
any new cookie is taken into account) while the individual interrupt
context stays allocated (to not lose the cookie value associated
with the individual interrupt).

It may indeed be possible to accommodate this difference with further
abstraction. I will study the code more to explore how this
can be done.

> Then handle emulated interrupt in the
> common code instead of ims specific path. intel gvt also uses
> emulated interrupt, which could be converted to use this library
> too.

Thank you for pointing me to intel gvt. 

> There is some subtle difference between pci/ims backends
> regarding to how set_vector_signal() is coded in this series. But
> it is not intuitive to me whether such a difference is conceptual
> or simply from a coding preference.
> 
> Would you mind doing an exercise whether that is achievable?

I do not mind at all. Will do.

Thank you very much for taking a look and sharing your guidance.

Reinette 

  reply	other threads:[~2023-10-16 17:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 16:40 [RFC PATCH V2 00/18] vfio/pci: Back guest interrupts from Interrupt Message Store (IMS) Reinette Chatre
2023-10-06 16:40 ` [RFC PATCH V2 01/18] PCI/MSI: Provide stubs for IMS functions Reinette Chatre
2023-10-06 16:40 ` [RFC PATCH V2 02/18] vfio/pci: Move PCI specific check from wrapper to PCI function Reinette Chatre
2023-10-06 16:40 ` [RFC PATCH V2 03/18] vfio/pci: Use unsigned int instead of unsigned Reinette Chatre
2023-10-06 16:40 ` [RFC PATCH V2 04/18] vfio/pci: Make core interrupt callbacks accessible to all virtual devices Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 05/18] vfio/pci: Split PCI interrupt management into front and backend Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 06/18] vfio/pci: Separate MSI and MSI-X handling Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 07/18] vfio/pci: Move interrupt eventfd to interrupt context Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 08/18] vfio/pci: Move mutex acquisition into function Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 09/18] vfio/pci: Move interrupt contexts to generic interrupt struct Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 10/18] vfio/pci: Move IRQ type to generic interrupt context Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 11/18] vfio/pci: Split interrupt context initialization Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 12/18] vfio/pci: Provide interrupt context to generic ops Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 13/18] vfio/pci: Make vfio_pci_set_irqs_ioctl() available Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 14/18] vfio/pci: Add core IMS support Reinette Chatre
2023-10-13  8:10   ` Tian, Kevin
2023-10-16 17:48     ` Reinette Chatre [this message]
2023-10-06 16:41 ` [RFC PATCH V2 15/18] vfio/pci: Support emulated interrupts Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 16/18] vfio/pci: Support emulated interrupts in IMS backend Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 17/18] vfio/pci: Add accessor for IMS index Reinette Chatre
2023-10-06 16:41 ` [RFC PATCH V2 18/18] vfio/pci: Support IMS cookie modification Reinette Chatre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4cc6e8ce-7e51-46c9-8587-0d37f0f39dfa@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=ashok.raj@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=jgg@nvidia.com \
    --cc=jing2.liu@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=tom.zanussi@linux.intel.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®