Re: [PATCH] powerpc/rtas: Replace one-element arrays with flexible arrays

2023-01-27 Thread Leonardo Brás
On Fri, 2023-01-27 at 19:50 +1100, Andrew Donnellan wrote: > Using a one-element array as a fake flexible array is deprecated. > > Replace the one-element flexible arrays in rtas-types.h with C99 standard > flexible array members instead. > > This helps us move towards enabling

Re: [PATCH] Revert "powerpc/rtas: Implement reentrant rtas call"

2022-09-13 Thread Leonardo Brás
On Mon, 2022-09-12 at 14:58 -0500, Nathan Lynch wrote: > Leonardo Brás writes: > > On Fri, 2022-09-09 at 09:04 -0500, Nathan Lynch wrote: > > > Leonardo Brás writes: > > > > On Wed, 2022-09-07 at 17:01 -0500, Nathan Lynch wrote: > > > > > At the tim

Re: [PATCH] Revert "powerpc/rtas: Implement reentrant rtas call"

2022-09-12 Thread Leonardo Brás
On Fri, 2022-09-09 at 09:04 -0500, Nathan Lynch wrote: > Hi Leonardo, > > (restoring the list to the cc, hope that's ok) > Sure, thanks for doing that.  I probably had some mail composer issue here. > Leonardo Brás writes: > > On Wed, 2022-09-07 at 17:01 -050

Re: [PATCH] powerpc/pseries/iommu: Add of_node_put() before break

2021-10-14 Thread Leonardo Brás
Hello Wan, thank you for this patch. On Thu, 2021-10-14 at 03:56 -0400, Wan Jiabing wrote: > Fix following coccicheck warning: > > ./arch/powerpc/platforms/pseries/iommu.c:924:1-28: WARNING: Function > for_each_node_with_property should have of_node_put() before break > > Early exits from

Re: [PATCH kernel] powerps/pseries/dma: Add support for 2M IOMMU page size

2021-09-28 Thread Leonardo Brás
Hello Alexey, On Tue, 2021-09-28 at 20:15 +1000, Alexey Kardashevskiy wrote: > The upcoming PAPR spec adds a 2M page size, bit 23 right after the 16G > page > size in the "ibm,query-pe-dma-window" call. > > This adds support for the new page size. Since the new page size is out > of sorted

Re: [PATCH v6 00/11] DDW + Indirect Mapping

2021-08-31 Thread Leonardo Brás
On Tue, 2021-08-31 at 13:39 -0700, David Christensen wrote: > > > > This series allow Indirect DMA using DDW when available, which > > usually > > means bigger pagesizes and more TCEs, and so more DMA space. > > How is the mapping method selected?  LPAR creation via the HMC, Linux > kernel load

Re: [PATCH kernel] KVM: PPC: Fix clearing never mapped TCEs in realmode

2021-08-31 Thread Leonardo Brás
Hello Alexey, On Fri, 2021-08-27 at 14:07 +1000, Alexey Kardashevskiy wrote: > Since e1a1ef84cd07, pages for TCE tables for KVM guests are allocated > only when needed. This allows skipping any update when clearing TCEs. > This works mostly fine as TCE updates are handled when MMU is enabled. >

Re: [PATCH v6 00/11] DDW + Indirect Mapping

2021-08-31 Thread Leonardo Brás
Hello David, Sorry for the delay, I did not get your mail because I was not CC'd in your reply (you sent the mail just to the mailing list). Replies bellow: On Mon, 2021-08-30 at 10:48 -0700, David Christensen wrote: > On 8/16/21 11:39 PM, Leonardo Bras wrote: > > So far it's assumed possible

Re: [PATCH v6 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-08-27 Thread Leonardo Brás
Hello Fred, On Fri, 2021-08-27 at 19:06 +0200, Frederic Barrat wrote: > > I think it looks ok now as it was mostly me who was misunderstanding > one > part of the previous iteration. > Reviewed-by: Frederic Barrat > Thank you for reviewing this series! > Sorry for the late review, I was

Re: [PATCH v5 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-08-17 Thread Leonardo Brás
On Tue, 2021-08-17 at 02:59 -0300, Leonardo Brás wrote: > Hello Fred, thanks for the feedback! > > On Tue, 2021-07-20 at 19:51 +0200, Frederic Barrat wrote: > > > > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > > Update remove_dma_window() so it can be u

Re: [PATCH v5 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-08-17 Thread Leonardo Brás
Alexey, Fred: On Fri, 2021-07-23 at 15:34 +1000, Alexey Kardashevskiy wrote: > > > On 22/07/2021 01:04, Frederic Barrat wrote: > > > > > > On 21/07/2021 05:32, Alexey Kardashevskiy wrote: > > > > > +    struct iommu_table *newtbl; > > > > > +    int i; > > > > > + > > > > > +   

Re: [PATCH v5 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-08-17 Thread Leonardo Brás
Hello Fred, thanks for the feedback! On Tue, 2021-07-20 at 19:51 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > Update remove_dma_window() so it can be used to remove DDW with a > > given > > property name. > > > > This enables the creation of new property

Re: [PATCH v5 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-08-17 Thread Leonardo Brás
Hello Alexey, Fred. Thanks for reviewing! On Wed, 2021-07-21 at 13:32 +1000, Alexey Kardashevskiy wrote: > > >     spin_lock(_window_list_lock); > > > > > > > > > > Somewhere around here, we have: > > > > out_remove_win: > >  remove_ddw(pdn, true, DIRECT64_PROPNAME); > > > > We should

Re: [PATCH v5 06/11] powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw()

2021-08-16 Thread Leonardo Brás
Hello Fred, thanks for this feedback! On Tue, 2021-07-20 at 19:49 +0200, Frederic Barrat wrote: > > > kfree(window); > >   > > -out_clear_window: > > -   remove_ddw(pdn, true); > > +out_del_prop: > > +   of_remove_property(pdn, win64); > >   > >   out_free_prop: > >

Re: [PATCH v5 02/11] powerpc/kernel/iommu: Add new iommu_table_in_use() helper

2021-07-19 Thread Leonardo Brás
Hello Fred, thanks for this feedback! Sorry if I miss anything, this snippet was written for v1 over an year ago, and I have not taken a look at it ever since. On Mon, 2021-07-19 at 15:53 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > @@ -1099,18 +1105,13 @@

Re: [PATCH v5 04/11] powerpc/pseries/iommu: Add ddw_list_new_entry() helper

2021-07-19 Thread Leonardo Brás
On Mon, 2021-07-19 at 16:14 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > There are two functions creating direct_window_list entries in a > > similar way, so create a ddw_list_new_entry() to avoid duplicity > > and > > simplify those functions. > > > >

Re: [PATCH v5 03/11] powerpc/pseries/iommu: Add iommu_pseries_alloc_table() helper

2021-07-19 Thread Leonardo Brás
On Mon, 2021-07-19 at 16:04 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > Creates a helper to allow allocating a new iommu_table without the > > need > > to reallocate the iommu_group. > > > > This will be helpful for replacing the iommu_table for the new DMA

Re: [PATCH v5 01/11] powerpc/pseries/iommu: Replace hard-coded page shift

2021-07-19 Thread Leonardo Brás
On Mon, 2021-07-19 at 15:48 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > Some functions assume IOMMU page size can only be 4K (pageshift == > > 12). > > Update them to accept any page size passed, so we can use 64K > > pages. > > > > In the process, some

Re: [PATCH v4 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-07-14 Thread Leonardo Brás
On Wed, 2021-07-14 at 18:38 +1000, Alexey Kardashevskiy wrote: > >   for (i = 0; i < > > > > ARRAY_SIZE(pci->phb->mem_resources); > > > > i++) { > > > > +   const unsigned long mask = > > > > IORESOURCE_MEM_64 > > > > > IORESOURCE_MEM; > > > > + > > > > +

Re: [PATCH v4 07/11] powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper

2021-07-14 Thread Leonardo Brás
On Wed, 2021-07-14 at 18:32 +1000, Alexey Kardashevskiy wrote: > > > On 13/07/2021 14:47, Leonardo Brás wrote: > > Hello Alexey, > > > > On Fri, 2021-06-18 at 19:26 -0300, Leonardo Brás wrote: > > > > > > > > > + 

Re: [PATCH v4 07/11] powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper

2021-07-12 Thread Leonardo Brás
Hello Alexey, On Fri, 2021-06-18 at 19:26 -0300, Leonardo Brás wrote: > > > > > +    unsigned long liobn, > > > unsigned long win_addr, > > > +    unsigned long > > > w

Re: [PATCH v4 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-07-12 Thread Leonardo Brás
On Tue, 2021-05-11 at 17:57 +1000, Alexey Kardashevskiy wrote: > > > On 01/05/2021 02:31, Leonardo Bras wrote: > > [...] > >   pmem_present = dn != NULL; > > @@ -1218,8 +1224,12 @@ static bool enable_ddw(struct pci_dev *dev, > > struct device_node *pdn) > >   > >

Re: [PATCH v4 07/11] powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper

2021-06-18 Thread Leonardo Brás
Hello Alexey, thanks for this feedback! On Mon, 2021-05-10 at 17:34 +1000, Alexey Kardashevskiy wrote: > > > This does not apply anymore as it conflicts with my 4be518d838809e2135. ok, rebasing on top of torvalds/master > > > > --- > >   arch/powerpc/platforms/pseries/iommu.c | 100

Re: [PATCH v2 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug

2021-06-08 Thread Leonardo Brás
On Wed, 2021-06-09 at 14:40 +1000, David Gibson wrote: > On Tue, Jun 08, 2021 at 09:52:10PM -0300, Leonardo Brás wrote: > > On Mon, 2021-06-07 at 15:02 +1000, David Gibson wrote: > > > On Fri, Apr 30, 2021 at 11:36:06AM -0300, Leonardo Bras wrote: > > > > Because

Re: [PATCH v2 3/3] powerpc/mm/hash: Avoid multiple HPT resize-downs on memory hotunplug

2021-06-08 Thread Leonardo Brás
On Mon, 2021-06-07 at 15:20 +1000, David Gibson wrote: > On Fri, Apr 30, 2021 at 11:36:10AM -0300, Leonardo Bras wrote: > > During memory hotunplug, after each LMB is removed, the HPT may be > > resized-down if it would map a max of 4 times the current amount of > > memory. > > (2 shifts, due to

Re: [PATCH v2 2/3] powerpc/mm/hash: Avoid multiple HPT resize-ups on memory hotplug

2021-06-08 Thread Leonardo Brás
On Mon, 2021-06-07 at 15:10 +1000, David Gibson wrote: > On Fri, Apr 30, 2021 at 11:36:08AM -0300, Leonardo Bras wrote: > > Every time a memory hotplug happens, and the memory limit crosses a > > 2^n > > value, it may be necessary to perform HPT resizing-up, which can > > take > > some time (over

Re: [PATCH v2 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug

2021-06-08 Thread Leonardo Brás
On Mon, 2021-06-07 at 15:02 +1000, David Gibson wrote: > On Fri, Apr 30, 2021 at 11:36:06AM -0300, Leonardo Bras wrote: > > Because hypervisors may need to create HPTs without knowing the > > guest > > page size, the smallest used page-size (4k) may be chosen, > > resulting in > > a HPT that is