xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Lan, Tianyu" <tianyu.lan@intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Cc: "yang.zhang.wz@gmail.com" <yang.zhang.wz@gmail.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Dong, Eddie" <eddie.dong@intel.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	"anthony.perard@citrix.com" <anthony.perard@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: Discussion about virtual iommu support for Xen guest
Date: Tue, 5 Jul 2016 21:37:29 +0800	[thread overview]
Message-ID: <13fa96c1-4e66-e8a0-3b66-1c93ad2b6543@intel.com> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D15F8DE707@SHSMSX101.ccr.corp.intel.com>

Hi Stefano, Andrew and Jan:
Could you give us more guides here to move forward virtual iommu 
development? Thanks.

On 6/29/2016 11:04 AM, Tian, Kevin wrote:
>> From: Lan, Tianyu
>> Sent: Sunday, June 26, 2016 9:43 PM
>>
>> On 6/8/2016 4:11 PM, Tian, Kevin wrote:
>>> It makes sense... I thought you used this security issue against
>>> placing vIOMMU in Qemu, which made me a bit confused earlier. :-)
>>>
>>> We are still thinking feasibility of some staging plan, e.g. first
>>> implementing some vIOMMU features w/o dependency on root-complex in
>>> Xen (HVM only) and then later enabling full vIOMMU feature w/
>>> root-complex in Xen (covering HVMLite). If we can reuse most code
>>> between two stages while shorten time-to-market by half (e.g. from
>>> 2yr to 1yr), it's still worthy of pursuing. will report back soon
>>> once the idea is consolidated...
>>>
>>> Thanks Kevin
>>
>>
>> After discussion with Kevin, we draft a staging plan of implementing
>> vIOMMU in Xen based on Qemu host bridge. Both virtual devices and
>> passthough devices use one vIOMMU in Xen. Your comments are very
>> appreciated.
>
> The rationale here is to separate BIOS structures from actual vIOMMU
> emulation. vIOMMU will be always emulated in Xen hypervisor, regardless of
> where Q35 emulation is done or whether it's HVM or HVMLite. The staging
> plan is more for the BIOS structure reporting which is Q35 specific. For now
> we first target Qemu Q35 emulation, with a set of vIOMMU ops introduced
> as Tianyu listed below to help interact between Qemu and Xen. Later when
> Xen Q35 emulation is ready, the reporting can be done in Xen.
>
> The main limitation of this model is on DMA emulation of Qemu virtual
> devices, which needs to query Xen vIOMMU for every virtual DMA. It is
> possibly fine for virtual devices which are normally not for performance
> critical usages. Also there may be some chance to cache some translations
> within Qemu like thru ATS (may not worthy of it though...).
>
>>
>> 1. Enable Q35 support in the hvmloader.
>> In the real world, VTD support starts from Q35 and OS may have such
>> assumption that VTD only exists on the Q35 or newer platform.
>> Q35 support seems necessary for vIOMMU support.
>>
>> In regardless of Q35 host bridge in the Qemu or Xen hypervisor,
>> hvmloader needs to be compatible with Q35 and build Q35 ACPI tables.
>>
>> Qemu already has Q35 emulation and so the hvmloader job can start with
>> Qemu. When host bridge in Xen is ready, these changes also can be reused.
>>
>> 2. Implement vIOMMU in Xen based on Qemu host bridge.
>> Add a new device type "Xen iommu" in the Qemu as a wrapper of vIOMMU
>> hypercalls to communicate with Xen vIOMMU.
>>
>> It's in charge of:
>> 1) Query vIOMMU capability(E,G interrupt remapping, DMA translation, SVM
>> and so on)
>> 2) Create vIOMMU with predefined base address of IOMMU unit regs
>> 3) Notify hvmloader to populate related content in the ACPI DMAR
>> table.(Add vIOMMU info to struct hvm_info_table)
>> 4) Deal with DMA translation request of virtual devices and return
>> back translated address.
>> 5) Attach/detach hotplug device from vIOMMU
>>
>>
>> New hypercalls for vIOMMU that are also necessary when host bridge in Xen.
>> 1) Query vIOMMU capability
>> 2) Create vIOMMU(IOMMU unit reg base as params)
>> 3) Virtual device's DMA translation
>> 4) Attach/detach hotplug device from VIOMMU
>
> We don't need 4). Hotplug device is automatically handled by the vIOMMU
> with INCLUDE_ALL flag set (which should be the case if we only have one
> vIOMMU in Xen). We don't need further notify this event to Xen vIOMMU.
>
> And once we have Xen Q35 emulation in place, possibly only 3) is required
> then.
>
>>
>>
>> All IOMMU emulations will be done in Xen
>> 1) DMA translation
>> 2) Interrupt remapping
>> 3) Shared Virtual Memory (SVM)
>
> Please let us know your thoughts. If no one has explicit objection based
> on above rough idea, we'll go to write the high level design doc for more
> detail discussion.
>
> Thanks
> Kevin
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-07-05 13:37 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26  8:29 Discussion about virtual iommu support for Xen guest Lan Tianyu
2016-05-26  8:42 ` Dong, Eddie
2016-05-27  2:26   ` Lan Tianyu
2016-05-27  8:11     ` Tian, Kevin
2016-05-26 11:35 ` Andrew Cooper
2016-05-27  8:19   ` Lan Tianyu
2016-06-02 15:03     ` Lan, Tianyu
2016-06-02 18:58       ` Andrew Cooper
2016-06-03 11:01         ` Current PVH/HVMlite work and planning (was :Re: Discussion about virtual iommu support for Xen guest) Roger Pau Monne
2016-06-03 11:21           ` Tian, Kevin
2016-06-03 11:52             ` Roger Pau Monne
2016-06-03 12:11               ` Tian, Kevin
2016-06-03 16:56                 ` Stefano Stabellini
2016-06-07  5:48                   ` Tian, Kevin
2016-06-03 11:17         ` Discussion about virtual iommu support for Xen guest Tian, Kevin
2016-06-03 13:09           ` Lan, Tianyu
2016-06-03 14:00             ` Andrew Cooper
2016-06-03 13:51           ` Andrew Cooper
2016-06-03 14:31             ` Jan Beulich
2016-06-03 17:14             ` Stefano Stabellini
2016-06-07  5:14               ` Tian, Kevin
2016-06-07  7:26                 ` Jan Beulich
2016-06-07 10:07                 ` Stefano Stabellini
2016-06-08  8:11                   ` Tian, Kevin
2016-06-26 13:42                     ` Lan, Tianyu
2016-06-29  3:04                       ` Tian, Kevin
2016-07-05 13:37                         ` Lan, Tianyu [this message]
2016-07-05 13:57                           ` Jan Beulich
2016-07-05 14:19                             ` Lan, Tianyu
2016-08-17 12:05                             ` Xen virtual IOMMU high level design doc Lan, Tianyu
2016-08-17 12:42                               ` Paul Durrant
2016-08-18  2:57                                 ` Lan, Tianyu
2016-08-25 11:11                               ` Jan Beulich
2016-08-31  8:39                                 ` Lan Tianyu
2016-08-31 12:02                                   ` Jan Beulich
2016-09-01  1:26                                     ` Tian, Kevin
2016-09-01  2:35                                     ` Lan Tianyu
2016-09-15 14:22                               ` Lan, Tianyu
2016-10-05 18:36                                 ` Konrad Rzeszutek Wilk
2016-10-11  1:52                                   ` Lan Tianyu
2016-11-23 18:19                               ` Edgar E. Iglesias
2016-11-23 19:09                                 ` Stefano Stabellini
2016-11-24  2:00                                   ` Tian, Kevin
2016-11-24  4:09                                     ` Edgar E. Iglesias
2016-11-24  6:49                                       ` Lan Tianyu
2016-11-24 13:37                                         ` Edgar E. Iglesias
2016-11-25  2:01                                           ` Xuquan (Quan Xu)
2016-11-25  5:53                                           ` Lan, Tianyu
2016-10-18 14:14                             ` Xen virtual IOMMU high level design doc V2 Lan Tianyu
2016-10-18 19:17                               ` Andrew Cooper
2016-10-20  9:53                                 ` Tian, Kevin
2016-10-20 18:10                                   ` Andrew Cooper
2016-10-20 14:17                                 ` Lan Tianyu
2016-10-20 20:36                                   ` Andrew Cooper
2016-10-22  7:32                                     ` Lan, Tianyu
2016-10-26  9:39                                       ` Jan Beulich
2016-10-26 15:03                                         ` Lan, Tianyu
2016-11-03 15:41                                         ` Lan, Tianyu
2016-10-28 15:36                                     ` Lan Tianyu
2016-10-18 20:26                               ` Konrad Rzeszutek Wilk
2016-10-20 10:11                                 ` Tian, Kevin
2016-10-20 14:56                                 ` Lan, Tianyu
2016-10-26  9:36                               ` Jan Beulich
2016-10-26 14:53                                 ` Lan, Tianyu
2016-11-17 15:36                             ` Xen virtual IOMMU high level design doc V3 Lan Tianyu
2016-11-18 19:43                               ` Julien Grall
2016-11-21  2:21                                 ` Lan, Tianyu
2016-11-21 13:17                                   ` Julien Grall
2016-11-21 18:24                                     ` Stefano Stabellini
2016-11-21  7:05                               ` Tian, Kevin
2016-11-23  1:36                                 ` Lan Tianyu
2016-11-21 13:41                               ` Andrew Cooper
2016-11-22  6:02                                 ` Tian, Kevin
2016-11-22  8:32                                 ` Lan Tianyu
2016-11-22 10:24                               ` Jan Beulich
2016-11-24  2:34                                 ` Lan Tianyu
2016-06-03 19:51             ` Is: 'basic pci bridge and root device support. 'Was:Re: Discussion about virtual iommu support for Xen guest Konrad Rzeszutek Wilk
2016-06-06  9:55               ` Jan Beulich
2016-06-06 17:25                 ` Konrad Rzeszutek Wilk
2016-08-02 15:15     ` Lan, Tianyu
2016-05-27  8:35   ` Tian, Kevin
2016-05-27  8:46     ` Paul Durrant
2016-05-27  9:39       ` Tian, Kevin
2016-05-31  9:43   ` George Dunlap
2016-05-27  2:26 ` Yang Zhang
2016-05-27  8:13   ` Tian, Kevin

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=13fa96c1-4e66-e8a0-3b66-1c93ad2b6543@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=eddie.dong@intel.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    --cc=yang.zhang.wz@gmail.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).