All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Han, Weidong" <weidong.han@intel.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>,
	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, "Woodhouse,
	David" <david.woodhouse@intel.com>,
	"Barnes, Jesse" <jesse.barnes@intel.com>
Subject: Re: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest
Date: Thu, 09 Oct 2008 10:31:03 +0200	[thread overview]
Message-ID: <48EDC147.4080907@redhat.com> (raw)
In-Reply-To: <0122C7C995D32147B66BF4F440D3016301D555B3@pdsmsx415.ccr.corp.intel.com>

Han, Weidong wrote:
>>
>> There is a missed optimization here.  Suppose we have two devices each
>> under a different iommu.  With the patch, each will be in a different
>> dmar_domain and so will have a different page table.  The amount of
>> memory used is doubled.
>>     
>
> You cannot let two devices each under a different iommu share one
> dmar_domain, becasue dmar_domain has a pointer to iommu.
>
>   

I don't want then to share dmar_domains (these are implementation
details anyway), just io page tables.


kvm ---> something (owns io page table) ---> dmar_domain (uses shared io
page table) ---> device

Even if we don't implement io page table sharing right away,
implementing the 'something' in the iommu api means we can later
impement sharing without changing the iommu/kvm interface.

> In fact, the exported APIs added for KVM VT-d also do
> create/map/attach/detach/free functions. Whereas these iommu APIs are
> more readable. 
>
>   


No; the existing iommu API talks about dmar domains and exposes the
existence of multiple iommus, so it is more complex.

> Because kvm VT-d usage is different with native usage, it's inevitable
> extend native VT-d code to support KVM VT-d (such as wrap dmar_domain).
> For devices under different iommus, they cannot share the same
> dmar_domain, thus they cannot share VT-d page table. If we want to
> handle this by iommu APIs, I suspect we need to change lots of native
> VT-d driver code.
>   

As mentioned above, we can start with implementing the API without
actual sharing (basically, your patch, but as an addition to the API
rather than a change to kvm); we can add io pagetable sharing later.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2008-10-09  8:33 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
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 [this message]
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=48EDC147.4080907@redhat.com \
    --to=avi@redhat.com \
    --cc=allen.m.kay@intel.com \
    --cc=amit.shah@redhat.com \
    --cc=benami@il.ibm.com \
    --cc=david.woodhouse@intel.com \
    --cc=jesse.barnes@intel.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 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.