RE: PCI Passthrough and graphic cards ...

2009-11-04 Thread Han, Weidong
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

RE: PCI Passthrough and graphic cards ...

2009-11-04 Thread Han, Weidong
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

RE: PCI Passthrough and graphic cards ...

2009-11-05 Thread Han, Weidong
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

RE: PCI Passthrough and graphic cards ...

2009-11-05 Thread Han, Weidong
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

RE: PCI passthrough of TV-tuners with VT-d

2009-11-09 Thread Han, Weidong
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

RE: [PATCH 1/1] KVM/userspace: Support for assigning PCI devices to guest

2008-06-02 Thread Han, Weidong
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

RE: [PATCH 0/4][VTD] kvm vt-d support kernel changes

2008-06-20 Thread Han, Weidong
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

RE: PCI PT: irq issue

2008-06-20 Thread Han, Weidong
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

RE: PCI PT: irq issue

2008-06-23 Thread Han, Weidong
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

[PATCH] KVM: PCIPT: VT-d: Check if context mapping succeed or not

2008-06-23 Thread Han, Weidong
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

RE: PCI PT: irq issue

2008-06-23 Thread Han, Weidong
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

[PATCH] KVM: PCIPT: VT-d: Use intel_iommu_domain to replace domain

2008-06-23 Thread Han, Weidong
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

RE: PCI PT: irq issue

2008-06-25 Thread Han, Weidong
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

RE: [PATCH] KVM: PCIPT: VT-d: fix context mapping

2008-06-30 Thread Han, Weidong
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

RE: [PATCH] KVM: PCIPT: VT-d multiple devices assignment support

2008-07-03 Thread Han, Weidong
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

RE: [PATCH] KVM: PCIPT: VT-d multiple devices assignment support

2008-07-03 Thread Han, Weidong
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

RE: [PATCH 3/8] KVM: Handle device assignment to guests

2008-07-16 Thread Han, Weidong
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

RE: PCI passthrough with VT-d - native performance

2008-07-16 Thread Han, Weidong
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!

RE: [PATCH 1/2] KVM/userspace: Support for assigning PCI devices to guest

2008-07-17 Thread Han, Weidong
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

RE: [PATCH 1/1] KVM/userspace: Support for assigning PCI devices to guest

2008-07-31 Thread Han, Weidong
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) \ +{ \ +

RE: [PATCH 5/5] This patch extends the VT-d driver to support KVM

2008-08-06 Thread Han, Weidong
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

RE: [PATCH 5/5] This patch extends the VT-d driver to support KVM

2008-08-06 Thread Han, Weidong
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

RE: [PATCH 5/5] This patch extends the VT-d driver to support KVM

2008-08-11 Thread Han, Weidong
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

RE: [PATCH 2/2] KVM: Device assignemnt with VT-d

2008-08-24 Thread Han, Weidong
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

RE: [PATCH 2/2] KVM: Device Assignment with VT-d

2008-08-26 Thread Han, Weidong
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

RE: Test with VT-d patches

2008-09-03 Thread Han, Weidong
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

RE: Test with VT-d patches

2008-09-04 Thread Han, Weidong
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

RE: [PATCH 2/2] KVM: Device Assignment with VT-d

2008-09-09 Thread Han, Weidong
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

[PATCH 2/2] KVM: Device Assignment with VT-d

2008-09-09 Thread Han, Weidong
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

RE: [PATCH 1/2] VT-d: Changes to support KVM

2008-09-11 Thread Han, Weidong
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

RE: [PATCH 2/2] KVM: Device Assignment with VT-d

2008-09-11 Thread Han, Weidong
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

RE: remove compatibility code related toCONFIG_DMAR

2008-09-18 Thread Han, Weidong
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

[PATCH] VT-d: Fix iommu map page for mmio pages

2008-09-19 Thread Han, Weidong
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

RE: [PATCH] KVM/userspace: Support for assigning PCI devices to guests

2008-09-19 Thread Han, Weidong
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

[PATCH] VT-d: remove useless header inclusion

2008-09-23 Thread Han, Weidong
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

Remaining passthrough/VT-d tasks list

2008-09-24 Thread Han, Weidong
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) -

RE: Remaining passthrough/VT-d tasks list

2008-09-24 Thread Han, Weidong
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

RE: Remaining passthrough/VT-d tasks list

2008-09-24 Thread Han, Weidong
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

RE: [PATCH] VT-d: remove useless header inclusion

2008-09-24 Thread Han, Weidong
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

RE: Remaining passthrough/VT-d tasks list

2008-09-24 Thread Han, Weidong
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

RE: Remaining passthrough/VT-d tasks list

2008-09-24 Thread Han, Weidong
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

RE: [PATCH] VT-d: Fix iommu map page for mmio pages

2008-09-25 Thread Han, Weidong
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

RE: [PATCH] VT-d: Fix iommu map page for mmio pages

2008-09-25 Thread Han, Weidong
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

RE: [PATCH] VT-d: Fix iommu map page for mmio pages

2008-09-25 Thread Han, Weidong
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

[PATCH] [RESEND] VT-d: Fix iommu map page for mmio pages

2008-09-25 Thread Han, Weidong
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.

[PATCH] VT-d: Support multiple device assignment to one guest

2008-09-27 Thread Han, Weidong
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

RE: Status of pci passthrough work?

2008-09-27 Thread Han, Weidong
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

RE: Status of pci passthrough work?

2008-09-27 Thread Han, Weidong
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

