kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] VT-d: Fix iommu map page for mmio pages
@ 2008-09-19  7:15 Han, Weidong
  2008-09-25 10:27 ` Avi Kivity
  0 siblings, 1 reply; 14+ messages in thread
From: Han, Weidong @ 2008-09-19  7:15 UTC (permalink / raw)
  To: kvm; +Cc: avi, Amit Shah, Kay, Allen M, benami

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

>From 9d8e927a937ff7c9fa2bcc3aa5359e73990658f0 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
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 them, and shouldn't return error due to
it's not an error. If return error (such as -EINVAL), device assigment
will fail.

Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 arch/x86/kvm/vtd.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/vtd.c b/arch/x86/kvm/vtd.c
index 667bf3f..b00cdbd 100644
--- a/arch/x86/kvm/vtd.c
+++ b/arch/x86/kvm/vtd.c
@@ -36,14 +36,13 @@ int kvm_iommu_map_pages(struct kvm *kvm,
 {
 	gfn_t gfn = base_gfn;
 	pfn_t pfn;
-	int i, r;
+	int i, r = 0;
 	struct dmar_domain *domain = kvm->arch.intel_iommu_domain;
 
 	/* check if iommu exists and in use */
 	if (!domain)
 		return 0;
 
-	r = -EINVAL;
 	for (i = 0; i < npages; i++) {
 		/* check if already mapped */
 		pfn = (pfn_t)intel_iommu_iova_to_pfn(domain,
@@ -60,13 +59,14 @@ int kvm_iommu_map_pages(struct kvm *kvm,
 						     DMA_PTE_READ |
 						     DMA_PTE_WRITE);
 			if (r) {
-				printk(KERN_DEBUG "kvm_iommu_map_pages:"
+				printk(KERN_ERR "kvm_iommu_map_pages:"
 				       "iommu failed to map pfn=%lx\n",
pfn);
 				goto unmap_pages;
 			}
 		} else {
-			printk(KERN_DEBUG "kvm_iommu_map_page:"
-			       "invalid pfn=%lx\n", pfn);
+			printk(KERN_DEBUG "kvm_iommu_map_pages:"
+			       "invalid pfn=%lx, iommu needn't map "
+			       "MMIO pages!\n", pfn);
 			goto unmap_pages;
 		}
 		gfn++;
-- 
1.5.1

[-- Attachment #2: 0001-Fix-iommu-map-page-for-mmio-pages.patch --]
[-- Type: application/octet-stream, Size: 1655 bytes --]

From 9d8e927a937ff7c9fa2bcc3aa5359e73990658f0 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
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 them, and shouldn't return error. It's not an error. If return error (such as -EINVAL), device assigment will fail.

Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 arch/x86/kvm/vtd.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/vtd.c b/arch/x86/kvm/vtd.c
index 667bf3f..b00cdbd 100644
--- a/arch/x86/kvm/vtd.c
+++ b/arch/x86/kvm/vtd.c
@@ -36,14 +36,13 @@ int kvm_iommu_map_pages(struct kvm *kvm,
 {
 	gfn_t gfn = base_gfn;
 	pfn_t pfn;
-	int i, r;
+	int i, r = 0;
 	struct dmar_domain *domain = kvm->arch.intel_iommu_domain;
 
 	/* check if iommu exists and in use */
 	if (!domain)
 		return 0;
 
-	r = -EINVAL;
 	for (i = 0; i < npages; i++) {
 		/* check if already mapped */
 		pfn = (pfn_t)intel_iommu_iova_to_pfn(domain,
@@ -60,13 +59,14 @@ int kvm_iommu_map_pages(struct kvm *kvm,
 						     DMA_PTE_READ |
 						     DMA_PTE_WRITE);
 			if (r) {
-				printk(KERN_DEBUG "kvm_iommu_map_pages:"
+				printk(KERN_ERR "kvm_iommu_map_pages:"
 				       "iommu failed to map pfn=%lx\n", pfn);
 				goto unmap_pages;
 			}
 		} else {
-			printk(KERN_DEBUG "kvm_iommu_map_page:"
-			       "invalid pfn=%lx\n", pfn);
+			printk(KERN_DEBUG "kvm_iommu_map_pages:"
+			       "invalid pfn=%lx, iommu needn't map "
+			       "MMIO pages!\n", pfn);
 			goto unmap_pages;
 		}
 		gfn++;
-- 
1.5.1


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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-19  7:15 [PATCH] VT-d: Fix iommu map page for mmio pages Han, Weidong
@ 2008-09-25 10:27 ` Avi Kivity
  2008-09-25 13:44   ` Han, Weidong
  0 siblings, 1 reply; 14+ messages in thread
From: Avi Kivity @ 2008-09-25 10:27 UTC (permalink / raw)
  To: Han, Weidong; +Cc: kvm, Amit Shah, Kay, Allen M, benami

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 don't we need to map mmio pages?  We certainly 
don't want them emulated.

> @@ -36,14 +36,13 @@ int kvm_iommu_map_pages(struct kvm *kvm,
>  {
>  	gfn_t gfn = base_gfn;
>  	pfn_t pfn;
> -	int i, r;
> +	int i, r = 0;
>  	struct dmar_domain *domain = kvm->arch.intel_iommu_domain;
>  
>  	/* check if iommu exists and in use */
>  	if (!domain)
>  		return 0;
>  
> -	r = -EINVAL;
>  	for (i = 0; i < npages; i++) {
>  		/* check if already mapped */
>  		pfn = (pfn_t)intel_iommu_iova_to_pfn(domain,
> @@ -60,13 +59,14 @@ int kvm_iommu_map_pages(struct kvm *kvm,
>  						     DMA_PTE_READ |
>  						     DMA_PTE_WRITE);
>  			if (r) {
> -				printk(KERN_DEBUG "kvm_iommu_map_pages:"
> +				printk(KERN_ERR "kvm_iommu_map_pages:"
>  				       "iommu failed to map pfn=%lx\n",
> pfn);
>  				goto unmap_pages;
>  			}
>  		} else {
> -			printk(KERN_DEBUG "kvm_iommu_map_page:"
> -			       "invalid pfn=%lx\n", pfn);
> +			printk(KERN_DEBUG "kvm_iommu_map_pages:"
> +			       "invalid pfn=%lx, iommu needn't map "
> +			       "MMIO pages!\n", pfn);
>  			goto unmap_pages;
>  		}

If a slot has a mix of mmio and non-mmio pages, you will unmap the 
non-mmio pages, yet return no error.

-- 
error compiling committee.c: too many arguments to function


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

* RE: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 10:27 ` Avi Kivity
@ 2008-09-25 13:44   ` Han, Weidong
  2008-09-25 13:58     ` Avi Kivity
  0 siblings, 1 reply; 14+ messages in thread
