From: Yang Zhang <yang.zhang.wz@gmail.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, Nadav Amit <nadav.amit@gmail.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
"Lan, Tianyu" <tianyu.lan@intel.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
kvm@vger.kernel.org, "Thomas Gleixner" <tglx@linutronix.de>,
mst@redhat.com, x86@kernel.org, "Peter Xu" <peterx@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: Re: Enable more than 255 VCPU support without irq remapping function in the guest
Date: Wed, 4 May 2016 09:46:21 +0800 [thread overview]
Message-ID: <5729546D.8010006@gmail.com> (raw)
In-Reply-To: <57282F41.8030802@siemens.com>
On 2016/5/3 12:55, Jan Kiszka wrote:
> On 2016-05-03 04:03, Nadav Amit wrote:
>> Yang Zhang <yang.zhang.wz@gmail.com> wrote:
>>
>>> I think it is not only interrupt. There must have the DMAR emulation and
>>> the cost for DMA is heavy in VM(DMA operations are very frequently). I
>>> cannot remember whether there are strong dependency in hardware between
>>> DMAR and IR(I know IR is relying on QI). Even hardware dependency is ok,
>>> is it ok for OS running in hardware with IR but without DMAR?
>>
>> Do you know a way for the IOMMU to report that DMAR is disabled, while IR
>> is enabled?
>
> The hardware cannot decide about disabling this, but the guest can, of
> course. In fact, you can even configure Linux to have DMAR off by
> default until you pass "intel_iommu=on" on the command line (I think
> distros still do this - at least they used to). No idea about other
> OSes, though.
If we can disable DMAR in guest, it should be enough.
>
>>
>> Anyhow, the VM can use IOMMU passthrough mode to avoid most IOMMU overhead.
>> Regardless, a recent patch-set should improve DMAR performance
>> considerably [1].
>
> The bottleneck with emulated DMAR is rather in QEMU. But DMAR can be
> almost as cheap as IR once we get it running for VFIO and vhost: both
> need proper caching because they do not work with QEMU in the loop for
> each and every DMA transfer. Still no need to deviate from physical
> hardware.
Sorry, i don't know detail about how VFIO and vhost work with IR. But it
seems hard to do proper caching since DMA allocations are very
frequently in Linux unless we move the whole iommu emulation to kernel.
Another idea is using two iommus: one for Qemu and one for device in
kernel like vfio and vhost. I did the similar thing in Xen in several
years ago which uses two iommus solution and it works well in my
experiment environment. Besides, this solution is easy for nested device
pass-through. The Page 32 of [1] has more detail.
[1] http://docplayer.net/10559370-Nested-virtualization.html
--
best regards
yang
next prev parent reply other threads:[~2016-05-04 1:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 16:14 Enable more than 255 VCPU support without irq remapping function in the guest Lan, Tianyu
2016-04-26 16:17 ` Jan Kiszka
2016-04-26 16:49 ` Radim Krčmář
2016-04-27 4:10 ` Yang Zhang
2016-04-27 5:24 ` Jan Kiszka
2016-04-27 6:24 ` Lan Tianyu
2016-04-27 6:56 ` Jan Kiszka
2016-04-27 9:39 ` Yang Zhang
2016-04-27 9:45 ` Jan Kiszka
2016-04-28 1:11 ` Yang Zhang
2016-04-28 6:54 ` Jan Kiszka
2016-04-28 15:32 ` Radim Krčmář
2016-04-29 2:09 ` Yang Zhang
2016-04-29 3:01 ` Nadav Amit
2016-05-03 1:34 ` Yang Zhang
2016-04-29 4:59 ` Jan Kiszka
2016-05-03 1:52 ` Yang Zhang
2016-05-03 2:03 ` Nadav Amit
2016-05-03 4:55 ` Jan Kiszka
2016-05-04 1:46 ` Yang Zhang [this message]
2016-05-04 1:56 ` Nadav Amit
2016-05-04 5:38 ` Jan Kiszka
2016-04-27 5:39 ` Lan Tianyu
2016-04-27 14:38 ` Radim Krčmář
2016-04-27 5:15 ` Lan Tianyu
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=5729546D.8010006@gmail.com \
--to=yang.zhang.wz@gmail.com \
--cc=imammedo@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=tianyu.lan@intel.com \
--cc=x86@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 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.