All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, imammedo@redhat.com, rth@twiddle.net,
	ehabkost@redhat.com, jasowang@redhat.com, marcel@redhat.com,
	pbonzini@redhat.com, rkrcmar@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 00/13] IOMMU: Enable interrupt remapping for Intel IOMMU
Date: Thu, 14 Apr 2016 13:25:02 +0800	[thread overview]
Message-ID: <20160414052502.GC25961@pxdev.xzpeter.org> (raw)
In-Reply-To: <570E5A39.2010603@web.de>

On Wed, Apr 13, 2016 at 07:39:53AM -0700, Jan Kiszka wrote:
> On 2016-04-13 00:27, Peter Xu wrote:
> > On Mon, Apr 11, 2016 at 03:32:18PM +0300, Michael S. Tsirkin wrote:
> >> On Mon, Apr 11, 2016 at 05:19:10PM +0800, Peter Xu wrote:
> >>> v2 changes:
> >>> - patch 1
> >>>   - rename "int_remap" to "intr" in several places [Marcel]
> >>>   - remove "Intel" specific words in desc or commit message, prepare
> >>>     itself with further AMD support [Marcel]
> >>>   - avoid using object_property_get_bool() [Marcel]
> >>> - patch 5
> >>>   - use PCI bus number 0xff rather than 0xf0 for the IOAPIC scope
> >>>     definition. (please let me know if anyone knows how I can avoid
> >>> 	user using PCI bus number 0xff... TIA)
> >>> - patch 11
> >>>   - fix comments [Marcel]
> >>> - all
> >>>   - remove intr_supported variable [Marcel]
> >>>
> >>> This patchset provide very basic functionalities for interrupt
> >>> remapping (IR) support of the emulated Intel IOMMU device.
> >>>
> >>> By default, IR is disabled to be better compatible with current
> >>> QEMU. To enable IR, we can using the following command to boot a
> >>> IR-supported VM with basic network (still do not support kvm-ioapic,
> >>> so we need to specify kernel-irqchip=off here):
> >>>
> >>> $ qemu-system-x86_64 -M q35,iommu=on,intr=on,kernel-irqchip=off \
> >>>      -enable-kvm -m 1024 -s \
> >>>      -monitor telnet::3333,server,nowait \
> >>>      -netdev user,id=user.0,hostfwd=tcp::5555-:22 \
> >>>      -device virtio-net-pci,netdev=user.0 \
> >>> 	 /var/lib/libvirt/images/vm1.qcow2
> >>>
> >>> When guest boots, we can verify whether IR enabled by grepping the
> >>> dmesg like:
> >>>
> >>> [root@localhost ~]# journalctl -k | grep "DMAR-IR"
> >>> Feb 19 11:21:23 localhost.localdomain kernel: DMAR-IR: IOAPIC id 0 under DRHD base  0xfed90000 IOMMU 0
> >>> Feb 19 11:21:23 localhost.localdomain kernel: DMAR-IR: Enabled IRQ remapping in xapic mode
> >>>
> >>> Currently only two devices are supported:
> >>>
> >>> - Emulated IOAPIC device
> >>> - PCI Devices
> >>>
> >>> TODO List:
> >>>
> >>> - kvm-ioapic support
> >>
> >> This is probably a must. I don't think we can merge this
> >> as long as it breaks kvm.
> > 
> > But kvm-ioapic might require modification to KVM as well. Do you
> > think I should add kvm-ioapic into this series as well? Or can I
> > first submit this part of work without kvm-ioapic (since this work
> > is not related to KVM at all), then work on another one to support
> > kvm-ioapic?
> 
> Just go for split irqchip. If we ever need support for in-kernel irqchip
> is questionable.

Okay. I can add one more patch to support split irqchip I suppose,
that should be much easier. The idea would be: to translate
interrupts before updating KVM routes in IOAPIC. Also, I may need to
take care of IR cache invalidation this time, since if I do the
above, remapping will be cached in kernel gsi routes.

I suppose irqfd will solve itself too after we support splitted
irqchip, since irqfd should be using the gsi routes. Will do more
test to confirm this.

Thanks.

-- peterx

  reply	other threads:[~2016-04-14  5:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  9:19 [Qemu-devel] [PATCH v2 00/13] IOMMU: Enable interrupt remapping for Intel IOMMU Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 01/13] q35: add "int-remap" flag to enable intr Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 02/13] acpi: enable INTR for DMAR report structure Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 03/13] intel_iommu: allow queued invalidation for IR Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 04/13] intel_iommu: set IR bit for ECAP register Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 05/13] acpi: add DMAR scope definition for root IOAPIC Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 06/13] intel_iommu: define interrupt remap table addr register Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 07/13] intel_iommu: handle interrupt remap enable Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 08/13] intel_iommu: define several structs for IOMMU IR Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 09/13] intel_iommu: provide helper function vtd_get_iommu Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 10/13] ioapic-common: add iommu for IOAPICCommonState Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 11/13] intel_iommu: add IR translation faults defines Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC Peter Xu
2016-04-12  5:22   ` Jan Kiszka
2016-04-12  9:02     ` Peter Xu
2016-04-12 15:39       ` Jan Kiszka
2016-04-13  3:33         ` Peter Xu
2016-04-13  3:39           ` Jan Kiszka
2016-04-13  5:09             ` Peter Xu
2016-04-13 10:06             ` Peter Xu
2016-04-13 14:44               ` Jan Kiszka
2016-04-14  2:46                 ` Peter Xu
2016-04-14  5:42                   ` Jan Kiszka
2016-04-14  8:28                     ` Peter Xu
2016-04-11  9:19 ` [Qemu-devel] [PATCH v2 13/13] intel_iommu: Add support for PCI MSI remap Peter Xu
2016-04-11 12:41   ` Michael S. Tsirkin
2016-04-13  7:23     ` Peter Xu
2016-04-11 12:32 ` [Qemu-devel] [PATCH v2 00/13] IOMMU: Enable interrupt remapping for Intel IOMMU Michael S. Tsirkin
2016-04-13  7:27   ` Peter Xu
2016-04-13 14:39     ` Jan Kiszka
2016-04-14  5:25       ` Peter Xu [this message]
2016-04-11 22:19 ` Alex Williamson
2016-04-13  7:37   ` Peter Xu

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=20160414052502.GC25961@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=jasowang@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkrcmar@redhat.com \
    --cc=rth@twiddle.net \
    /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.