From: Avi Kivity <avi@redhat.com>
To: "Han, Weidong" <weidong.han@intel.com>,
Joerg Roedel <joerg.roedel@amd.com>
Cc: kvm@vger.kernel.org, Amit Shah <amit.shah@redhat.com>,
"Kay, Allen M" <allen.m.kay@intel.com>,
"Yang, Sheng" <sheng.yang@intel.com>,
benami@il.ibm.com, muli@il.ibm.com
Subject: Re: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest
Date: Tue, 07 Oct 2008 15:29:21 +0200 [thread overview]
Message-ID: <48EB6431.4070300@redhat.com> (raw)
In-Reply-To: <0122C7C995D32147B66BF4F440D3016301CF9679@pdsmsx415.ccr.corp.intel.com>
Han, Weidong wrote:
> [Rebased the patch due to my mmio's patch (commit: 0d679782) was checked
> in]
>
> From 9e68fc762358cc44cfec3968ac5ec65324ce04d7 Mon Sep 17 00:00:00 2001
> From: Weidong Han <weidong.han@intel.com>
> Date: Mon, 6 Oct 2008 14:02:18 +0800
> Subject: [PATCH] Support multiple device assignment to one guest
>
> Current VT-d patches in kvm only support one device assignment to one
> guest due to dmar_domain is per device.
>
> In order to support multiple device assignemnt, this patch wraps
> dmar_domain with a reference count (kvm_vtd_domain), and also adds a
> pointer in kvm_assigned_dev_kernel to link to a kvm_vtd_domain.
>
> Each dmar_domain owns one VT-d page table, in order to reduce page
> tables and improve IOTLB utility, the devices assigned to the same guest
> and under the same IOMMU share the same kvm_vtd_domain.
>
>
I don't understand this. If we have a one dmar domain per guest, why do
we need reference counting at all?
We can create the dmar domain when we assign the first device, and
destroy it when we deassign the last device, but otherwise I don't see a
need for changes. Particularly I don't understand this:
> @@ -351,7 +351,6 @@ struct kvm_arch{
> */
> struct list_head active_mmu_pages;
> struct list_head assigned_dev_head;
> - struct dmar_domain *intel_iommu_domain;
> struct kvm_pic *vpic;
> struct kvm_ioapic *vioapic;
> struct kvm_pit *vpit;
> @@ -305,6 +310,7 @@ struct kvm_assigned_dev_kernel {
> int irq_requested;
> struct pci_dev *dev;
> struct kvm *kvm;
> + struct kvm_vtd_domain *vtd_domain;
> };
Oh, I see it now. Different devices may need to go under different iommus.
This really feels like it should be handled by the iommu API. Users
shouldn't need to bother with it.
Joerg, can your dma api handle this?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2008-10-07 13:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-06 6:38 [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest Han, Weidong
2008-10-07 10:04 ` Zhang, Xiantao
2008-10-07 13:59 ` Avi Kivity
2008-10-08 1:58 ` Zhang, Xiantao
2008-10-07 13:29 ` Avi Kivity [this message]
2008-10-08 5:40 ` Han, Weidong
2008-10-08 10:32 ` Avi Kivity
2008-10-08 15:06 ` Han, Weidong
2008-10-08 19:49 ` Avi Kivity
2008-10-09 6:11 ` Han, Weidong
2008-10-09 8:31 ` Avi Kivity
2008-10-09 9:25 ` Han, Weidong
2008-10-09 12:50 ` Avi Kivity
2008-10-09 14:31 ` Han, Weidong
[not found] ` <0122C7C995D32147B66BF4F440D3016301CB08EF@pdsmsx415.ccr.corp.intel.com>
2008-10-10 5:50 ` Han, Weidong
2008-10-10 6:40 ` Avi Kivity
2008-10-10 7:22 ` Han, Weidong
2008-10-10 7:32 ` Avi Kivity
2008-10-10 7:50 ` Han, Weidong
2008-10-29 10:25 ` Joerg Roedel
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=48EB6431.4070300@redhat.com \
--to=avi@redhat.com \
--cc=allen.m.kay@intel.com \
--cc=amit.shah@redhat.com \
--cc=benami@il.ibm.com \
--cc=joerg.roedel@amd.com \
--cc=kvm@vger.kernel.org \
--cc=muli@il.ibm.com \
--cc=sheng.yang@intel.com \
--cc=weidong.han@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).