RE: [PATCH] VT-d: Support multiple device assignment to one guest

2008-09-28 Thread Han, Weidong
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

RE: [PATCH 00/08] Patchset to enable vt-d suport for kvm/ia64 V2.

2008-10-08 Thread Han, Weidong
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/

RE: [PATCH 00/08] Patchset to enable vt-d suport for kvm/ia64 V2.

2008-10-08 Thread Han, Weidong
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

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-08 Thread Han, Weidong
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

Put pass-through/VT-d todo list on KVM wiki

2008-10-08 Thread Han, Weidong
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]

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-09 Thread Han, Weidong
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

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-09 Thread Han, Weidong
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

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-09 Thread Han, Weidong
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

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-09 Thread Han, Weidong
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

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-10 Thread Han, Weidong
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

RE: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest

2008-10-10 Thread Han, Weidong
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

RE: PCI passthrough = NMIs

2008-10-14 Thread Han, Weidong
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

RE: [PATCH 5/6] KVM/userspace: Device Assignment: Support for assigning PCI devices to guests

2008-10-27 Thread Han, Weidong
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

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Han, Weidong
[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

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Han, Weidong
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

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Han, Weidong
[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

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Han, Weidong
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?

RE: [v10] Userspace patches for PCI device assignment

2008-10-30 Thread Han, Weidong
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

[PATCH] kvm: qemu: Fix command info expression of pci_add

2008-11-05 Thread Han, Weidong
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

RE: [PATCH] kvm: qemu: support ioperm for assigned io ports when vcpu hotplug

2008-11-10 Thread Han, Weidong
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

[PATCH] kvm: qemu: support ioperm for assigned io ports when vcpu hotplug

2008-11-09 Thread Han, Weidong
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

[PATCH 1/4] KVM: support VT-d device hotplug

2008-11-14 Thread Han, Weidong
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

Support VT-d device hotplug

2008-11-14 Thread Han, Weidong
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

[PATCH 2/4] KVM/userspace: Add deassign ioctl

2008-11-14 Thread Han, Weidong
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

[PATCH 3/4] KVM/userspace: Add interface to remove ioperm data

2008-11-14 Thread Han, Weidong
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

[PATCH 4/4] KVM/userspace: support hot remove assigned device

2008-11-14 Thread Han, Weidong
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

RE: [PATCH 1/4] KVM: support VT-d device hotplug

2008-11-17 Thread Han, Weidong
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

RE: [PATCH 1/4] KVM: support VT-d device hotplug

2008-11-17 Thread Han, Weidong
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

RE: [PATCH 1/4] KVM: support VT-d device hotplug

2008-11-17 Thread Han, Weidong
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

[PATCH 0/2] Support VT-d multiple device assignment for KVM

2008-11-25 Thread Han, Weidong
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

[PATCH 2/2] KVM: Change to use new APIs for KVM VT-d

2008-11-25 Thread Han, Weidong
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

[PATCH 0/2] [v2] Support VT-d multiple device assignment for KVM

2008-11-27 Thread Han, Weidong
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 -

[PATCH 2/2] [v2] KVM: Change to use new APIs for KVM VT-d

2008-11-27 Thread Han, Weidong
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

RE: [PATCH 2/2] [v2] KVM: Change to use new APIs for KVM VT-d

2008-11-27 Thread Han, Weidong
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

RE: [PATCH 2/9] introcude linux/iommu.h for an iommu api

2008-11-27 Thread Han, Weidong
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

RE: [PATCH 3/9] add frontend implementation for the IOMMU API

2008-11-27 Thread Han, Weidong
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

RE: [PATCH 1/2] [v2] VT-d: Support multiple device assignment for KVM

2008-11-30 Thread Han, Weidong
? 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

RE: [PATCH 1/2] [v2] VT-d: Support multiple device assignment for KVM

2008-12-01 Thread Han, Weidong
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

RE: [PATCH 1/2] [v2] VT-d: Support multiple device assignment for KVM

2008-12-01 Thread Han, Weidong
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

[PATCH 0/13] [v3] Support VT-d multiple device assignment for KVM

2008-12-02 Thread Han, Weidong
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

[PATCH 02/13] move page table handling utility functions

2008-12-02 Thread Han, Weidong
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 |

[PATCH 01/13] iommu bitmap insteads of iommu pointer in dmar_domain

2008-12-02 Thread Han, Weidong
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

[PATCH 03/13] set iommu agaw

2008-12-02 Thread Han, Weidong
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

[PATCH 04/13] iommu coherency

2008-12-02 Thread Han, Weidong
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.

[PATCH 05/13] add domain flag DOMAIN_FLAG_VIRTUAL_MACHINE

2008-12-02 Thread Han, Weidong
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 ++-

[PATCH 06/13] add/remove domain device info for virtual machine VT-d

2008-12-02 Thread Han, Weidong
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

[PATCH 07/13] add domain_flush_cache

2008-12-02 Thread Han, Weidong
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

[PATCH 08/13] allocation and free functions of virtual machine domain

2008-12-02 Thread Han, Weidong
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 ---

[PATCH 09/13] change domain_context_mapping_one for virtual machine domain

2008-12-02 Thread Han, Weidong
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] ---

[PATCH 10/13] change intel iommu APIs

2008-12-02 Thread Han, Weidong
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

[PATCH 13/13] KVM: support device assignment

2008-12-02 Thread Han, Weidong
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 |

[PATCH 12/13] KVM: use the new intel iommu APIs

2008-12-02 Thread Han, Weidong
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   2   3   >