Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-21 Thread David Gibson
On Wed, Dec 21, 2016 at 06:05:49PM +0800, Peter Xu wrote: > On Wed, Dec 21, 2016 at 01:53:37PM +1100, David Gibson wrote: > > [...] > > > > Could you explain why here device address space has things to do with > > > PCI BARs? I thought BARs are for CPU address space only (so that CPU > > > can ac

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-21 Thread Peter Xu
On Wed, Dec 21, 2016 at 01:53:37PM +1100, David Gibson wrote: [...] > > Could you explain why here device address space has things to do with > > PCI BARs? I thought BARs are for CPU address space only (so that CPU > > can access PCI registers via MMIO manner), am I wrong? > > In short, yes. So

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread David Gibson
On Tue, Dec 20, 2016 at 05:04:33PM -0700, Alex Williamson wrote: > On Tue, 20 Dec 2016 14:38:01 +0800 > Peter Xu wrote: > > > On Mon, Dec 19, 2016 at 09:52:52PM -0700, Alex Williamson wrote: > > > > [...] > > > > > > Yes, this patch just tried to move VT-d forward a bit, rather than do > > > >

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread David Gibson
On Mon, Dec 19, 2016 at 09:52:52PM -0700, Alex Williamson wrote: > On Tue, 20 Dec 2016 11:44:41 +0800 > Peter Xu wrote: > > > On Mon, Dec 19, 2016 at 09:56:50AM -0700, Alex Williamson wrote: > > > On Mon, 19 Dec 2016 22:41:26 +0800 > > > Peter Xu wrote: > > > > > > > This is preparation work

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread David Gibson
On Tue, Dec 20, 2016 at 12:16:50PM +0800, Peter Xu wrote: > On Tue, Dec 20, 2016 at 10:30:12AM +1100, David Gibson wrote: > > [...] > > > > +static void vtd_switch_address_space(IntelIOMMUState *s, bool enabled) > > > +{ > > > +GHashTableIter iter; > > > +VTDBus *vtd_bus; > > > +VTDAd

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread Peter Xu
On Tue, Dec 20, 2016 at 03:57:59PM -0800, no-re...@patchew.org wrote: [...] > /tmp/qemu-test/src/hw/i386/intel_iommu.c: In function > ‘vtd_switch_address_space’: > /tmp/qemu-test/src/hw/i386/intel_iommu.c:1196: warning: implicit declaration > of function ‘trace_vtd_switch_address_space’ > /tmp/

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread Peter Xu
On Tue, Dec 20, 2016 at 03:02:54PM -0800, no-re...@patchew.org wrote: [...] > === OUTPUT BEGIN === > Checking PATCH 1/1: intel_iommu: allow dynamic switch of IOMMU region... > ERROR: "(foo**)" should be "(foo **)" > #55: FILE: hw/i386/intel_iommu.c:1190: > +while (g_hash_table_iter_next (&ite

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread Peter Xu
On Tue, Dec 20, 2016 at 05:04:33PM -0700, Alex Williamson wrote: > On Tue, 20 Dec 2016 14:38:01 +0800 > Peter Xu wrote: > > > On Mon, Dec 19, 2016 at 09:52:52PM -0700, Alex Williamson wrote: > > > > [...] > > > > > > Yes, this patch just tried to move VT-d forward a bit, rather than do > > > >

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread Alex Williamson
On Tue, 20 Dec 2016 14:38:01 +0800 Peter Xu wrote: > On Mon, Dec 19, 2016 at 09:52:52PM -0700, Alex Williamson wrote: > > [...] > > > > Yes, this patch just tried to move VT-d forward a bit, rather than do > > > it once and for all. I think we can do better than this in the future, > > > for ex

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread no-reply
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Type: series Message-id: 1482158486-18597-1-git-send-email-pet...@redhat.com Subject: [Qemu-devel] [PATCH] intel_iommu: allow

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-20 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region Message-id: 1482158486-18597-1-git-send-email-pet...@redhat.com Type: series === TEST SCRIPT BEGIN === #!/bin/bash

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread Peter Xu
On Mon, Dec 19, 2016 at 09:52:52PM -0700, Alex Williamson wrote: [...] > > Yes, this patch just tried to move VT-d forward a bit, rather than do > > it once and for all. I think we can do better than this in the future, > > for example, one address space per guest IOMMU domain (as you have > > me

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread Alex Williamson
On Tue, 20 Dec 2016 11:44:41 +0800 Peter Xu wrote: > On Mon, Dec 19, 2016 at 09:56:50AM -0700, Alex Williamson wrote: > > On Mon, 19 Dec 2016 22:41:26 +0800 > > Peter Xu wrote: > > > > > This is preparation work to finally enabled dynamic switching ON/OFF for > > > VT-d protection. The old VT

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread Peter Xu
On Tue, Dec 20, 2016 at 10:30:12AM +1100, David Gibson wrote: [...] > > +static void vtd_switch_address_space(IntelIOMMUState *s, bool enabled) > > +{ > > +GHashTableIter iter; > > +VTDBus *vtd_bus; > > +VTDAddressSpace *as; > > +int i; > > + > > +g_hash_table_iter_init(&iter,

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread Peter Xu
On Mon, Dec 19, 2016 at 09:56:50AM -0700, Alex Williamson wrote: > On Mon, 19 Dec 2016 22:41:26 +0800 > Peter Xu wrote: > > > This is preparation work to finally enabled dynamic switching ON/OFF for > > VT-d protection. The old VT-d codes is using static IOMMU region, and > > that won't satisfy v

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread David Gibson
On Mon, Dec 19, 2016 at 10:41:26PM +0800, Peter Xu wrote: > This is preparation work to finally enabled dynamic switching ON/OFF for > VT-d protection. The old VT-d codes is using static IOMMU region, and > that won't satisfy vfio-pci device listeners. > > Let me explain. > > vfio-pci devices dep

Re: [Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread Alex Williamson
On Mon, 19 Dec 2016 22:41:26 +0800 Peter Xu wrote: > This is preparation work to finally enabled dynamic switching ON/OFF for > VT-d protection. The old VT-d codes is using static IOMMU region, and > that won't satisfy vfio-pci device listeners. > > Let me explain. > > vfio-pci devices depend o

[Qemu-devel] [PATCH] intel_iommu: allow dynamic switch of IOMMU region

2016-12-19 Thread Peter Xu
This is preparation work to finally enabled dynamic switching ON/OFF for VT-d protection. The old VT-d codes is using static IOMMU region, and that won't satisfy vfio-pci device listeners. Let me explain. vfio-pci devices depend on the memory region listener and IOMMU replay mechanism to make sur