From: Auger Eric <eric.auger@redhat.com>
To: Li Qiang <liq3ea@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>,
alex.williamson@redhat.com,
Qemu Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Question about the vfio device interrupt
Date: Wed, 15 May 2019 12:16:02 +0200 [thread overview]
Message-ID: <c707e882-e194-355a-d96c-bfb00a8db247@redhat.com> (raw)
In-Reply-To: <CAKXe6SKBgMcq+p7EB1kRWLSbg9NvZg1Mr24UrX8S+kpzq-GR4Q@mail.gmail.com>
Hi,
On 5/15/19 12:01 PM, Li Qiang wrote:
> Hello Paolo, Alex and all,
>
> In vfio_intx_enable_kvm(qemu) I see we associate a resamplefd with the
> umask function(vfio_pci_intx_unmask_handler in linux).
>
> irq_set = g_malloc0(argsz);
> irq_set->argsz = argsz;
> irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_UNMASK;
> irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
> irq_set->start = 0;
> irq_set->count = 1;
> pfd = (int32_t *)&irq_set->data;
>
> *pfd = irqfd.resamplefd;
>
> ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_SET_IRQS, irq_set);
>
> I know this resamplefd is triggered when the interrupt controller receives
> an EOI and
> then we unmask and re-enabled the VFIO devices' interrupt.
>
> So I think there there must be a mask process(so we unmask it later), I
> mean there must a
> call of function vfio_pci_set_intx_mask(in linux).
>
> What I can't understand is when this process(mask VFIO devices' interrupt)
> occurs?
It is done in the VFIO interrupt handler:
vfio_intx_handler/disable_irq_nosync for VFIO PCI (vfio_pci_intrs.c) or
vfio_automasked_irq_handler (vfio_platform_irq.c) for VFIO PLATFORM .
Thanks
Eric
> I only find a place(vfio_basic_config_write) calls vfio_pci_intx_mask> I think when the guest process the interrupt it may mask this
> interrupt(finally call vfio_pci_set_intx_mask), but I can't find the code
> path related with vfio_basic_config_write.
>
>
> Any hints?
>
> Thanks,
> Li Qiang
>
next prev parent reply other threads:[~2019-05-15 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 10:01 [Qemu-devel] Question about the vfio device interrupt Li Qiang
2019-05-15 10:16 ` Auger Eric [this message]
2019-05-15 10:22 ` Li Qiang
2019-05-15 13:46 ` Alex Williamson
2019-05-15 14:27 ` Maxim Levitsky
2019-05-15 14:53 ` Alex Williamson
2019-05-15 15:01 ` Li Qiang
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=c707e882-e194-355a-d96c-bfb00a8db247@redhat.com \
--to=eric.auger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=liq3ea@gmail.com \
--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.