Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2018-01-15 Thread David Gibson
On Fri, Jan 12, 2018 at 06:25:34PM +0800, Liu, Yi L wrote: > On Wed, Dec 20, 2017 at 10:18:16PM +1100, David Gibson wrote: > > On Wed, Dec 20, 2017 at 02:47:30PM +0800, Liu, Yi L wrote: > > > On Mon, Dec 18, 2017 at 10:35:31PM +1100, David Gibson wrote: > > > > On Wed, Nov 15, 2017 at 03:16:32PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2018-01-12 Thread Liu, Yi L
On Wed, Dec 20, 2017 at 10:18:16PM +1100, David Gibson wrote: > On Wed, Dec 20, 2017 at 02:47:30PM +0800, Liu, Yi L wrote: > > On Mon, Dec 18, 2017 at 10:35:31PM +1100, David Gibson wrote: > > > On Wed, Nov 15, 2017 at 03:16:32PM +0800, Peter Xu wrote: > > > > On Tue, Nov 14, 2017 at 10:52:54PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2018-01-04 Thread Liu, Yi L
On Wed, Jan 03, 2018 at 11:28:17AM +1100, David Gibson wrote: > On Thu, Dec 21, 2017 at 04:40:19PM +0800, Liu, Yi L wrote: > > On Wed, Dec 20, 2017 at 10:18:16PM +1100, David Gibson wrote: > > > On Wed, Dec 20, 2017 at 02:47:30PM +0800, Liu, Yi L wrote: > > > > On Mon, Dec 18, 2017 at 10:35:31PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2018-01-02 Thread David Gibson
On Thu, Dec 21, 2017 at 04:40:19PM +0800, Liu, Yi L wrote: > On Wed, Dec 20, 2017 at 10:18:16PM +1100, David Gibson wrote: > > On Wed, Dec 20, 2017 at 02:47:30PM +0800, Liu, Yi L wrote: > > > On Mon, Dec 18, 2017 at 10:35:31PM +1100, David Gibson wrote: > > > > On Wed, Nov 15, 2017 at 03:16:32PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-21 Thread Liu, Yi L
On Wed, Dec 20, 2017 at 10:01:10PM +1100, David Gibson wrote: > On Wed, Dec 20, 2017 at 02:32:42PM +0800, Liu, Yi L wrote: > > On Mon, Dec 18, 2017 at 10:22:18PM +1100, David Gibson wrote: > > > On Mon, Dec 18, 2017 at 05:17:35PM +0800, Liu, Yi L wrote: > > > > On Mon, Dec 18, 2017 at 05:14:42PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-21 Thread Liu, Yi L
On Wed, Dec 20, 2017 at 10:18:16PM +1100, David Gibson wrote: > On Wed, Dec 20, 2017 at 02:47:30PM +0800, Liu, Yi L wrote: > > On Mon, Dec 18, 2017 at 10:35:31PM +1100, David Gibson wrote: > > > On Wed, Nov 15, 2017 at 03:16:32PM +0800, Peter Xu wrote: > > > > On Tue, Nov 14, 2017 at 10:52:54PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-20 Thread David Gibson
On Wed, Dec 20, 2017 at 02:47:30PM +0800, Liu, Yi L wrote: > On Mon, Dec 18, 2017 at 10:35:31PM +1100, David Gibson wrote: > > On Wed, Nov 15, 2017 at 03:16:32PM +0800, Peter Xu wrote: > > > On Tue, Nov 14, 2017 at 10:52:54PM +0100, Auger Eric wrote: > > > > > > [...] > > > > > > > I meant, in

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-20 Thread David Gibson
On Wed, Dec 20, 2017 at 02:32:42PM +0800, Liu, Yi L wrote: > On Mon, Dec 18, 2017 at 10:22:18PM +1100, David Gibson wrote: > > On Mon, Dec 18, 2017 at 05:17:35PM +0800, Liu, Yi L wrote: > > > On Mon, Dec 18, 2017 at 05:14:42PM +1100, David Gibson wrote: > > > > On Thu, Nov 16, 2017 at 04:57:09PM

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-19 Thread Liu, Yi L
On Mon, Dec 18, 2017 at 10:35:31PM +1100, David Gibson wrote: > On Wed, Nov 15, 2017 at 03:16:32PM +0800, Peter Xu wrote: > > On Tue, Nov 14, 2017 at 10:52:54PM +0100, Auger Eric wrote: > > > > [...] > > > > > I meant, in the current intel_iommu code, vtd_find_add_as() creates 1 > > > IOMMU MR

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-19 Thread Liu, Yi L
On Mon, Dec 18, 2017 at 10:22:18PM +1100, David Gibson wrote: > On Mon, Dec 18, 2017 at 05:17:35PM +0800, Liu, Yi L wrote: > > On Mon, Dec 18, 2017 at 05:14:42PM +1100, David Gibson wrote: > > > On Thu, Nov 16, 2017 at 04:57:09PM +0800, Liu, Yi L wrote: > > > > Hi David, > > > > > > > > On Tue,

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-18 Thread David Gibson
On Wed, Nov 15, 2017 at 03:16:32PM +0800, Peter Xu wrote: > On Tue, Nov 14, 2017 at 10:52:54PM +0100, Auger Eric wrote: > > [...] > > > I meant, in the current intel_iommu code, vtd_find_add_as() creates 1 > > IOMMU MR and 1 AS per PCIe device, right? > > I think this is the most tricky point -

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-18 Thread David Gibson
On Mon, Dec 18, 2017 at 05:17:35PM +0800, Liu, Yi L wrote: > On Mon, Dec 18, 2017 at 05:14:42PM +1100, David Gibson wrote: > > On Thu, Nov 16, 2017 at 04:57:09PM +0800, Liu, Yi L wrote: > > > Hi David, > > > > > > On Tue, Nov 14, 2017 at 11:59:34AM +1100, David Gibson wrote: > > > > On Mon, Nov

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-18 Thread David Gibson
On Tue, Nov 14, 2017 at 11:21:59AM +0100, Auger Eric wrote: > Hi Yi L, > > On 03/11/2017 13:01, Liu, Yi L wrote: > > From: Peter Xu > > > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > > spaces to store arch-specific hooks. > > > > The first hook I

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-18 Thread Liu, Yi L
On Mon, Dec 18, 2017 at 05:14:42PM +1100, David Gibson wrote: > On Thu, Nov 16, 2017 at 04:57:09PM +0800, Liu, Yi L wrote: > > Hi David, > > > > On Tue, Nov 14, 2017 at 11:59:34AM +1100, David Gibson wrote: > > > On Mon, Nov 13, 2017 at 04:28:45PM +0800, Peter Xu wrote: > > > > On Mon, Nov 13,

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-17 Thread David Gibson
On Thu, Nov 16, 2017 at 04:57:09PM +0800, Liu, Yi L wrote: > Hi David, > > On Tue, Nov 14, 2017 at 11:59:34AM +1100, David Gibson wrote: > > On Mon, Nov 13, 2017 at 04:28:45PM +0800, Peter Xu wrote: > > > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > > > > On Fri, Nov 03, 2017

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-17 Thread David Gibson
Sorry I've taken so long to reply, I've been super busy with other things. On Tue, Nov 14, 2017 at 11:31:00AM +0800, Peter Xu wrote: > On Tue, Nov 14, 2017 at 11:59:34AM +1100, David Gibson wrote: > > On Mon, Nov 13, 2017 at 04:28:45PM +0800, Peter Xu wrote: > > > On Mon, Nov 13, 2017 at

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-12-17 Thread David Gibson
On Tue, Nov 14, 2017 at 09:53:07AM +0100, Auger Eric wrote: > Hi Yi L, > > On 13/11/2017 10:58, Liu, Yi L wrote: > > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > >> On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > >>> From: Peter Xu > >>> > >>>

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-16 Thread Liu, Yi L
Hi David, On Tue, Nov 14, 2017 at 11:59:34AM +1100, David Gibson wrote: > On Mon, Nov 13, 2017 at 04:28:45PM +0800, Peter Xu wrote: > > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > > > On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > > > > From: Peter Xu

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Peter Xu
On Tue, Nov 14, 2017 at 10:52:54PM +0100, Auger Eric wrote: [...] > I meant, in the current intel_iommu code, vtd_find_add_as() creates 1 > IOMMU MR and 1 AS per PCIe device, right? I think this is the most tricky point - in QEMU IOMMU MR is not really a 1:1 relationship to devices. For Intel,

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Liu, Yi L
Hi Eric, On Tue, Nov 14, 2017 at 10:52:54PM +0100, Auger Eric wrote: > Hi Yi L, > > On 14/11/2017 14:59, Liu, Yi L wrote: > > On Tue, Nov 14, 2017 at 09:53:07AM +0100, Auger Eric wrote: > > Hi Eric, > > > >> Hi Yi L, > >> > >> On 13/11/2017 10:58, Liu, Yi L wrote: > >>> On Mon, Nov 13, 2017 at

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Auger Eric
Hi Yi L, On 14/11/2017 14:59, Liu, Yi L wrote: > On Tue, Nov 14, 2017 at 09:53:07AM +0100, Auger Eric wrote: > Hi Eric, > >> Hi Yi L, >> >> On 13/11/2017 10:58, Liu, Yi L wrote: >>> On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu,

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Liu, Yi L
Hi Eric, On Tue, Nov 14, 2017 at 11:21:59AM +0100, Auger Eric wrote: > Hi Yi L, > > On 03/11/2017 13:01, Liu, Yi L wrote: > > From: Peter Xu > > > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > > spaces to store arch-specific hooks. > > > > The

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Liu, Yi L
On Tue, Nov 14, 2017 at 09:53:07AM +0100, Auger Eric wrote: Hi Eric, > Hi Yi L, > > On 13/11/2017 10:58, Liu, Yi L wrote: > > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > >> On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > >>> From: Peter Xu >

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Auger Eric
Hi Yi L, On 03/11/2017 13:01, Liu, Yi L wrote: > From: Peter Xu > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > spaces to store arch-specific hooks. > > The first hook I would like to introduce is iommu_get(). Return an > IOMMUObject behind the

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-14 Thread Auger Eric
Hi Yi L, On 13/11/2017 10:58, Liu, Yi L wrote: > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: >> On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: >>> From: Peter Xu >>> >>> AddressSpaceOps is similar to MemoryRegionOps, it's just for address >>>

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-13 Thread Peter Xu
On Tue, Nov 14, 2017 at 11:59:34AM +1100, David Gibson wrote: > On Mon, Nov 13, 2017 at 04:28:45PM +0800, Peter Xu wrote: > > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > > > On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > > > > From: Peter Xu >

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-13 Thread David Gibson
On Mon, Nov 13, 2017 at 04:28:45PM +0800, Peter Xu wrote: > On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > > On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > > > From: Peter Xu > > > > > > AddressSpaceOps is similar to MemoryRegionOps, it's just

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-13 Thread Liu, Yi L
On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > > From: Peter Xu > > > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > > spaces to store arch-specific hooks. > > > > The

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-13 Thread Peter Xu
On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > > From: Peter Xu > > > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > > spaces to store arch-specific hooks. > > > > The

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-12 Thread David Gibson
On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > From: Peter Xu > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > spaces to store arch-specific hooks. > > The first hook I would like to introduce is iommu_get(). Return an > IOMMUObject