All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Zhong <yang.zhong@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: About the instance_finalize callback in VFIO PCI
Date: Wed, 22 Mar 2023 08:39:27 -0400	[thread overview]
Message-ID: <ZBr2/3sWfMD6qRQO@yangzhon> (raw)
In-Reply-To: <CABgObfb8yFNX=HFiGiM8bUXoDccz+RRkfQE2168ioh3FdMygEQ@mail.gmail.com>

On Tue, Mar 21, 2023 at 09:44:18PM +0100, Paolo Bonzini wrote:
> Il mar 21 mar 2023, 18:30 Cédric Le Goater <clg@kaod.org> ha scritto:
> 
> > I would have thought that user_creatable_cleanup would have taken care
> > of it. But it's not. This needs some digging.
> >
> 
> user_creatable_cleanup is only for -object, not for -device.
>

  Paolo, thanks for helping to clarify this issue.

  Maybe i am clear now, the vfio_instance_finalize() in the
  hw/vfio/pci.c is only for unhotplug vfio pci device from monitor to
  cleanup resource. For static "-device vfio-pci ....." command, the
  cleanup resource is responsibility of kernel exit system, not the qemu
  vfio. Once we close Qemu process, the kernel will call do_exit() to
  release these resource, so the vfio module in kernel will handle
  these cleanup work. thanks!

  Yang


> Paolo
> 
> 
> > C.
> >
> >
> > > By the way, i also debugged other instance_finalize callback functions,
> > > if my understanding is right, all instance_finalize callback should be
> > > called from object_unref(object) from qemu_cleanup(void) in
> > > ./softmmu/runstate.c. But there is no VFIO related object_unref() call in
> > > this cleanup function, So the instance_finalize callback in vfio pci
> > > should be useless? thanks!
> > >
> > > Regards,
> > > Yang
> > >
> > >
> >
> >


  reply	other threads:[~2023-03-22 12:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  9:31 About the instance_finalize callback in VFIO PCI Yang Zhong
2023-03-21 17:30 ` Cédric Le Goater
2023-03-21 20:44   ` Paolo Bonzini
2023-03-22 12:39     ` Yang Zhong [this message]
2023-03-22 12:28   ` Yang Zhong
2023-03-22 12:56     ` Cédric Le Goater
2023-03-22 13:10       ` Yang Zhong
2023-03-22 18:22         ` Alex Williamson
2023-03-23  5:58           ` Yang Zhong

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=ZBr2/3sWfMD6qRQO@yangzhon \
    --to=yang.zhong@linux.intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=clg@kaod.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.