On Tue, Jun 10, 2008 at 12:45:30PM -0700, Kay, Allen M wrote:
> Muli,
> 
> The userpsace branch is located at:
> 
> git.kernel.org/pub/scm/linux/kernel/git/amit/kvm-userspace.git vtd
> 
> I forgot to send out the userspace patch last night. :-)

Thanks Allen. I am trying to get the latest rev to work with the irq
injection method rather than irq chip. Amit's latest code overloads
KVM_ASSIGN_PCI_PT_DEV to inform the host kernel of guest IRQ changes,
so we either need something like the attachd patch to not map the
guest multiple times, or we need to introduce
KVM_PCI_PT_DEV_IRQ_CHANGE in additino to KVM_ASSIGN_PCI_PT_DEV.

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1b50ba3..2d61375 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -305,6 +305,14 @@ static int kvm_vm_ioctl_pci_pt_dev(struct kvm *kvm,
                        goto out_free;
                }
        }
+
+       if (kvm_intel_iommu_found()) {
+               r = kvm_iommu_map_guest(kvm, pci_pt_dev);
+               if (r)
+                       goto out_free;
+       }
+
        write_lock_irqsave(&kvm_pci_pt_lock, flags);
 
        INIT_WORK(&match->pt_dev.int_work.work, kvm_pci_pt_work_fn);
@@ -1962,11 +1970,6 @@ long kvm_arch_vm_ioctl(struct file *filp,
                r = kvm_vm_ioctl_pci_pt_dev(kvm, &pci_pt_dev);
                if (r)
                        goto out;
-               if (kvm_intel_iommu_found()) {
-                       r = kvm_iommu_map_guest(kvm, &pci_pt_dev);
-                       if (r)
-                               goto out;
-               }
                break;
        }
        case KVM_GET_PIT: {

Cheers,
Muli
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to