Re: [PATCH v1 06/10] powerpc/pseries/iommu: Add ddw_list_add() helper

2020-08-28 Thread Leonardo Bras
On Fri, 2020-08-28 at 11:58 +1000, Alexey Kardashevskiy wrote: > > On 28/08/2020 08:11, Leonardo Bras wrote: > > On Mon, 2020-08-24 at 13:46 +1000, Alexey Kardashevskiy wrote: > > > > static int find_existing_ddw_windows(void) > > > > { > > > > int len; > > > > @@ -887,18 +905,11 @@ stat

Re: [PATCH v1 02/10] powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE on iommu_*_coherent()

2020-08-28 Thread Leonardo Bras
On Fri, 2020-08-28 at 11:40 +1000, Alexey Kardashevskiy wrote: > > I think it would be better to keep the code as much generic as possible > > regarding page sizes. > > Then you need to test it. Does 4K guest even boot (it should but I would > not bet much on it)? Maybe testing with host 64k pag

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

2020-08-28 Thread Leonardo Bras
On Fri, 2020-08-28 at 12:27 +1000, Alexey Kardashevskiy wrote: > > On 28/08/2020 01:32, Leonardo Bras wrote: > > Hello Alexey, thank you for this feedback! > > > > On Sat, 2020-08-22 at 19:33 +1000, Alexey Kardashevskiy wrote: > > > > +#define TCE_RPN_BITS 52 /* Bits 0-51 r

Re: [PATCH v1 09/10] powerpc/pseries/iommu: Make use of DDW even if it does not map the partition

2020-08-28 Thread Leonardo Bras
On Mon, 2020-08-24 at 15:17 +1000, Alexey Kardashevskiy wrote: > > On 18/08/2020 09:40, Leonardo Bras wrote: > > As of today, if the biggest DDW that can be created can't map the whole > > partition, it's creation is skipped and the default DMA window > > "ibm,dma-window" is used instead. > > > >

Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-28 Thread Gabriel Paubert
On Thu, Aug 27, 2020 at 12:39:06PM +0200, Christophe Leroy wrote: > Hi, > > Le 27/08/2020 à 10:28, Giuseppe Sacco a écrit : > > Il giorno gio, 27/08/2020 alle 09.46 +0200, Giuseppe Sacco ha scritto: > > > Il giorno gio, 27/08/2020 alle 00.28 +0200, Giuseppe Sacco ha scritto: > > > > Hello Christop

Re: Flushing transparent hugepages

2020-08-28 Thread Catalin Marinas
On Tue, Aug 18, 2020 at 05:08:16PM +0100, Will Deacon wrote: > On Tue, Aug 18, 2020 at 04:07:36PM +0100, Matthew Wilcox wrote: > > For example, arm64 seems confused in this scenario: > > > > void flush_dcache_page(struct page *page) > > { > > if (test_bit(PG_dcache_clean, &page->flags)) >

[powerpc:fixes-test] BUILD SUCCESS 4a133eb351ccc275683ad49305d0b04dde903733

2020-08-28 Thread kernel test robot
randconfig-a006-20200827 x86_64 randconfig-a004-20200827 i386 randconfig-a002-20200828 i386 randconfig-a005-20200828 i386 randconfig-a003-20200828 i386 randconfig-a004-20200828 i386 randconfig-a001-20200828

[powerpc:merge] BUILD SUCCESS f5d3660ab83be7c3dc2c8a5d662bbac7bc1b092f

2020-08-28 Thread kernel test robot
allyesconfig mips allmodconfig powerpc defconfig powerpc allyesconfig powerpc allmodconfig i386 randconfig-a002-20200828 i386 randconfig-a005-20200828 i

[powerpc:next-test] BUILD SUCCESS WITH WARNING dd419a93bd9954cfdd333f8387a9a0d22218720d

2020-08-28 Thread kernel test robot
-20200827 x86_64 randconfig-a006-20200827 x86_64 randconfig-a004-20200827 i386 randconfig-a002-20200828 i386 randconfig-a005-20200828 i386 randconfig-a003-20200828 i386 randconfig-a004-20200828 i386

Re: [PATCH v1 08/10] powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw()

2020-08-28 Thread Leonardo Bras
On Mon, 2020-08-24 at 15:07 +1000, Alexey Kardashevskiy wrote: > > On 18/08/2020 09:40, Leonardo Bras wrote: > > Code used to create a ddw property that was previously scattered in > > enable_ddw() is now gathered in ddw_property_create(), which deals with > > allocation and filling the property,

Re: [PATCH v1 07/10] powerpc/pseries/iommu: Allow DDW windows starting at 0x00

2020-08-28 Thread Leonardo Bras
On Mon, 2020-08-24 at 13:44 +1000, Alexey Kardashevskiy wrote: > > > On 18/08/2020 09:40, Leonardo Bras wrote: > > enable_ddw() currently returns the address of the DMA window, which is > > considered invalid if has the value 0x00. > > > > Also, it only considers valid an address returned from fi

Re: [PATCH 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-08-28 Thread peterz
On Fri, Aug 28, 2020 at 08:00:19PM +1000, Nicholas Piggin wrote: > Closing this race only requires interrupts to be disabled while ->mm > and ->active_mm are being switched, but the TLB problem requires also > holding interrupts off over activate_mm. Unfortunately not all archs > can do that yet,

[PATCH v2] powerpc/book3s64/radix: Fix boot failure with large amount of guest memory

2020-08-28 Thread Aneesh Kumar K.V
If the hypervisor doesn't support hugepages, the kernel ends up allocating a large number of page table pages. The early page table allocation was wrongly setting the max memblock limit to ppc64_rma_size with radix translation which resulted in boot failure as shown below. Kernel panic - not sync

[PATCH 4/4] powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm

2020-08-28 Thread Nicholas Piggin
Commit 0cef77c7798a7 ("powerpc/64s/radix: flush remote CPUs out of single-threaded mm_cpumask") added a mechanism to trim the mm_cpumask of a process under certain conditions. One of the assumptions is that mm_users would not be incremented via a reference outside the process context with mmget_not

[PATCH 3/4] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race

2020-08-28 Thread Nicholas Piggin
The de facto (and apparently uncommented) standard for using an mm had, thanks to this code in sparc if nothing else, been that you must have a reference on mm_users *and that reference must have been obtained with mmget()*, i.e., from a thread with a reference to mm_users that had used the mm. Th

[PATCH 2/4] powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM

2020-08-28 Thread Nicholas Piggin
powerpc uses IPIs in some situations to switch a kernel thread away from a lazy tlb mm, which is subject to the TLB flushing race described in the changelog introducing ARCH_WANT_IRQS_OFF_ACTIVATE_MM. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 1 + arch/powerpc/i

[PATCH 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-08-28 Thread Nicholas Piggin
Reading and modifying current->mm and current->active_mm and switching mm should be done with irqs off, to prevent races seeing an intermediate state. This is similar to commit 38cf307c1f20 ("mm: fix kthread_use_mm() vs TLB invalidate"). At exec-time when the new mm is activated, the old one shoul

[PATCH 0/4] more mm switching vs TLB shootdown and lazy tlb

2020-08-28 Thread Nicholas Piggin
This is an attempt to fix a few different related issues around switching mm, TLB flushing, and lazy tlb mm handling. This will require all architectures to eventually move to disabling irqs over activate_mm, but it's possible we could add another arch call after irqs are re-enabled for those few

Re: [PATCHv5 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-08-28 Thread Pingfan Liu
On Thu, Aug 27, 2020 at 3:53 PM Laurent Dufour wrote: > > Le 10/08/2020 à 10:52, Pingfan Liu a écrit : > > A bug is observed on pseries by taking the following steps on rhel: > > -1. drmgr -c mem -r -q 5 > > -2. echo c > /proc/sysrq-trigger > > > > And then, the failure looks like: > > kdump: savi