mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Song <xinmengs@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: alex@shazbot.org, jgg@nvidia.com, acourbot@nvidia.com,
	yishaih@nvidia.com, skolothumtho@nvidia.com,
	kevin.tian@intel.com, jhubbard@nvidia.com, ecourtney@nvidia.com,
	cjia@nvidia.com, smitra@nvidia.com, kjaju@nvidia.com,
	alkumar@nvidia.com, ankita@nvidia.com, aniketa@nvidia.com,
	kwankhede@nvidia.com, targupta@nvidia.com,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	zhiwang@kernel.org, zhiw@nvidia.com,
	Alex Williamson <alex.williamson@nvidia.com>
Subject: Re: [PATCH v2 1/1] vfio/pci: Remove the core dependency on driver data
Date: Fri, 2 Oct 2026 16:25:47 -0400	[thread overview]
Message-ID: <42019c49-813d-456c-9c7f-6b729d2e20c2@nvidia.com> (raw)
In-Reply-To: <DLSU375MUCEM.QQ89C9WM16H5@kernel.org>

On 9/30/2026 1:40 PM, Danilo Krummrich wrote:
> On Wed Sep 30, 2026 at 4:36 PM CEST, Simon Song wrote:
>> vfio-pci-core currently has runtime functions that interpret pci
>> driver_data as a pointer to vfio_pci_core_device, and enforce vfio
>> variant drivers must set vfio_pci_core_device to their pci driver_data.
>> This constrains variant drivers' private-data layout, including the
>> typed driver data used by the Rust PCI infrastructure.
>>
>> Added VFIO_PCI_CORE_DEFINE_CALLBACKS marcos to generate wrapper code for
>> each vfio variant driver, update vfio variant drivers to store their
>> private strctures in driver_data and use generated wrapper to pass the
>> vfio core device to helpers.
>>
>> Select the vga decode callback during vfio_pci_vga_init based on if
>> vfio_vga_disabled, the callback only use pci_dev and does not require
>> driver_data
>>
>> Assisted-by: LLM
>> Link: https://lore.kernel.org/all/DLFD2ZDSK9YQ.3A4R66G8UJMD8@kernel.org/
>> Co-developed-by: Alex Williamson <alex.williamson@nvidia.com>
>> Signed-off-by: Alex Williamson <alex.williamson@nvidia.com>
>> Signed-off-by: Simon Song <xinmengs@nvidia.com>
> 
> I like that this moves the PM ops to static initialization. One nit below, but
> either way:
> 
> Reviewed-by: Danilo Krummrich <dakr@kernel.org>
> 
>> @@ -2332,10 +2324,9 @@ void vfio_pci_core_unregister_device(struct vfio_pci_core_device *vdev)
>>  }
>>  EXPORT_SYMBOL_GPL(vfio_pci_core_unregister_device);
>>  
>> -pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev,
>> +pci_ers_result_t vfio_pci_core_aer_err_detected(struct vfio_pci_core_device *vdev,
>>  						pci_channel_state_t state)
> 
> The state argument is unused. Since this is not installed as a direct PCI
> callback anymore it technically doesn't need to retain its signature.

Thanks for the review! Agreed, I'll drop the unused state argument from vfio_pci_core_aer_err_detected() in v3.

Simon

  reply	other threads:[~2026-10-02 20:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 14:36 [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song
2026-09-30 14:36 ` [PATCH v2 1/1] vfio/pci: Remove the core dependency on driver data Simon Song
2026-09-30 17:40   ` Danilo Krummrich
2026-10-02 20:25     ` Simon Song [this message]
2026-09-30 15:32 ` [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song

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=42019c49-813d-456c-9c7f-6b729d2e20c2@nvidia.com \
    --to=xinmengs@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=alex.williamson@nvidia.com \
    --cc=alex@shazbot.org \
    --cc=alkumar@nvidia.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=ecourtney@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=kjaju@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skolothumtho@nvidia.com \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=yishaih@nvidia.com \
    --cc=zhiw@nvidia.com \
    --cc=zhiwang@kernel.org \
    /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®