From: Han, Weidong @ 2008-09-25 13:44 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Amit Shah, Kay, Allen M, benami

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 don't we need to map mmio pages?  We
> certainly don't want them emulated.

mmio pages need not to be mapped in VT-d page table, which only
translate DMA addresses. Amit's userspace patch register memslot for
mmios of assigned devices, it doesn't emulate them.

> 
>> @@ -36,14 +36,13 @@ int kvm_iommu_map_pages(struct kvm *kvm,  {
>>  	gfn_t gfn = base_gfn;
>>  	pfn_t pfn;
>> -	int i, r;
>> +	int i, r = 0;
>>  	struct dmar_domain *domain = kvm->arch.intel_iommu_domain;
>> 
>>  	/* check if iommu exists and in use */
>>  	if (!domain)
>>  		return 0;
>> 
>> -	r = -EINVAL;
>>  	for (i = 0; i < npages; i++) {
>>  		/* check if already mapped */
>>  		pfn = (pfn_t)intel_iommu_iova_to_pfn(domain,
>> @@ -60,13 +59,14 @@ int kvm_iommu_map_pages(struct kvm *kvm,

>>  						     DMA_PTE_READ |
DMA_PTE_WRITE);
>>  			if (r) {
>> -				printk(KERN_DEBUG "kvm_iommu_map_pages:"
>> +				printk(KERN_ERR "kvm_iommu_map_pages:"
>>  				       "iommu failed to map pfn=%lx\n",
>> pfn);
>>  				goto unmap_pages;
>>  			}
>>  		} else {
>> -			printk(KERN_DEBUG "kvm_iommu_map_page:"
>> -			       "invalid pfn=%lx\n", pfn);
>> +			printk(KERN_DEBUG "kvm_iommu_map_pages:"
>> +			       "invalid pfn=%lx, iommu needn't map "
>> +			       "MMIO pages!\n", pfn);
>>  			goto unmap_pages;
>>  		}
> 
> If a slot has a mix of mmio and non-mmio pages, you will unmap the
> non-mmio pages, yet return no error.
> 

I didn't consider this mix case. In this mix case, we don't goto
unmap_pages, actually we should remove else {} block. That maps non-mmio
pages while don't map mmio pages. I will resend the patch.

Randy (Weidong)

> --
> error compiling committee.c: too many arguments to function


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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 13:44   ` Han, Weidong
@ 2008-09-25 13:58     ` Avi Kivity
  2008-09-25 14:07       ` Han, Weidong
  0 siblings, 1 reply; 14+ messages in thread
From: Avi Kivity @ 2008-09-25 13:58 UTC (permalink / raw)
  To: Han, Weidong; +Cc: kvm, Amit Shah, Kay, Allen M, benami

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 will fail. 
>>>
>>>
>>>       
>> I don't understand.  Why don't we need to map mmio pages?  We
>> certainly don't want them emulated.
>>     
>
> mmio pages need not to be mapped in VT-d page table, which only
> translate DMA addresses. 

Right, I forgot the iommu is only for dma, not cpu accesses.

I suppose one could DMA into an mmio page.  Is there a reason not to map?


-- 
error compiling committee.c: too many arguments to function


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

* RE: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 13:58     ` Avi Kivity
@ 2008-09-25 14:07       ` Han, Weidong
  2008-09-25 14:45         ` Avi Kivity
  0 siblings, 1 reply; 14+ messages in thread
From: Han, Weidong @ 2008-09-25 14:07 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Amit Shah, Kay, Allen M, benami

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 will fail. 
>>>> 
>>>> 
>>>> 
>>> I don't understand.  Why don't we need to map mmio pages?  We
>>> certainly don't want them emulated.
>>> 
>> 
>> mmio pages need not to be mapped in VT-d page table, which only
>> translate DMA addresses.
> 
> Right, I forgot the iommu is only for dma, not cpu accesses.
> 
> I suppose one could DMA into an mmio page.  Is there a reason not to
> map? 

Is it possible DMA into an mmio page? If yes, we also need to map mmio
pages, and is_mmio_pfn() check is not neccessary here.

Randy (Weidong)

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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 14:07       ` Han, Weidong
@ 2008-09-25 14:45         ` Avi Kivity
  2008-09-25 15:04           ` Anthony Liguori
  2008-09-25 21:14           ` Muli Ben-Yehuda
  0 siblings, 2 replies; 14+ messages in thread
From: Avi Kivity @ 2008-09-25 14:45 UTC (permalink / raw)
  To: Han, Weidong; +Cc: kvm, Amit Shah, Kay, Allen M, benami

Han, Weidong wrote:
> Is it possible DMA into an mmio page? 

I don't see why not.

> If yes, we also need to map mmio
> pages, and is_mmio_pfn() check is not neccessary here.
>   

So we get simpler code as well.

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 14:45         ` Avi Kivity
@ 2008-09-25 15:04           ` Anthony Liguori
  2008-09-25 15:19             ` Han, Weidong
  2008-09-25 21:14           ` Muli Ben-Yehuda
  1 sibling, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2008-09-25 15:04 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Han, Weidong, kvm, Amit Shah, Kay, Allen M, benami

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 into the VT-d mapping.

Regards,

Anthony Liguori

>> If yes, we also need to map mmio
>> pages, and is_mmio_pfn() check is not neccessary here.
>>   
>
> So we get simpler code as well.
>


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

* RE: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 15:04           ` Anthony Liguori
@ 2008-09-25 15:19             ` Han, Weidong
  0 siblings, 0 replies; 14+ messages in thread
From: Han, Weidong @ 2008-09-25 15:19 UTC (permalink / raw)
  To: Anthony Liguori, Avi Kivity; +Cc: kvm, Amit Shah, Kay, Allen M, benami

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 into the VT-d mapping.
> 
> Regards,
> 
> Anthony Liguori
> 
>>> If yes, we also need to map mmio
>>> pages, and is_mmio_pfn() check is not neccessary here.
>>> 
>> 
>> So we get simpler code as well.


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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 14:45         ` Avi Kivity
  2008-09-25 15:04           ` Anthony Liguori
@ 2008-09-25 21:14           ` Muli Ben-Yehuda
  2008-09-25 21:51             ` Anthony Liguori
  1 sibling, 1 reply; 14+ messages in thread
From: Muli Ben-Yehuda @ 2008-09-25 21:14 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Amit Shah, Kay, Allen M, Ben-Ami Yassour1

On Thu, Sep 25, 2008 at 05:45:30PM +0300, Avi Kivity wrote:
> Han, Weidong wrote:
>> Is it possible DMA into an mmio page? 
>
> I don't see why not.

Two reasons. First it makes no sense. MMIO pages don't have RAM
backing them, they have another device's register window. So the
effect of DMA'ing into an MMIO page would be for one device to DMA
into the register window of another device, which sounds to me insane.

Second, and more importantly, I've seen systems where doing the above
caused a nice, immediate, reboot. So I think that unless someone comes
with a valid scenario where we need to support it or something breaks,
we'd better err on the side of caution and not map pages that should
not be DMA targets.

Cheers,
Muli
-- 
The First Workshop on I/O Virtualization (WIOV '08)
Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/
                      xxx
SYSTOR 2009---The Israeli Experimental Systems Conference
http://www.haifa.il.ibm.com/conferences/systor2009/

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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 21:14           ` Muli Ben-Yehuda
@ 2008-09-25 21:51             ` Anthony Liguori
  2008-09-26 23:57               ` Muli Ben-Yehuda
  0 siblings, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2008-09-25 21:51 UTC (permalink / raw)
  To: Muli Ben-Yehuda
  Cc: Avi Kivity, kvm, Amit Shah, Kay, Allen M, Ben-Ami Yassour1

Muli Ben-Yehuda wrote:
> On Thu, Sep 25, 2008 at 05:45:30PM +0300, Avi Kivity wrote:
>   
>> Han, Weidong wrote:
>>     
>>> Is it possible DMA into an mmio page? 
>>>       
>> I don't see why not.
>>     
>
> Two reasons. First it makes no sense. MMIO pages don't have RAM
> backing them, they have another device's register window. So the
> effect of DMA'ing into an MMIO page would be for one device to DMA
> into the register window of another device, which sounds to me insane.
>   

MMIO isn't just a register window.  It may be an on-device buffer.  For 
instance, all packets are stored in a buffer on the ne2k that's mapped 
via mmio.  It would seem entirely reasonable to me to program an IDE 
driver to DMA directly into the devices packet buffer.

> Second, and more importantly, I've seen systems where doing the above
> caused a nice, immediate, reboot. So I think that unless someone comes
> with a valid scenario where we need to support it or something breaks,
> we'd better err on the side of caution and not map pages that should
> not be DMA targets.
>   

Xen maps the MMIO pages into the VT-d table.  The system you were using 
could have just been busted.  I think the burden is to prove that this 
is illegal (via the architecture specification).

Regards,

Anthony Liguori

> Cheers,
> Muli
>   


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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-25 21:51             ` Anthony Liguori
@ 2008-09-26 23:57               ` Muli Ben-Yehuda
  2008-09-27 10:24                 ` Avi Kivity
  0 siblings, 1 reply; 14+ messages in thread
From: Muli Ben-Yehuda @ 2008-09-26 23:57 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Avi Kivity, kvm, Amit Shah, Kay, Allen M, Ben-Ami Yassour1

On Thu, Sep 25, 2008 at 04:51:24PM -0500, Anthony Liguori wrote:
> Muli Ben-Yehuda wrote:
>> On Thu, Sep 25, 2008 at 05:45:30PM +0300, Avi Kivity wrote:
>>   
>>> Han, Weidong wrote:
>>>     
>>>> Is it possible DMA into an mmio page?       
>>> I don't see why not.
>>>     
>>
>> Two reasons. First it makes no sense. MMIO pages don't have RAM
>> backing them, they have another device's register window. So the
>> effect of DMA'ing into an MMIO page would be for one device to DMA
>> into the register window of another device, which sounds to me insane.
>>   
>
> MMIO isn't just a register window.  It may be an on-device buffer.

Unlikely, but ok.

> For instance, all packets are stored in a buffer on the ne2k that's
> mapped via mmio.  It would seem entirely reasonable to me to program
> an IDE driver to DMA directly into the devices packet buffer.

It would be insane to me. Have you tried this on real hardware and
seen it work?

>> Second, and more importantly, I've seen systems where doing the
>> above caused a nice, immediate, reboot. So I think that unless
>> someone comes with a valid scenario where we need to support it or
>> something breaks, we'd better err on the side of caution and not
>> map pages that should not be DMA targets.
>>   
>
> Xen maps the MMIO pages into the VT-d table.  The system you were using 
> could have just been busted.  I think the burden is to prove that this is 
> illegal (via the architecture specification).

I strongly disagree. You are advocating something that is potentially
unsafe---for the sake of code simplicity?! I am advocating caution in
what we let an *untrusted* guest do.

Cheers,
Muli
-- 
The First Workshop on I/O Virtualization (WIOV '08)
Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/
                      xxx
SYSTOR 2009---The Israeli Experimental Systems Conference
http://www.haifa.il.ibm.com/conferences/systor2009/

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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-26 23:57               ` Muli Ben-Yehuda
@ 2008-09-27 10:24                 ` Avi Kivity
  2008-09-28  6:07                   ` Muli Ben-Yehuda
  0 siblings, 1 reply; 14+ messages in thread
From: Avi Kivity @ 2008-09-27 10:24 UTC (permalink / raw)
  To: Muli Ben-Yehuda
  Cc: Anthony Liguori, kvm, Amit Shah, Kay, Allen M, Ben-Ami Yassour1

Muli Ben-Yehuda wrote:

  

>> MMIO isn't just a register window.  It may be an on-device buffer.
>>     
>
> Unlikely, but ok.
>
>   

It's unlikely in the same ways graphics cards are unlikely :)

With a multi-card setup, perhaps it is even reasonable for one card to 
dma to another.

> I strongly disagree. You are advocating something that is potentially
> unsafe---for the sake of code simplicity?! I am advocating caution in
> what we let an *untrusted* guest do.
>   

Why would it be unsafe?

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


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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-27 10:24                 ` Avi Kivity
@ 2008-09-28  6:07                   ` Muli Ben-Yehuda
  2008-09-28  8:45                     ` Avi Kivity
  0 siblings, 1 reply; 14+ messages in thread
From: Muli Ben-Yehuda @ 2008-09-28  6:07 UTC (permalink / raw)
  To: Avi Kivity
  Cc: Anthony Liguori, kvm, Amit Shah, Kay, Allen M, Ben-Ami Yassour1

On Sat, Sep 27, 2008 at 01:24:31PM +0300, Avi Kivity wrote:

>> I strongly disagree. You are advocating something that is
>> potentially unsafe---for the sake of code simplicity?! I am
>> advocating caution in what we let an *untrusted* guest do.
>
> Why would it be unsafe?

Because on at least one machine letting a device DMA to the same
address as another device's MMIO region caused the machine to reboot.

Cheers,
Muli
-- 
The First Workshop on I/O Virtualization (WIOV '08)
Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/
                      xxx
SYSTOR 2009---The Israeli Experimental Systems Conference
http://www.haifa.il.ibm.com/conferences/systor2009/

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

* Re: [PATCH] VT-d: Fix iommu map page for mmio pages
  2008-09-28  6:07                   ` Muli Ben-Yehuda
@ 2008-09-28  8:45                     ` Avi Kivity
  0 siblings, 0 replies; 14+ messages in thread
From: Avi Kivity @ 2008-09-28  8:45 UTC (permalink / raw)
  To: Muli Ben-Yehuda
  Cc: Anthony Liguori, kvm, Amit Shah, Kay, Allen M, Ben-Ami Yassour1

Muli Ben-Yehuda wrote:
> On Sat, Sep 27, 2008 at 01:24:31PM +0300, Avi Kivity wrote:
>
>   
>>> I strongly disagree. You are advocating something that is
>>> potentially unsafe---for the sake of code simplicity?! I am
>>> advocating caution in what we let an *untrusted* guest do.
>>>       
>> Why would it be unsafe?
>>     
>
> Because on at least one machine letting a device DMA to the same
> address as another device's MMIO region caused the machine to reboot.
>   

That sounds like a hardware bug.  What does the vendor say about this?

-- 
error compiling committee.c: too many arguments to function


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

end of thread, other threads:[~2008-09-28  8:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-19  7:15 [PATCH] VT-d: Fix iommu map page for mmio pages Han, Weidong
2008-09-25 10:27 ` Avi Kivity
2008-09-25 13:44   ` Han, Weidong
2008-09-25 13:58     ` Avi Kivity
2008-09-25 14:07       ` Han, Weidong
2008-09-25 14:45         ` Avi Kivity
2008-09-25 15:04           ` Anthony Liguori
2008-09-25 15:19             ` Han, Weidong
2008-09-25 21:14           ` Muli Ben-Yehuda
2008-09-25 21:51             ` Anthony Liguori
2008-09-26 23:57               ` Muli Ben-Yehuda
2008-09-27 10:24                 ` Avi Kivity
2008-09-28  6:07                   ` Muli Ben-Yehuda
2008-09-28  8:45                     ` Avi Kivity

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