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

2008-09-28 Thread Avi Kivity
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?

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

2008-09-27 Thread Muli Ben-Yehuda
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

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

2008-09-27 Thread Avi Kivity
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 disagre

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

2008-09-26 Thread Muli Ben-Yehuda
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. Firs

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

2008-09-25 Thread Anthony Liguori
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 regis

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

2008-09-25 Thread Muli Ben-Yehuda
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 in

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 pa

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

2008-09-25 Thread Anthony Liguori
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

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

2008-09-25 Thread Avi Kivity
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 -- To unsubscribe from t

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

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

2008-09-25 Thread Avi Kivity
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.

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 und

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

2008-09-25 Thread Avi Kivity
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

[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 th