Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-05-02 Thread Peter Xu
On Mon, Apr 30, 2018 at 09:20:42AM +0200, Paolo Bonzini wrote: > On 28/04/2018 04:24, Peter Xu wrote: > 2) Can we just reuse qemu BQL here? > >>> I would prefer not. As I mentioned, at least I have spent too much > >>> time on fighting BQL already. I really hope we can start to use > >>> iso

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-30 Thread Paolo Bonzini
On 28/04/2018 05:14, Peter Xu wrote: >> # git grep imrc-\>translate\ = >> hw/alpha/typhoon.c:    imrc->translate = typhoon_translate_iommu; >> hw/dma/rc4030.c:    imrc->translate = rc4030_dma_translate; >> hw/i386/amd_iommu.c:    imrc->translate = amdvi_translate; >> hw/i386/intel_iommu.c:    imrc-

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-30 Thread Paolo Bonzini
On 28/04/2018 04:24, Peter Xu wrote: 2) Can we just reuse qemu BQL here? >>> I would prefer not. As I mentioned, at least I have spent too much >>> time on fighting BQL already. I really hope we can start to use >>> isolated locks when capable. BQL is always the worst choice to me. >> Just

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Jason Wang
On 2018年04月28日 11:14, Peter Xu wrote: On Sat, Apr 28, 2018 at 10:42:11AM +0800, Jason Wang wrote: [...] Well, it's not about BQL specifically, it's about whether we have or need a generic thread safety solution for all IOMMUs. We have more IOMMUs than just AMD, s390 and ppc: # git grep imr

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Peter Xu
On Sat, Apr 28, 2018 at 10:42:11AM +0800, Jason Wang wrote: [...] > Well, it's not about BQL specifically, it's about whether we have or need a > generic thread safety solution for all IOMMUs. > > We have more IOMMUs than just AMD, s390 and ppc: > > # git grep imrc-\>translate\ = > hw/alpha/typ

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Jason Wang
On 2018年04月28日 11:06, Peter Xu wrote: On Sat, Apr 28, 2018 at 10:42:11AM +0800, Jason Wang wrote: On 2018年04月28日 10:24, Peter Xu wrote: On Sat, Apr 28, 2018 at 09:43:54AM +0800, Jason Wang wrote: On 2018年04月27日 14:26, Peter Xu wrote: On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wro

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Peter Xu
On Sat, Apr 28, 2018 at 10:42:11AM +0800, Jason Wang wrote: > > > On 2018年04月28日 10:24, Peter Xu wrote: > > On Sat, Apr 28, 2018 at 09:43:54AM +0800, Jason Wang wrote: > > > > > > On 2018年04月27日 14:26, Peter Xu wrote: > > > > On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: > > > > >

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Jason Wang
On 2018年04月28日 10:24, Peter Xu wrote: On Sat, Apr 28, 2018 at 09:43:54AM +0800, Jason Wang wrote: On 2018年04月27日 14:26, Peter Xu wrote: On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: On 2018年04月25日 12:51, Peter Xu wrote: Add a per-iommu big lock to protect IOMMU status. Curre

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Peter Xu
On Sat, Apr 28, 2018 at 09:43:54AM +0800, Jason Wang wrote: > > > On 2018年04月27日 14:26, Peter Xu wrote: > > On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: > > > > > > On 2018年04月25日 12:51, Peter Xu wrote: > > > > Add a per-iommu big lock to protect IOMMU status. Currently the only

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Tian, Kevin
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, April 27, 2018 5:54 PM > > On Fri, Apr 27, 2018 at 07:19:25AM +, Tian, Kevin wrote: > > > From: Peter Xu > > > Sent: Friday, April 27, 2018 2:26 PM > > > > > > On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: > > > > > > >

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Jason Wang
On 2018年04月27日 14:26, Peter Xu wrote: On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: On 2018年04月25日 12:51, Peter Xu wrote: Add a per-iommu big lock to protect IOMMU status. Currently the only thing to be protected is the IOTLB cache, since that can be accessed even without BQL,

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Peter Xu
On Fri, Apr 27, 2018 at 07:19:25AM +, Tian, Kevin wrote: > > From: Peter Xu > > Sent: Friday, April 27, 2018 2:26 PM > > > > On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: > > > > > > > > > On 2018年04月25日 12:51, Peter Xu wrote: > > > > Add a per-iommu big lock to protect IOMMU sta

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-27 Thread Tian, Kevin
> From: Peter Xu > Sent: Friday, April 27, 2018 2:26 PM > > On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: > > > > > > On 2018年04月25日 12:51, Peter Xu wrote: > > > Add a per-iommu big lock to protect IOMMU status. Currently the only > > > thing to be protected is the IOTLB cache, sinc

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-26 Thread Peter Xu
On Fri, Apr 27, 2018 at 01:13:02PM +0800, Jason Wang wrote: > > > On 2018年04月25日 12:51, Peter Xu wrote: > > Add a per-iommu big lock to protect IOMMU status. Currently the only > > thing to be protected is the IOTLB cache, since that can be accessed > > even without BQL, e.g., in IO dataplane. >

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-26 Thread Jason Wang
On 2018年04月25日 12:51, Peter Xu wrote: Add a per-iommu big lock to protect IOMMU status. Currently the only thing to be protected is the IOTLB cache, since that can be accessed even without BQL, e.g., in IO dataplane. Note that device page tables should not need any protection. The safety of

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-25 Thread Peter Xu
On Wed, Apr 25, 2018 at 12:26:58PM -0400, Emilio G. Cota wrote: > On Wed, Apr 25, 2018 at 12:51:22 +0800, Peter Xu wrote: > > Add a per-iommu big lock to protect IOMMU status. Currently the only > > thing to be protected is the IOTLB cache, since that can be accessed > > even without BQL, e.g., in

Re: [Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-25 Thread Emilio G. Cota
On Wed, Apr 25, 2018 at 12:51:22 +0800, Peter Xu wrote: > Add a per-iommu big lock to protect IOMMU status. Currently the only > thing to be protected is the IOTLB cache, since that can be accessed > even without BQL, e.g., in IO dataplane. Is the added lock going to protect anything else beyond

[Qemu-devel] [PATCH 03/10] intel-iommu: add iommu lock

2018-04-24 Thread Peter Xu
Add a per-iommu big lock to protect IOMMU status. Currently the only thing to be protected is the IOTLB cache, since that can be accessed even without BQL, e.g., in IO dataplane. Note that device page tables should not need any protection. The safety of that should be provided by guest OS. E.g.