Passthrough graphic card to guest can satisfy your requirement. Currently it's
not supported in kvm, but we have a plan to support it, but you still need wait
for a while.
I think sharing the host graphics power is not easy to implement.
Regards,
Weidong
Michael McStarfighter wrote:
By the
for the people who use Windows for videogames
Thank you
Asdo
Han, Weidong wrote:
Passthrough graphic card to guest can satisfy your requirement.
Currently it's not supported in kvm, but we have a plan to support
it, but you still need wait for a while.
I think sharing the host graphics
into kvm.
If someone has more information, please, let me know.
Thanks
Federico
Han, Weidong wrote:
Passthrough graphic card to guest can satisfy your requirement.
Currently it's not supported in kvm, but we have a plan to support
it, but you still need wait for a while.
I think
after requests. I have been toying with the Xen
component and would love to see this in KVM
-Original Message-
From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On
Behalf Of Han, Weidong
Sent: Friday, 6 November 2009 11:37 AM
To: 'Fede'; 'Asdo'
Cc: 'kvm
Kenni Lund wrote:
Hi
While considering upgrading my MythTV backend to a VT-d capable
system, I'm trying to figure out if it would be possible to utilize
PCI passthrough with KVM.
As far as I understand the wiki page on How to assign devices with
VT-d [1] and various posts on mailing
Amit Shah wrote:
From: Or Sagi [EMAIL PROTECTED]
From: Nir Peleg [EMAIL PROTECTED]
From: Amit Shah [EMAIL PROTECTED]
From: Glauber de Oliveira Costa [EMAIL PROTECTED]
We can assign a device from the host machine to a guest. The original
code comes
from Neocleus.
A new command-line
Avi Kivity wrote:
Kay, Allen M wrote:
Following four patches contains changes for enabling VT-d PCI
passthrough. The patches are located at:
git.kernel.org/pub/scm/linux/kernel/git/amit/kvm.git vtd
Please attach patches as text/plain or inline them. It's very
annoying to review
Amit Shah wrote:
On Thursday 19 June 2008 10:17:29 Amit Shah wrote:
* On Wednesday 18 June 2008 18:26:16 Ben-Ami Yassour wrote:
Amit,
With the current implementation we have an issue if the driver on
the host was never loaded.
To be able to run kvm with passthrough we have to load and
Amit Shah wrote:
On Thursday 19 June 2008 10:17:29 Amit Shah wrote:
* On Wednesday 18 June 2008 18:26:16 Ben-Ami Yassour wrote:
Amit,
With the current implementation we have an issue if the driver on
the host was never loaded.
To be able to run kvm with passthrough we have to load and
From 3898ee02c07054af2867ed49cd7973016aab2132 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Mon, 23 Jun 2008 16:45:56 +0800
Subject: [PATCH] Check if context mapping succeed or not
If context mapping fails, return error. And also, don't need to restore
back host linux iommu
Amit Shah wrote:
On Saturday 21 June 2008 09:41:18 Han, Weidong wrote:
Amit Shah wrote:
A couple of notes for the VT-d patch:
- The pci_dev struct is now available in the pci_pt kernel
structure, so just use that information each time you want to add a
device instead of searching
From 682af63ae034814d7ed1be8a7e4c6cee3d8b26c1 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Mon, 23 Jun 2008 23:30:31 +0800
Subject: [PATCH] Use intel_iommu_domain to replace domain
domain is too generic.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
arch/x86/kvm/vtd.c
Amit Shah wrote:
On Monday 23 June 2008 20:46:18 Han, Weidong wrote:
Amit Shah wrote:
On Saturday 21 June 2008 09:41:18 Han, Weidong wrote:
Amit Shah wrote:
A couple of notes for the VT-d patch:
- The pci_dev struct is now available in the pci_pt kernel
structure, so just use
Ben-Ami Yassour wrote:
On Fri, 2008-06-20 at 14:23 +0800, Han, Weidong wrote:
Ben-Ami Yassour1 wrote:
Han, Weidong [EMAIL PROTECTED] wrote on 19/06/2008 17:18:00:
Ben-Ami Yassour wrote:
On Thu, 2008-06-19 at 16:59 +0800, Han, Weidong wrote:
[EMAIL PROTECTED] wrote:
From: Ben-Ami Yassour
Ben,
Thanks for your reminder. I attach the patch.
Randy (Weidong)
Ben-Ami Yassour wrote:
Weidong,
There seems to be line wrapping issues with the patch.
Please resend it.
Thanks,
Ben
On Thu, 2008-07-03 at 17:05 +0800, Han, Weidong wrote:
Multiple devices may under different
Ben-Ami Yassour wrote:
Weidong,
I agree that supporting multiple devices is important, but I think
that supporting a single device is good enough for a first merge with
the main kvm tree. I suggest that we focus on merging with the main
tree and work on this in the background.
I agree
Avi Kivity wrote:
+static void kvm_pci_pt_work_fn(struct work_struct *work) +{
+struct kvm_pci_pt_dev_list *match;
+struct kvm_pci_pt_work *int_work;
+int source;
+unsigned long flags;
+int guest_irq;
+int host_irq;
+
+int_work = container_of(work, struct
Anthony Liguori wrote:
Ben-Ami Yassour wrote:
On Wed, 2008-07-16 at 17:36 +0300, Avi Kivity wrote:
Ben-Ami Yassour wrote:
In last few tests that we made with PCI-passthrough and VT-d using
iperf, we were able to get the same throughput as on native OS
with a 1G NIC
Excellent!
Ben-Ami Yassour wrote:
From: Or Sagi [EMAIL PROTECTED]
From: Nir Peleg [EMAIL PROTECTED]
From: Amit Shah [EMAIL PROTECTED]
From: Glauber de Oliveira Costa [EMAIL PROTECTED]
We can assign a device from the host machine to a guest. The
original code comes from Neocleus.
A new
Ben-Ami Yassour wrote:
+#define assigned_dev_ioport_write(suffix)
\
+static void assigned_dev_ioport_write##suffix(void *opaque,
\ + uint32_t addr,
\
+ uint32_t value)
\
+{
\
+
Ben-Ami Yassour wrote:
On Wed, 2008-08-06 at 14:18 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
On Tue, 2008-08-05 at 22:46 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
[Ben: fixed memory pinning]
Signed-off-by: Kay, Allen M [EMAIL PROTECTED]
Signed-off-by: Weidong Han [EMAIL
Ben-Ami Yassour wrote:
On Wed, 2008-08-06 at 17:12 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
On Wed, 2008-08-06 at 14:18 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
On Tue, 2008-08-05 at 22:46 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
[Ben: fixed memory pinning
Ben-Ami Yassour wrote:
On Thu, 2008-08-07 at 09:21 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
On Wed, 2008-08-06 at 17:12 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
On Wed, 2008-08-06 at 14:18 +0800, Han, Weidong wrote:
Ben-Ami Yassour wrote:
On Tue, 2008-08-05 at 22:46 +0800
Avi Kivity wrote:
Amit Shah wrote:
That only detects if the headers have the flag, not if the kernel
actually supports it (and whether there is an iommu in the host).
We need run-time detection.
Which means we expose KVM_CAP_IOMMU only if one was detected?
Yes.
How to do this
Avi Kivity wrote:
Zhang, Xiantao wrote:
Amit Shah wrote:
* On Tuesday 26 Aug 2008 15:58:42 Zhang, Xiantao wrote:
Maybe vtd.c should be put @ virt/kvm so that ia64 can share it to
avoid future code move.
As of now, device assignment resides inside the x86 directory and is
only tested
I think the assigned NIC shares IRQ with other devices. You can verify
it at request_irq() in kvm_vm_ioctl_assign_irq() (arch/x86/kvm/x86.c).
assigned_dev_update_irq: Input/output error should be caused by
request_irq() failure. In my machine, add-on NIC shares IRQ with usb.
You can check it in
remote over a serial-console. But then I cannot
use the guest system without keyboard/mouse. (login and so)
Han, Weidong told to use IRQF_SHARED in reqeust_irq(). In which
code?
Both tests are only made to get an idea how it works with other
devices.
My primary efforts are to use my
Amit Shah wrote:
There are a couple of things here that might need some error handling:
* On Tuesday 26 August 2008 14:25:35 Amit Shah wrote:
From: Ben-Ami Yassour [EMAIL PROTECTED]
Based on a patch by: Kay, Allen M [EMAIL PROTECTED]
This patch enables PCI device assignment based on
From: Ben-Ami Yassour [EMAIL PROTECTED]
Based on a patch by: Kay, Allen M [EMAIL PROTECTED]
This patch enables PCI device assignment based on VT-d support.
When a device is assigned to the guest, the guest memory is pinned and
the mapping is updated in the VT-d IOMMU.
[Amit: Expose
Avi Kivity wrote:
Amit Shah wrote:
From: Kay, Allen M [EMAIL PROTECTED]
This patch extends the VT-d driver to support KVM
[Ben: fixed memory pinning]
Signed-off-by: Kay, Allen M [EMAIL PROTECTED]
Signed-off-by: Weidong Han [EMAIL PROTECTED]
Signed-off-by: Ben-Ami Yassour [EMAIL
This patch only can work on x86, it breaks build on other architectures.
It is caused by kvm_irq_ack_notifier and kvm_assigned_dev_kernel are
defined under x86, while they are always used in
include/linux/kvm_host.h whether CONFIG_DMAR is set or not. I move these
two definitions to
Mike,
I saw your patch. It's good.
Randy (Weidong)
Mike Day wrote:
On 18/09/08 22:07 +0800, Han, Weidong wrote:
The previous patch I sent out (for the kvm kernel tree) changes
intel-iommu.h so this compatibility code is no longer needed.
Mike
This compatibility code for intel_iommu
From 9d8e927a937ff7c9fa2bcc3aa5359e73990658f0 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Fri, 19 Sep 2008 14:04:52 +0800
Subject: [PATCH] Fix iommu map page for mmio pages
Don't need to map mmio pages for iommu. When find mmio pages in
kvm_iommu_map_pages(), don't map
Amit,
There are a few format issues in your patch, and this patch doesn't
work.
Flag KVM_DEV_ASSIGN_ENABLE_IOMMU is not set correctly. My comment
inline.
Amit Shah wrote:
+
+static AssignedDevice *register_real_device(PCIBus *e_bus,
+ const char
Currently #include linux/intel-iommu.h is not needed in
virt/kvm/kvm_main.c. What's more, this inclusion may result in
compilation error in other architecture.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
virt/kvm/kvm_main.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff
Hi all,
The initial passthrough/VT-d patches have been in kvm, it's time to
enhance it, and push them into 2.6.28.
Following is the remaining passthrough/VT-d tasks list:
- Multiple devices assignment (WIP)
- MSI support (WIP)
- MTRR/PAT support of EPT (WIP)
-
Amit Shah wrote:
* On Wednesday 24 Sep 2008 13:21:25 Han, Weidong wrote:
Amit Shah wrote:
- Add dummy driver to hide/unbind passthrough device from
host kernel
This isn't needed; we currently don't assign the device to the guest
if we find that a driver is already loaded. I
Avi Kivity wrote:
Han, Weidong wrote:
- Add dummy driver to hide/unbind passthrough device from host
kernel
Maybe this can be implemented at the modprobe/hotplug level.
I think so.
Randy (Weidong)
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body
Avi Kivity wrote:
Han, Weidong wrote:
Currently #include linux/intel-iommu.h is not needed in
virt/kvm/kvm_main.c. What's more, this inclusion may result in
compilation error in other architecture.
Applied, but please also fix intel-iommu.h to compile on all archs.
Avi,
Current intel
Amit Shah wrote:
* On Wednesday 24 Sep 2008 14:08:14 Han, Weidong wrote:
Amit Shah wrote:
* On Wednesday 24 Sep 2008 13:21:25 Han, Weidong wrote:
Amit Shah wrote:
- Add dummy driver to hide/unbind passthrough device from
host kernel
This isn't needed; we currently don't assign
Avi Kivity wrote:
Amit Shah wrote:
* On Wednesday 24 Sep 2008 14:16:47 Avi Kivity wrote:
Amit Shah wrote:
I'd say we have about 3 weeks to get things in.
How do you figure? 2.6.26 was released July 13, we're more than 2.5
months later.
A week for 2.6.28 to open and two weeks for
Avi Kivity wrote:
Han, Weidong wrote:
Don't need to map mmio pages for iommu. When find mmio pages in
kvm_iommu_map_pages(), don't map them, and shouldn't return error
due to it's not an error. If return error (such as -EINVAL), device
assigment will fail.
I don't understand. Why
Avi Kivity wrote:
Han, Weidong wrote:
Avi Kivity wrote:
Han, Weidong wrote:
Don't need to map mmio pages for iommu. When find mmio pages in
kvm_iommu_map_pages(), don't map them, and shouldn't return error
due to it's not an error. If return error (such as -EINVAL),
device assigment
Avi and Anthony,
I will resend the patch soon. Thanks.
Randy (Weidong)
Anthony Liguori wrote:
Avi Kivity wrote:
Han, Weidong wrote:
Is it possible DMA into an mmio page?
I don't see why not.
Yeah, it is. I mentioned this a long time ago. We definitely need to
map mmio pages
From 61028d958dc7c57ee02de32ea89b025dccb9650d Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Thu, 25 Sep 2008 23:32:02 +0800
Subject: [PATCH] Map mmio pages into VT-d page table
Assigned device could DMA to mmio pages, so also need to map mmio pages
into VT-d page table.
From f2f722515135d95016f2d2ab55cc2aaf23d2fd80 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Sat, 27 Sep 2008 14:28:07 +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
Hi Thomas,
the patches of passthrough/VT-d on kvm.git are already checked in. With
Amit's userspace patches, you can assign device to guest. You can have a
try.
Randy (Weidong)
Thomas Fjellstrom wrote:
I'm very interested in being able to pass a few devices through to
kvm guests. I'm
Thomas Fjellstrom wrote:
On Saturday 27 September 2008, Han, Weidong wrote:
Hi Thomas,
the patches of passthrough/VT-d on kvm.git are already checked in.
With Amit's userspace patches, you can assign device to guest. You
can have a try.
Does that mean I need VT-d support in hardware? All
Muli Ben-Yehuda wrote:
On Sat, Sep 27, 2008 at 02:28:03PM +0800, Han, Weidong wrote:
From f2f722515135d95016f2d2ab55cc2aaf23d2fd80 Mon Sep 17 00:00:00
2001
From: Weidong Han [EMAIL PROTECTED]
Date: Sat, 27 Sep 2008 14:28:07 +0800
Subject: [PATCH] Support multiple device assignment to one
Avi Kivity wrote:
Zhang, Xiantao wrote:
Hi, Avi
I have rebased the patchset according to your comments, it can
be applied to current tip of kvm.git. Please review again and apply
if no other concerns. Thanks! Xiantao
[PATCH 1/8] kvm/vt-d: Moving vtd.c from arch/x86/kvm/ to virt/kvm/
Zhang, Xiantao wrote:
Han, Weidong wrote:
Avi Kivity wrote:
Zhang, Xiantao wrote:
Hi, Avi
I have rebased the patchset according to your comments, it can
be applied to current tip of kvm.git. Please review again and apply
if no other concerns. Thanks! Xiantao
[PATCH 1/8] kvm/vt-d
Avi Kivity wrote:
Han, Weidong wrote:
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.
Why do you say it should be handled by iommu API?
Because
I added pass-through/VT-d todo list on KVM TODO page:
http://kvm.qumranet.com/kvmwiki/TODO.
If you are interested, pls pick them up and keep community informed.
Thanks.
Regards,
Weidong
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
Avi Kivity wrote:
Han, Weidong wrote:
If we devolve this to the iommu API, the same io page table can be
shared by all iommus, so long as they all use the same page table
format.
I don't understand how to handle this by iommu API. Let me explain
my thoughts more clearly:
VT-d spec
Avi Kivity wrote:
Han, Weidong wrote:
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
Let dmar_domains share io page table
Avi Kivity wrote:
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
Han, Weidong wrote:
Avi Kivity wrote:
Han, Weidong wrote:
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
Let dmar_domains share
Avi Kivity wrote:
Han, Weidong wrote:
It's hard to move kvm_vtd_domain inside current iommu API. It's kvm
specific. It's not elegant to include kvm_vtd_domain stuffs in native
VT-d code.
It's cleaner than adding knowledge of how the iommu works to kvm.
I will try to move kvm_vtd_domain
Avi Kivity wrote:
Han, Weidong wrote:
2.6.27 is out, so anything we do will be for 2.6.29.
Do you mean the VT-d patches which haven't been checked in won't be
pushed into 2.6.28?
Yes. The only exception is the guest interrupt sharing patch, which
is awaiting testing.
Ok, I see
Zwane Mwaikambo wrote:
Hi,
I've been trying to get a Linux guest working with PCI
passthrough
of an ethernet card using the vtd branches. The device detection
works and the guest reports a link, however as soon as i try and ping
the guest it receives an NMI (i'm guessing this is PCI DMA
Su, Disheng wrote:
Amit Shah wrote:
This patch has been contributed to by the following people:
From: Or Sagi [EMAIL PROTECTED]
From: Nir Peleg [EMAIL PROTECTED]
From: Amit Shah [EMAIL PROTECTED]
From: Ben-Ami Yassour [EMAIL PROTECTED]
From: Weidong Han [EMAIL PROTECTED]
From: Glauber de
[EMAIL PROTECTED] wrote:
From: Muli Ben-Yehuda [EMAIL PROTECTED]
This patch has been contributed to by the following people:
Or Sagi [EMAIL PROTECTED]
Nir Peleg [EMAIL PROTECTED]
Amit Shah [EMAIL PROTECTED]
Ben-Ami Yassour [EMAIL PROTECTED]
Weidong Han [EMAIL PROTECTED]
Glauber de
Han, Weidong wrote:
[EMAIL PROTECTED] wrote:
From: Muli Ben-Yehuda [EMAIL PROTECTED]
This patch has been contributed to by the following people:
Or Sagi [EMAIL PROTECTED]
Nir Peleg [EMAIL PROTECTED]
Amit Shah [EMAIL PROTECTED]
Ben-Ami Yassour [EMAIL PROTECTED]
Weidong Han [EMAIL
[EMAIL PROTECTED] wrote:
From: Muli Ben-Yehuda [EMAIL PROTECTED]
This patch has been contributed to by the following people:
Or Sagi [EMAIL PROTECTED]
Nir Peleg [EMAIL PROTECTED]
Amit Shah [EMAIL PROTECTED]
Ben-Ami Yassour [EMAIL PROTECTED]
Weidong Han [EMAIL PROTECTED]
Glauber de
Muli Ben-Yehuda wrote:
On Tue, Oct 28, 2008 at 10:45:57AM -0500, Anthony Liguori wrote:
+ifeq ($(USE_KVM), 1)
+OBJS+= device-assignment.o
+endif
I don't think you want to build this on PPC so I think you need a
stronger check.
Good point. How about checking TARGET_BASE_ARCH = i386?
Anthony Liguori wrote:
[EMAIL PROTECTED] wrote:
This patchset enables device assignment for KVM hosts for PCI
devices. It uses the Intel IOMMU by default if available.
This is still broken wrt CPU hotplug. If a new CPU comes online, it
won't have it's ioperm mask set correct and it will
From fb7e8b1018ed8716a6fbdc30e519748567d24d55 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Thu, 6 Nov 2008 15:20:41 +0800
Subject: [PATCH] Fix command info expression of pci_add
Add a comma
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
qemu/monitor.c |2 +-
1 files
Avi Kivity wrote:
Han, Weidong wrote:
From 39ca008b144e1e729223b1302fcdd7a435370487 Mon Sep 17 00:00:00
2001 From: Weidong Han [EMAIL PROTECTED]
Date: Mon, 10 Nov 2008 14:33:43 +0800
Subject: [PATCH] support ioperm for vcpu hotplug
Track ioperm settings, when a new VCPU comes online, issue
From 39ca008b144e1e729223b1302fcdd7a435370487 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Mon, 10 Nov 2008 14:33:43 +0800
Subject: [PATCH] support ioperm for vcpu hotplug
Track ioperm settings, when a new VCPU comes online, issue ioperm.
Signed-off-by: Weidong Han [EMAIL
From bba614bf2acf22f765995fb2364de04cec039226 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Fri, 14 Nov 2008 16:53:10 +0800
Subject: [PATCH] support VT-d device hotplug
wrap kvm_assign_device() and kvm_deassign_device() to support assign/deassign a
device to a guest
Currently, it doesn't handle cleanly for VT-d device hot add, because
kvm_map_guest() will allocate a dmar_domain. It should add a device to the
existed dmar_domain instead create a new one. For hot remove, it doesn't
release the device from adev_head list, remove its ioperm data from
From 79fd6880a8e7caaecc98e559a673400d20fb14be Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Fri, 14 Nov 2008 16:31:12 +0800
Subject: [PATCH] Deassign ioctl
Add this to support hot remove assigned device
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
libkvm/libkvm.c | 12
From 9cf3b4c270c12f1ba966a033f3d207aed898a52a Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Fri, 14 Nov 2008 16:35:16 +0800
Subject: [PATCH] Add interface to remove ioperm data
When hot remove assigned device, need to remove its ioperm data
Signed-off-by: Weidong Han [EMAIL
From 63d8eeeff86e881ab212baed4af51801dbb90460 Mon Sep 17 00:00:00 2001
From: Weidong Han [EMAIL PROTECTED]
Date: Fri, 14 Nov 2008 16:45:44 +0800
Subject: [PATCH] support hot remove assigned device
When hot remove assigned device, deassign it from guest, delete it from
adev_head and remove its
Avi Kivity wrote:
Han, Weidong wrote:
From bba614bf2acf22f765995fb2364de04cec039226 Mon Sep 17 00:00:00
2001
From: Weidong Han [EMAIL PROTECTED]
Date: Fri, 14 Nov 2008 16:53:10 +0800
Subject: [PATCH] support VT-d device hotplug
wrap kvm_assign_device() and kvm_deassign_device
Avi Kivity wrote:
Han, Weidong wrote:
Need a KVM_CAP_ to indicate this is available.
KVM_ASSIGN_PCI_DEVICE and KVM_ASSIGN_IRQ don't need a KVM_CAP_xxx.
Why do you need it for KVM_DEASSIGN_PCI_DEVICE?
#define KVM_CAP_DEVICE_ASSIGNMENT 17
Do you mean add it like that:
#ifdef
Avi Kivity wrote:
Han, Weidong wrote:
This is how KVM_CAP_ works:
- kvm.h defines KVM_CAP_DEVICE_ASSIGNMENT
- userspace compiles device assignment code only if it sees
KVM_CAP_DEVICE_ASSIGNMENT in kvm.h
- kvm.ko returns nonzero to ioctl(KVM_CHECK_EXTENSION,
KVM_CAP_DEVICE_ASSIGNMENT
In native VT-d usage, one domain (dmar_domain) owns one device (PCI-e). KVM
uses VT-d driver to assign device, so currently kvm VT-d only supports assign
single device to a guest.
While in KVM VT-d usage, multiple devices from different iommus can be assigned
to one guest. In order to support
This patch changes to use new APIs for KVM VT-d, and add device deassignment
for hotplug.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
include/linux/kvm.h |2 +
include/linux/kvm_host.h | 23 --
virt/kvm/kvm_main.c | 45 ++-
virt/kvm/vtd.c
This patchset supports VT-d multiple device assignment for KVM.
Main changes from V1 to V2:
Fixed all comments from Avi and Fenghua.
Main changes on patch 1:
- implement independent low level functions for kvm, then won't impact native
VT-d.
- add reference count of iommu which used by domain
-
This patch changes to use new APIs for KVM VT-d, and add device deassignment
for hotplug.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
include/linux/kvm.h |5 ++
include/linux/kvm_host.h | 23 --
virt/kvm/kvm_main.c | 49 -
virt/kvm/vtd.c
Joerg Roedel wrote:
On Thu, Nov 27, 2008 at 09:49:13PM +0800, Han, Weidong wrote:
This patch changes to use new APIs for KVM VT-d, and add device
deassignment for hotplug.
Somehow we always step on each others feed :-)
I just wrote a patch series to factor the VT-d API into a generic one
Joerg Roedel wrote:
This patch introduces the API to abstract the exported VT-d functions
for KVM into a generic API. This way the AMD IOMMU implementation can
plug into this API later.
Signed-off-by: Joerg Roedel [EMAIL PROTECTED]
---
include/linux/iommu.h | 100
Joerg Roedel wrote:
Signed-off-by: Joerg Roedel [EMAIL PROTECTED]
---
drivers/base/iommu.c | 94
++ 1 files changed,
94 insertions(+), 0 deletions(-) create mode 100644
drivers/base/iommu.c
diff --git a/drivers/base/iommu.c
?
Joerg
On Thu, Nov 27, 2008 at 09:49:04PM +0800, Han, Weidong wrote:
In order to support multiple device assignment for KVM, this patch
does following main changes:
- extend dmar_domain to own multiple devices from different
iommus, use a bitmap of iommus to replace iommu pointer
Sorry, this patch has style problem. I will update it and also split it to
smaller patches for easy reviewing.
Regards,
Weidong
'Joerg Roedel' wrote:
Hmm, I get these errors using git-am:
Applying VT-d: Support multiple device assignment for KVM
.dotest/patch:1344: space before tab in
in a single series. Any problems with this
approach?
Joerg
On Mon, Dec 01, 2008 at 09:22:42PM +0800, Han, Weidong wrote:
Sorry, this patch has style problem. I will update it and also split
it to smaller patches for easy reviewing.
Regards,
Weidong
'Joerg Roedel' wrote:
Hmm, I get
This patchset supports VT-d multiple device assignment for KVM.
Main changes from V2 to V3:
- change intel iommu APIs, which are consistent with Joerg's generic iommu APIs.
- split to a serial smaller patches for easy reviewing.
Regards,
Weidong--
To unsubscribe from this list: send the line
move page table handling utility functions from intel-iommu.c to
dma_remapping.h, because some of them will be used in other .c files.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c | 45
include/linux/dma_remapping.h |
Support dmar_domain own multiple devices from different iommus, which are set
in iommu bitmap. add function domain_get_iommu() to get the only one iommu of
domain in native VT-d usage.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c | 102
agaw may be different across iommus.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/dmar.c| 14 ++
include/linux/dma_remapping.h |2 ++
include/linux/intel-iommu.h |1 +
3 files changed, 17 insertions(+), 0 deletions(-)
diff --git
in dmar_domain, more than one iommus may be included in iommu_bmp. Due to
Coherency capability may be different across iommus, set this variable to
indicate iommu access is coherent or not. Only when all related iommus in a
dmar_domain are all coherent, iommu access of this domain is coherent.
By default, one domain owns one device, like native VT-d usage.
For kvm VT-d usage, more than one devices across iommus may be assigned to one
domain, flag DOMAIN_FLAG_VIRTUAL_MACHINE is for this usage.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c |3 ++-
Separate add/remove domain device info functions for virtual machine VT-d from
natvie VT-d.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c | 164 +++-
include/linux/dma_remapping.h |1 +
2 files changed, 160
For some common low level functions which will be also used by virtual machine
usage, use domain_flush_cache instead of __iommu_flush_cache.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c | 40
1 files changed, 24
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c | 104 -
1 files changed, 103 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index b00a8f2..e96b3bc 100644
---
vm_domid won't be set in context, find available domain id for a device from
its iommu.
For a virtual machine domain, a default agaw will be set, and skip top levels
of page tables for iommu which has less agaw than default.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
These APIs will be used by kvm VT-d. The domain used by these APIs is virtual
machine domain (domain flag is DOMAIN_FLAG_VIRTUAL_MACHINE).
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
drivers/pci/intel-iommu.c | 128 ---
include/linux/intel-iommu.h
Support device assignment, it can be used in device hotplug.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
include/linux/kvm.h |5 +
include/linux/kvm_host.h |8
virt/kvm/kvm_main.c | 42 ++
virt/kvm/vtd.c |
intel iommu APIs are updated, use the new APIs.
In addition, change kvm_iommu_map_guest() to just create the domain, let
kvm_iommu_assign_device() assign device.
Signed-off-by: Weidong Han [EMAIL PROTECTED]
---
include/linux/kvm_host.h | 15 +--
virt/kvm/kvm_main.c |7 +++-
1 - 100 of 209 matches
Mail list logo