public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4][VTD] kvm vt-d support kernel changes
@ 2008-06-10  0:39 Kay, Allen M
  2008-06-10 12:53 ` Muli Ben-Yehuda
  2008-06-20 18:00 ` Avi Kivity
  0 siblings, 2 replies; 6+ messages in thread
From: Kay, Allen M @ 2008-06-10  0:39 UTC (permalink / raw)
  To: kvm
  Cc: Amit Shah, Muli Ben-Yehuda, Ben-Ami Yassour, Avi Kivity,
	Anthony Liguori, Chris Wright, Han, Weidong

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

I have incorporated most of the feedbacks from the last RFC submission.
It was tested with passthrough an E1000 NIC to a linux guest using
irqhook interrupt injection mechanism.

1) intel_iommu_move.patch: move intel-iommu.h/iova.h to include/linux.
2) intel_iommu_mods.patch: kvm modifications to intel-iommu.c.
3) kvm_generic.patch: vt-d hooks in generic KVM sources.
4) kvm_vtd.patch: vt-d specific files in KVM.

Signed-off-by: Allen M. Kay <allen.m.kay@intel.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4][VTD] kvm vt-d support kernel changes
  2008-06-10  0:39 [PATCH 0/4][VTD] kvm vt-d support kernel changes Kay, Allen M
@ 2008-06-10 12:53 ` Muli Ben-Yehuda
  2008-06-10 19:45   ` Kay, Allen M
  2008-06-20 18:00 ` Avi Kivity
  1 sibling, 1 reply; 6+ messages in thread
From: Muli Ben-Yehuda @ 2008-06-10 12:53 UTC (permalink / raw)
  To: Kay, Allen M
  Cc: kvm, Amit Shah, Ben-Ami Yassour1, Avi Kivity, Anthony Liguori,
	Chris Wright, Han, Weidong

On Mon, Jun 09, 2008 at 05:39:12PM -0700, 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

Allen, which userspace tree did you test this against (branch and
commit)? I am running into incompatibilities between these patches and
the current heads of both master and pvdma branches of
git.kernel.org/pub/scm/linux/kernel/git/amit/kvm-userspace.git.

Cheers,
Muli

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 0/4][VTD] kvm vt-d support kernel changes
  2008-06-10 12:53 ` Muli Ben-Yehuda
@ 2008-06-10 19:45   ` Kay, Allen M
  2008-06-12 12:08     ` Muli Ben-Yehuda
  0 siblings, 1 reply; 6+ messages in thread
From: Kay, Allen M @ 2008-06-10 19:45 UTC (permalink / raw)
  To: Muli Ben-Yehuda
  Cc: kvm, Amit Shah, Ben-Ami Yassour1, Avi Kivity, Anthony Liguori,
	Chris Wright, Han, Weidong

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. :-)

Allen

>-----Original Message-----
>From: Muli Ben-Yehuda [mailto:muli@il.ibm.com] 
>Sent: Tuesday, June 10, 2008 5:53 AM
>To: Kay, Allen M
>Cc: kvm@vger.kernel.org; Amit Shah; Ben-Ami Yassour1; Avi 
>Kivity; Anthony Liguori; Chris Wright; Han, Weidong
>Subject: Re: [PATCH 0/4][VTD] kvm vt-d support kernel changes
>
>On Mon, Jun 09, 2008 at 05:39:12PM -0700, 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
>
>Allen, which userspace tree did you test this against (branch and
>commit)? I am running into incompatibilities between these patches and
>the current heads of both master and pvdma branches of
>git.kernel.org/pub/scm/linux/kernel/git/amit/kvm-userspace.git.
>
>Cheers,
>Muli
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4][VTD] kvm vt-d support kernel changes
  2008-06-10 19:45   ` Kay, Allen M
@ 2008-06-12 12:08     ` Muli Ben-Yehuda
  0 siblings, 0 replies; 6+ messages in thread
From: Muli Ben-Yehuda @ 2008-06-12 12:08 UTC (permalink / raw)
  To: Kay, Allen M
  Cc: kvm, Amit Shah, Ben-Ami Yassour1, Avi Kivity, Anthony Liguori,
	Chris Wright, Han, Weidong

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4][VTD] kvm vt-d support kernel changes
  2008-06-10  0:39 [PATCH 0/4][VTD] kvm vt-d support kernel changes Kay, Allen M
  2008-06-10 12:53 ` Muli Ben-Yehuda
@ 2008-06-20 18:00 ` Avi Kivity
  2008-06-21  3:33   ` Han, Weidong
  1 sibling, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2008-06-20 18:00 UTC (permalink / raw)
  To: Kay, Allen M
  Cc: kvm, Amit Shah, Muli Ben-Yehuda, Ben-Ami Yassour, Anthony Liguori,
	Chris Wright, Han, Weidong

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 application/octet-stream patches.

> I have incorporated most of the feedbacks from the last RFC submission.
> It was tested with passthrough an E1000 NIC to a linux guest using
> irqhook interrupt injection mechanism.
>
> 1) intel_iommu_move.patch: move intel-iommu.h/iova.h to include/linux.
> 2) intel_iommu_mods.patch: kvm modifications to intel-iommu.c.
>   

What's the upstream path for these (who's the subsystem maintainer)?

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 0/4][VTD] kvm vt-d support kernel changes
  2008-06-20 18:00 ` Avi Kivity
@ 2008-06-21  3:33   ` Han, Weidong
  0 siblings, 0 replies; 6+ messages in thread
From: Han, Weidong @ 2008-06-21  3:33 UTC (permalink / raw)
  To: Avi Kivity, Kay, Allen M
  Cc: kvm, Amit Shah, Muli Ben-Yehuda, Ben-Ami Yassour, Anthony Liguori,
	Chris Wright

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 application/octet-stream patches.
> 
>> I have incorporated most of the feedbacks from the last RFC
>> submission. It was tested with passthrough an E1000 NIC to a linux
>> guest using irqhook interrupt injection mechanism.
>> 
>> 1) intel_iommu_move.patch: move intel-iommu.h/iova.h to
>> include/linux. 2) intel_iommu_mods.patch: kvm modifications to
>> intel-iommu.c. 
>> 
> 
> What's the upstream path for these (who's the subsystem maintainer)?

Now Gross Mark from Intel is the kernel VT-d maintainer. I have
contacted him and asked him to review these patches.

Randy (Weidong)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-21  3:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10  0:39 [PATCH 0/4][VTD] kvm vt-d support kernel changes Kay, Allen M
2008-06-10 12:53 ` Muli Ben-Yehuda
2008-06-10 19:45   ` Kay, Allen M
2008-06-12 12:08     ` Muli Ben-Yehuda
2008-06-20 18:00 ` Avi Kivity
2008-06-21  3:33   ` Han, Weidong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox