Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-07-06 Thread Paolo Bonzini
On 04/07/2015 03:12, Alexey Kardashevskiy wrote: One step back :) Whole dance is what here? There are: 1) del+set_size(0) 2) set_size(not zero)+add Then no need for begin/commit. :) I got a new problem here - set_size(0) + set_size(not 0) do not invoke region_del/region_add which does

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-07-05 Thread Alexey Kardashevskiy
On 07/04/2015 11:12 AM, Alexey Kardashevskiy wrote: On 05/27/2015 05:05 PM, Paolo Bonzini wrote: On 27/05/2015 01:55, Alexey Kardashevskiy wrote: One step back :) Whole dance is what here? There are: 1) del+set_size(0) 2) set_size(not zero)+add Then no need for begin/commit. :) I got a

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-07-03 Thread Alexey Kardashevskiy
On 05/27/2015 05:05 PM, Paolo Bonzini wrote: On 27/05/2015 01:55, Alexey Kardashevskiy wrote: One step back :) Whole dance is what here? There are: 1) del+set_size(0) 2) set_size(not zero)+add Then no need for begin/commit. :) I got a new problem here - set_size(0) + set_size(not 0) do

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-27 Thread Paolo Bonzini
On 27/05/2015 01:55, Alexey Kardashevskiy wrote: One step back :) Whole dance is what here? There are: 1) del+set_size(0) 2) set_size(not zero)+add Then no need for begin/commit. :) Paolo

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/27/2015 01:51 AM, Paolo Bonzini wrote: On 26/05/2015 17:49, Alexey Kardashevskiy wrote: It's very little used, but that's just because it's not too common. There's nothing wrong with it. :) If you do del/set_size/add, you may want to put a memory_region_transaction_{begin,commit}

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread David Gibson
On Tue, May 26, 2015 at 10:58:02AM +0200, Paolo Bonzini wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 26/05/2015 04:46, David Gibson wrote: On Tue, May 26, 2015 at 01:05:56AM +1000, Alexey Kardashevskiy wrote: Hi Paolo, I have had a conversation with Mike and it

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexander Graf
On 26.05.15 10:58, Paolo Bonzini wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 26/05/2015 04:46, David Gibson wrote: On Tue, May 26, 2015 at 01:05:56AM +1000, Alexey Kardashevskiy wrote: Hi Paolo, I have had a conversation with Mike and it turns out I am not allowed

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 26/05/2015 04:46, David Gibson wrote: On Tue, May 26, 2015 at 01:05:56AM +1000, Alexey Kardashevskiy wrote: Hi Paolo, I have had a conversation with Mike and it turns out I am not allowed to create/remove memory regions dynamically

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 11:01, Alexander Graf wrote: So, the sentences after that one note an exception for alias and container regions. I think iommu regions should behave similarly - in a sense they're just a procedurally generated collection of alias regions. The difference is that

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 12:15, Alexey Kardashevskiy wrote: There was a [RFC PATCH 00/15] spapr: add support for PHB hotplug patchset from Mike, this patch added unrealize for spapr_phb: [RFC PATCH 05/15] spapr_pci: add PHB unrealize I believe I am dealing with the fixed version of this patch so

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/26/2015 06:58 PM, Paolo Bonzini wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 26/05/2015 04:46, David Gibson wrote: On Tue, May 26, 2015 at 01:05:56AM +1000, Alexey Kardashevskiy wrote: Hi Paolo, I have had a conversation with Mike and it turns out I am not allowed to

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 14:33, Alexey Kardashevskiy wrote: If it's not true now that they can be unparented at any time like alias regions, we should probably try to make it true. Unfortunately it's not so easy... Uff. Tricky :) memory_region_del_subregion() is not unparenting but just a

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/26/2015 08:16 PM, Paolo Bonzini wrote: On 26/05/2015 12:15, Alexey Kardashevskiy wrote: There was a [RFC PATCH 00/15] spapr: add support for PHB hotplug patchset from Mike, this patch added unrealize for spapr_phb: [RFC PATCH 05/15] spapr_pci: add PHB unrealize I believe I am dealing

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/26/2015 10:50 PM, Paolo Bonzini wrote: On 26/05/2015 14:33, Alexey Kardashevskiy wrote: If it's not true now that they can be unparented at any time like alias regions, we should probably try to make it true. Unfortunately it's not so easy... Uff. Tricky :)

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 15:28, Alexey Kardashevskiy wrote: My initial concern was if I can or cannot do: memory_region_init_iommu + memory_region_add_subregion and memory_region_del_subregion + object_unref outside of init/realize/unrealize/finalize. You said I cannot do unparenting but as I

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/27/2015 01:08 AM, Paolo Bonzini wrote: On 26/05/2015 17:00, Alexey Kardashevskiy wrote: Why do you need different regions? Why can't you have always the same IOMMU regions, and either: They may change a size. That's not a problem, there's memory_region_set_size for that. It was

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/27/2015 12:58 AM, Paolo Bonzini wrote: On 26/05/2015 16:55, Michael Roth wrote: That's not a problem, there's memory_region_set_size for that. What on earth, I could've sworn I looked for this... yes I think that would solve the issue here. mr_add/mr_del can handle the change in

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 17:49, Alexey Kardashevskiy wrote: It's very little used, but that's just because it's not too common. There's nothing wrong with it. :) If you do del/set_size/add, you may want to put a memory_region_transaction_{begin,commit} around the whole dance. Here I lost you

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy wrote: The next patch of this patchset changes: spapr_tce_table_do_enable() memory_region_init_iommu(iommu) memory_region_add_subregion(root, iommu) spapr_tce_table_disable()

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/27/2015 12:03 AM, Paolo Bonzini wrote: On 26/05/2015 16:00, Alexey Kardashevskiy wrote: On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy wrote: The next patch of this patchset changes: spapr_tce_table_do_enable()

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/27/2015 12:24 AM, Paolo Bonzini wrote: On 26/05/2015 16:17, Alexey Kardashevskiy wrote: On 05/27/2015 12:03 AM, Paolo Bonzini wrote: On 26/05/2015 16:00, Alexey Kardashevskiy wrote: On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy wrote:

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 16:00, Alexey Kardashevskiy wrote: On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy wrote: The next patch of this patchset changes: spapr_tce_table_do_enable() memory_region_init_iommu(iommu)

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 16:17, Alexey Kardashevskiy wrote: On 05/27/2015 12:03 AM, Paolo Bonzini wrote: On 26/05/2015 16:00, Alexey Kardashevskiy wrote: On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy wrote: The next patch of this patchset changes:

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Michael Roth
Quoting Alexey Kardashevskiy (2015-05-26 09:17:42) On 05/27/2015 12:03 AM, Paolo Bonzini wrote: On 26/05/2015 16:00, Alexey Kardashevskiy wrote: On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy wrote: The next patch of this patchset

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 16:55, Michael Roth wrote: That's not a problem, there's memory_region_set_size for that. What on earth, I could've sworn I looked for this... yes I think that would solve the issue here. mr_add/mr_del can handle the change in offsets, set size can deal with the change and

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 17:00, Alexey Kardashevskiy wrote: Why do you need different regions? Why can't you have always the same IOMMU regions, and either: They may change a size. That's not a problem, there's memory_region_set_size for that. It was not there when I started doing this DDW :) If

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Alexey Kardashevskiy
On 05/26/2015 11:31 PM, Paolo Bonzini wrote: On 26/05/2015 15:28, Alexey Kardashevskiy wrote: My initial concern was if I can or cannot do: memory_region_init_iommu + memory_region_add_subregion and memory_region_del_subregion + object_unref outside of init/realize/unrealize/finalize. You

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Paolo Bonzini
On 26/05/2015 15:42, Alexey Kardashevskiy wrote: The next patch of this patchset changes: spapr_tce_table_do_enable() memory_region_init_iommu(iommu) memory_region_add_subregion(root, iommu) spapr_tce_table_disable() memory_region_del_subregion(root, iommu)

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-26 Thread Michael Roth
Quoting Paolo Bonzini (2015-05-26 09:24:57) On 26/05/2015 16:17, Alexey Kardashevskiy wrote: On 05/27/2015 12:03 AM, Paolo Bonzini wrote: On 26/05/2015 16:00, Alexey Kardashevskiy wrote: On 05/26/2015 11:48 PM, Paolo Bonzini wrote: On 26/05/2015 15:42, Alexey Kardashevskiy

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-25 Thread Alexey Kardashevskiy
Hi Paolo, I have had a conversation with Mike and it turns out I am not allowed to create/remove memory regions dynamically (docs/memory.txt:101); otherwise destroying regions during reset causes assertion in RCU thread during PHB/IOMMU unplug/unparent. Is it because patch just missing some

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-25 Thread David Gibson
On Tue, May 26, 2015 at 01:05:56AM +1000, Alexey Kardashevskiy wrote: Hi Paolo, I have had a conversation with Mike and it turns out I am not allowed to create/remove memory regions dynamically (docs/memory.txt:101); otherwise destroying regions during reset causes assertion in RCU thread

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-05-05 Thread David Gibson
On Sat, Apr 25, 2015 at 10:24:36PM +1000, Alexey Kardashevskiy wrote: Currently TCE tables are created once at start and their size never changes. We are going to change that by introducing a Dynamic DMA windows support where DMA configuration may change during the guest execution. This

[Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce enabled state for TCE table

2015-04-25 Thread Alexey Kardashevskiy
Currently TCE tables are created once at start and their size never changes. We are going to change that by introducing a Dynamic DMA windows support where DMA configuration may change during the guest execution. This changes spapr_tce_new_table() to create an empty stub object. Only LIOBN is