Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-16 Thread Michael S. Tsirkin
On Thu, Jun 15, 2017 at 10:31:11AM +0800, Peter Xu wrote: > On Wed, Jun 14, 2017 at 09:34:52PM +0300, Michael S. Tsirkin wrote: > > On Mon, Jun 12, 2017 at 12:04:58PM +0800, Peter Xu wrote: > > > On Mon, Jun 12, 2017 at 06:07:04AM +0300, Michael S. Tsirkin wrote: > > > > On Mon, Jun 12, 2017 at 10:

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-14 Thread Peter Xu
On Thu, Jun 15, 2017 at 10:31:11AM +0800, Peter Xu wrote: > On Wed, Jun 14, 2017 at 09:34:52PM +0300, Michael S. Tsirkin wrote: > > On Mon, Jun 12, 2017 at 12:04:58PM +0800, Peter Xu wrote: > > > On Mon, Jun 12, 2017 at 06:07:04AM +0300, Michael S. Tsirkin wrote: > > > > On Mon, Jun 12, 2017 at 10:

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-14 Thread Peter Xu
On Wed, Jun 14, 2017 at 09:34:52PM +0300, Michael S. Tsirkin wrote: > On Mon, Jun 12, 2017 at 12:04:58PM +0800, Peter Xu wrote: > > On Mon, Jun 12, 2017 at 06:07:04AM +0300, Michael S. Tsirkin wrote: > > > On Mon, Jun 12, 2017 at 10:34:43AM +0800, Peter Xu wrote: > > > > On Sun, Jun 11, 2017 at 08:

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-14 Thread Michael S. Tsirkin
On Mon, Jun 12, 2017 at 12:04:58PM +0800, Peter Xu wrote: > On Mon, Jun 12, 2017 at 06:07:04AM +0300, Michael S. Tsirkin wrote: > > On Mon, Jun 12, 2017 at 10:34:43AM +0800, Peter Xu wrote: > > > On Sun, Jun 11, 2017 at 08:10:15PM +0800, David Gibson wrote: > > > > On Sun, Jun 11, 2017 at 01:09:26P

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-11 Thread Peter Xu
On Mon, Jun 12, 2017 at 06:07:04AM +0300, Michael S. Tsirkin wrote: > On Mon, Jun 12, 2017 at 10:34:43AM +0800, Peter Xu wrote: > > On Sun, Jun 11, 2017 at 08:10:15PM +0800, David Gibson wrote: > > > On Sun, Jun 11, 2017 at 01:09:26PM +0300, Michael S. Tsirkin wrote: > > > > On Fri, Jun 09, 2017 at

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-11 Thread Michael S. Tsirkin
On Mon, Jun 12, 2017 at 10:34:43AM +0800, Peter Xu wrote: > On Sun, Jun 11, 2017 at 08:10:15PM +0800, David Gibson wrote: > > On Sun, Jun 11, 2017 at 01:09:26PM +0300, Michael S. Tsirkin wrote: > > > On Fri, Jun 09, 2017 at 09:58:47AM +0800, Peter Xu wrote: > > > > > > The problem is that when I wa

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-11 Thread Peter Xu
On Sun, Jun 11, 2017 at 08:10:15PM +0800, David Gibson wrote: > On Sun, Jun 11, 2017 at 01:09:26PM +0300, Michael S. Tsirkin wrote: > > On Fri, Jun 09, 2017 at 09:58:47AM +0800, Peter Xu wrote: > > > > > The problem is that when I was fixing the problem that vhost had with > > > > > PT (a764040, "e

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-11 Thread David Gibson
On Sun, Jun 11, 2017 at 01:09:26PM +0300, Michael S. Tsirkin wrote: > On Fri, Jun 09, 2017 at 09:58:47AM +0800, Peter Xu wrote: > > > > The problem is that when I was fixing the problem that vhost had with > > > > PT (a764040, "exec: abstract address_space_do_translate()"), I did > > > > broke the

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-11 Thread Michael S. Tsirkin
On Fri, Jun 09, 2017 at 09:58:47AM +0800, Peter Xu wrote: > > > The problem is that when I was fixing the problem that vhost had with > > > PT (a764040, "exec: abstract address_space_do_translate()"), I did > > > broke the IOTLB translation a bit (it was using page masks). IMHO we > > > need to fix

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-08 Thread David Gibson
On Fri, Jun 09, 2017 at 09:58:47AM +0800, Peter Xu wrote: > On Thu, Jun 08, 2017 at 09:59:50PM +0300, Michael S. Tsirkin wrote: > > On Thu, Jun 08, 2017 at 02:11:50PM +0800, Peter Xu wrote: > > > On Wed, Jun 07, 2017 at 04:07:20PM +0300, Michael S. Tsirkin wrote: > > > > On Wed, Jun 07, 2017 at 11:

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-08 Thread Peter Xu
On Thu, Jun 08, 2017 at 09:59:50PM +0300, Michael S. Tsirkin wrote: > On Thu, Jun 08, 2017 at 02:11:50PM +0800, Peter Xu wrote: > > On Wed, Jun 07, 2017 at 04:07:20PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Jun 07, 2017 at 11:44:43AM +0800, Peter Xu wrote: > > > > On Wed, Jun 07, 2017 at 09:

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-08 Thread Michael S. Tsirkin
On Thu, Jun 08, 2017 at 02:11:50PM +0800, Peter Xu wrote: > On Wed, Jun 07, 2017 at 04:07:20PM +0300, Michael S. Tsirkin wrote: > > On Wed, Jun 07, 2017 at 11:44:43AM +0800, Peter Xu wrote: > > > On Wed, Jun 07, 2017 at 09:47:05AM +1000, David Gibson wrote: > > > > On Tue, Jun 06, 2017 at 04:34:30P

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-07 Thread Peter Xu
On Wed, Jun 07, 2017 at 04:07:20PM +0300, Michael S. Tsirkin wrote: > On Wed, Jun 07, 2017 at 11:44:43AM +0800, Peter Xu wrote: > > On Wed, Jun 07, 2017 at 09:47:05AM +1000, David Gibson wrote: > > > On Tue, Jun 06, 2017 at 04:34:30PM +0200, Paolo Bonzini wrote: > > > > > > > > > > > > On 05/06/2

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-07 Thread Michael S. Tsirkin
On Wed, Jun 07, 2017 at 11:44:43AM +0800, Peter Xu wrote: > On Wed, Jun 07, 2017 at 09:47:05AM +1000, David Gibson wrote: > > On Tue, Jun 06, 2017 at 04:34:30PM +0200, Paolo Bonzini wrote: > > > > > > > > > On 05/06/2017 05:07, Peter Xu wrote: > > > > I don't sure whether it'll be a good interfac

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-07 Thread Paolo Bonzini
On 07/06/2017 01:47, David Gibson wrote: >> I would ask David. There are PowerPC MMUs that allow fast lookup of >> arbitrarily-sized windows (not necessarily power of two), > > Uh.. I'm not sure what you mean here. You might be thinking of the > BATs which really old (32-bit) PowerPC MMUs had -

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-06 Thread Peter Xu
On Wed, Jun 07, 2017 at 09:47:05AM +1000, David Gibson wrote: > On Tue, Jun 06, 2017 at 04:34:30PM +0200, Paolo Bonzini wrote: > > > > > > On 05/06/2017 05:07, Peter Xu wrote: > > > I don't sure whether it'll be a good interface for IOTLB. AFAIU at > > > least for VT-d, the IOMMU translation is p

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-06 Thread David Gibson
On Tue, Jun 06, 2017 at 04:34:30PM +0200, Paolo Bonzini wrote: > > > On 05/06/2017 05:07, Peter Xu wrote: > > I don't sure whether it'll be a good interface for IOTLB. AFAIU at > > least for VT-d, the IOMMU translation is page aligned which is defined > > by spec, so it makes sense that (again at

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-06 Thread Paolo Bonzini
On 05/06/2017 05:07, Peter Xu wrote: > I don't sure whether it'll be a good interface for IOTLB. AFAIU at > least for VT-d, the IOMMU translation is page aligned which is defined > by spec, so it makes sense that (again at least for VT-d) here we'd > better just use page_mask/addr_mask. > > That

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-04 Thread Peter Xu
On Fri, Jun 02, 2017 at 07:49:58PM +0300, Michael S. Tsirkin wrote: > On Fri, Jun 02, 2017 at 07:50:53PM +0800, Peter Xu wrote: > > This patch let address_space_get_iotlb_entry() to use the newly > > introduced page_mask parameter in address_space_do_translate(). Then we > > will be sure the IOTLB

Re: [Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-02 Thread Michael S. Tsirkin
On Fri, Jun 02, 2017 at 07:50:53PM +0800, Peter Xu wrote: > This patch let address_space_get_iotlb_entry() to use the newly > introduced page_mask parameter in address_space_do_translate(). Then we > will be sure the IOTLB can be aligned to page mask, also we should > nicely support huge pages now

[Qemu-devel] [PATCH 2/3] exec: simplify address_space_get_iotlb_entry

2017-06-02 Thread Peter Xu
This patch let address_space_get_iotlb_entry() to use the newly introduced page_mask parameter in address_space_do_translate(). Then we will be sure the IOTLB can be aligned to page mask, also we should nicely support huge pages now when introducing a764040. Fixes: a764040 ("exec: abstract address