[PATCH v2 0/6] powerpc: queued spinlocks and rwlocks

2020-07-03 Thread Nicholas Piggin
v2 is updated to account for feedback from Will, Peter, and Waiman (thank you), and trims off a couple of RFC and unrelated patches. Thanks, Nick Nicholas Piggin (6): powerpc/powernv: must include hvcall.h to get PAPR defines powerpc/pseries: move some PAPR paravirt functions to their own fil

[PATCH v2 1/6] powerpc/powernv: must include hvcall.h to get PAPR defines

2020-07-03 Thread Nicholas Piggin
An include goes away in future patches which breaks compilation without this. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/powernv/pci-ioda-tce.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc/platforms/powernv/pci-i

[PATCH v2 2/6] powerpc/pseries: move some PAPR paravirt functions to their own file

2020-07-03 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/paravirt.h | 61 + arch/powerpc/include/asm/spinlock.h | 24 +--- arch/powerpc/lib/locks.c| 12 +++--- 3 files changed, 68 insertions(+), 29 deletions(-) create mode 100644 arch/powerpc/in

[PATCH v2 3/6] powerpc: move spinlock implementation to simple_spinlock

2020-07-03 Thread Nicholas Piggin
To prepare for queued spinlocks. This is a simple rename except to update preprocessor guard name and a file reference. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/simple_spinlock.h| 292 ++ .../include/asm/simple_spinlock_types.h | 21 ++ arch/powerpc/

[PATCH v2 4/6] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-03 Thread Nicholas Piggin
These have shown significantly improved performance and fairness when spinlock contention is moderate to high on very large systems. [ Numbers hopefully forthcoming after more testing, but initial results look good ] Thanks to the fast path, single threaded performance is not noticably hurt.

[PATCH v2 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-03 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/paravirt.h | 28 ++ arch/powerpc/include/asm/qspinlock.h | 55 +++ arch/powerpc/include/asm/qspinlock_paravirt.h | 5 ++ arch/powerpc/platforms/pseries/Kconfig| 5 ++ arch/powerpc/plat

[PATCH v2 6/6] powerpc/qspinlock: optimised atomic_try_cmpxchg_lock that adds the lock hint

2020-07-03 Thread Nicholas Piggin
This brings the behaviour of the uncontended fast path back to roughly equivalent to simple spinlocks -- a single atomic op with lock hint. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/atomic.h| 28 arch/powerpc/include/asm/qspinlock.h | 2 +- 2 f

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-07-03 Thread Michal Suchánek
On Wed, Jul 01, 2020 at 02:21:10PM +0200, Michal Hocko wrote: > On Wed 01-07-20 13:30:57, David Hildenbrand wrote: > > On 01.07.20 13:06, David Hildenbrand wrote: > > > On 01.07.20 13:01, Srikar Dronamraju wrote: > > >> * David Hildenbrand [2020-07-01 12:15:54]: > > >> > > >>> On 01.07.20 12:04, S

Re: [PATCH v4 24/41] powerpc/book3s64/pkeys: Store/restore userspace AMR correctly on entry and exit from kernel

2020-07-03 Thread Nicholas Piggin
Excerpts from Aneesh Kumar K.V's message of June 15, 2020 4:14 pm: > This prepare kernel to operate with a different value than userspace AMR. > For this, AMR needs to be saved and restored on entry and return from the > kernel. > > With KUAP we modify kernel AMR when accessing user address from t

Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

2020-07-03 Thread Arnaud Ferraris
Le 02/07/2020 à 17:42, Mark Brown a écrit : > On Thu, Jul 02, 2020 at 05:28:03PM +0200, Arnaud Ferraris wrote: >> Le 02/07/2020 à 16:31, Mark Brown a écrit : > >>> Why require that the CODEC be clock master here - why not make this >>> configurable, reusing the properties from the generic and a

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-07-03 Thread Michal Hocko
[Cc Andi] On Fri 03-07-20 11:10:01, Michal Suchanek wrote: > On Wed, Jul 01, 2020 at 02:21:10PM +0200, Michal Hocko wrote: > > On Wed 01-07-20 13:30:57, David Hildenbrand wrote: [...] > > > Yep, looks like it. > > > > > > [0.009726] SRAT: PXM 1 -> APIC 0x00 -> Node 0 > > > [0.009727] SRAT

Re: [PATCH v4 24/41] powerpc/book3s64/pkeys: Store/restore userspace AMR correctly on entry and exit from kernel

2020-07-03 Thread Aneesh Kumar K.V
On 7/3/20 2:48 PM, Nicholas Piggin wrote: Excerpts from Aneesh Kumar K.V's message of June 15, 2020 4:14 pm: This prepare kernel to operate with a different value than userspace AMR. For this, AMR needs to be saved and restored on entry and return from the kernel. With KUAP we modify kernel AMR

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-03 Thread Arnaud Ferraris
Hi Nic, Le 02/07/2020 à 20:42, Nicolin Chen a écrit : > Hi Arnaud, > > On Thu, Jul 02, 2020 at 04:22:31PM +0200, Arnaud Ferraris wrote: >> The current ASRC driver hardcodes the input and output clocks used for >> sample rate conversions. In order to allow greater flexibility and to >> cover more

Re: [PATCH V3 (RESEND) 2/3] mm/sparsemem: Enable vmem_altmap support in vmemmap_alloc_block_buf()

2020-07-03 Thread Michael Ellerman
Catalin Marinas writes: > On Thu, Jun 18, 2020 at 06:45:29AM +0530, Anshuman Khandual wrote: >> There are many instances where vmemap allocation is often switched between >> regular memory and device memory just based on whether altmap is available >> or not. vmemmap_alloc_block_buf() is used in v

[RFC PATCH v0 0/2] Use H_RPT_INVALIDATE for nested guest

2020-07-03 Thread Bharata B Rao
This patchset adds support for the new hcall H_RPT_INVALIDATE (currently handles nested case only) and replaces the nested tlb flush calls with this new hcall if the support for the same exists. This applies on top of "[PATCH v3 0/3] Off-load TLB invalidations to host for !GTSE" patchset that was

[RFC PATCH v0 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE (nested case only)

2020-07-03 Thread Bharata B Rao
Implements H_RPT_INVALIDATE hcall and supports only nested case currently. A KVM capability KVM_CAP_RPT_INVALIDATE is added to indicate the support for this hcall. Signed-off-by: Bharata B Rao --- Documentation/virt/kvm/api.rst| 17 .../include/asm/book3s/64/tlbflush-radix.

[RFC PATCH v0 2/2] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2020-07-03 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/firmware.h | 4

Re: [PATCH 5/8] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-03 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from Will Deacon's message of July 2, 2020 8:35 pm: >> On Thu, Jul 02, 2020 at 08:25:43PM +1000, Nicholas Piggin wrote: >>> Excerpts from Will Deacon's message of July 2, 2020 6:02 pm: >>> > On Thu, Jul 02, 2020 at 05:48:36PM +1000, Nicholas Piggin wrote: >>> >>

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-07-03 Thread Michal Hocko
On Fri 03-07-20 11:24:17, Michal Hocko wrote: > [Cc Andi] > > On Fri 03-07-20 11:10:01, Michal Suchanek wrote: > > On Wed, Jul 01, 2020 at 02:21:10PM +0200, Michal Hocko wrote: > > > On Wed 01-07-20 13:30:57, David Hildenbrand wrote: > [...] > > > > Yep, looks like it. > > > > > > > > [0.0097

Re: [PATCH 16/26] mm/powerpc: Use general page fault accounting

2020-07-03 Thread Michael Ellerman
Peter Xu writes: > Use the general page fault accounting by passing regs into handle_mm_fault(). > > CC: Michael Ellerman > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Peter Xu > --- > arch/powerpc/mm/fault.c | 11 +++ > 1 file

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-07-03 Thread David Hildenbrand
On 03.07.20 12:59, Michal Hocko wrote: > On Fri 03-07-20 11:24:17, Michal Hocko wrote: >> [Cc Andi] >> >> On Fri 03-07-20 11:10:01, Michal Suchanek wrote: >>> On Wed, Jul 01, 2020 at 02:21:10PM +0200, Michal Hocko wrote: On Wed 01-07-20 13:30:57, David Hildenbrand wrote: >> [...] > Yep, lo

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-07-03 Thread Michal Hocko
On Fri 03-07-20 13:32:21, David Hildenbrand wrote: > On 03.07.20 12:59, Michal Hocko wrote: > > On Fri 03-07-20 11:24:17, Michal Hocko wrote: > >> [Cc Andi] > >> > >> On Fri 03-07-20 11:10:01, Michal Suchanek wrote: > >>> On Wed, Jul 01, 2020 at 02:21:10PM +0200, Michal Hocko wrote: > On Wed 0

[PATCH 1/2] powerpc/powernv/idle: Exclude mfspr on HID1, 4, 5 on P9 and above

2020-07-03 Thread Pratik Rajesh Sampat
POWER9 onwards the support for the registers HID1, HID4, HID5 has been receded. Although mfspr on the above registers worked in Power9, In Power10 simulator is unrecognized. Moving their assignment under the check for machines lower than Power9 Signed-off-by: Pratik Rajesh Sampat --- arch/powerp

[PATCH 2/2] powerpc/powernv/idle: save-restore DAWR0,DAWRX0 for P10

2020-07-03 Thread Pratik Rajesh Sampat
Additional registers DAWR0, DAWRX0 may be lost on Power 10 for stop levels < 4. Therefore save the values of these SPRs before entering a "stop" state and restore their values on wakeup. Signed-off-by: Pratik Rajesh Sampat --- arch/powerpc/platforms/powernv/idle.c | 10 ++ 1 file change

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-07-03 Thread Srikar Dronamraju
* Michal Hocko [2020-07-03 12:59:44]: > > Honestly, I do not have any idea. I've traced it down to > > Author: Andi Kleen > > Date: Tue Jan 11 15:35:48 2005 -0800 > > > > [PATCH] x86_64: Fix ACPI SRAT NUMA parsing > > > > Fix fallout from the recent nodemask_t changes. The node ids a

Re: [v2 PATCH] crypto: af_alg - Fix regression on empty requests

2020-07-03 Thread Luis Chamberlain
On Thu, Jul 02, 2020 at 01:32:21PM +1000, Herbert Xu wrote: > On Tue, Jun 30, 2020 at 02:18:11PM +0530, Naresh Kamboju wrote: > > > > Since we are on this subject, > > LTP af_alg02 test case fails on stable 4.9 and stable 4.4 > > This is not a regression because the test case has been failing fro

[PATCH 1/5] selftests/powerpc: Add test of stack expansion logic

2020-07-03 Thread Michael Ellerman
We have custom stack expansion checks that it turns out are extremely badly tested and contain bugs, surprise. So add some tests that exercise the code and capture the current boundary conditions. The signal test currently fails on 64-bit kernels because the 2048 byte allowance for the signal fram

[PATCH 3/5] selftests/powerpc: Update the stack expansion test

2020-07-03 Thread Michael Ellerman
Update the stack expansion load/store test to take into account the new allowance of 4096 bytes below the stack pointer. Signed-off-by: Michael Ellerman --- .../selftests/powerpc/mm/stack_expansion_ldst.c| 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools

[PATCH 2/5] powerpc: Allow 4096 bytes of stack expansion for the signal frame

2020-07-03 Thread Michael Ellerman
We have powerpc specific logic in our page fault handling to decide if an access to an unmapped address below the stack pointer should expand the stack VMA. The code was originally added in 2004 "ported from 2.4". The rough logic is that the stack is allowed to grow to 1MB with no extra checking.

[RFC PATCH 4/5] powerpc/mm: Remove custom stack expansion checking

2020-07-03 Thread Michael Ellerman
We have powerpc specific logic in our page fault handling to decide if an access to an unmapped address below the stack pointer should expand the stack VMA. The logic aims to prevent userspace from doing bad accesses below the stack pointer. However as long as the stack is < 1MB in size, we allow

[RFC PATCH 5/5] selftests/powerpc: Remove powerpc special cases from stack expansion test

2020-07-03 Thread Michael Ellerman
Now that the powerpc code behaves the same as other architectures we can drop the special cases we had. Signed-off-by: Michael Ellerman --- .../powerpc/mm/stack_expansion_ldst.c | 41 +++ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/tools/testing/selftes

Re: [PATCH v2] ASoC: fsl_asrc: Add an option to select internal ratio mode

2020-07-03 Thread Mark Brown
On Tue, Jun 30, 2020 at 04:47:56PM +0800, Shengjiu Wang wrote: > The ASRC not only supports ideal ratio mode, but also supports > internal ratio mode. This doesn't apply against current code, please check and resend. signature.asc Description: PGP signature

[PATCH 2/2] KVM: PPC: Book3S HV: rework secure mem slot dropping

2020-07-03 Thread Laurent Dufour
When a secure memslot is dropped, all the pages backed in the secure device (aka really backed by secure memory by the Ultravisor) should be paged out to a normal page. Previously, this was achieved by triggering the page fault mechanism which is calling kvmppc_svm_page_out() on each pages. This c

[PATCH 1/2] KVM: PPC: Book3S HV: move kvmppc_svm_page_out up

2020-07-03 Thread Laurent Dufour
kvmppc_svm_page_out() will need to be called by kvmppc_uvmem_drop_pages() so move it upper in this file. Furthermore it will be interesting to call this function when already holding the kvm->arch.uvmem_lock, so prefix the original function with __ and remove the locking in it, and introduce a wra

[PATCH 0/2] Rework secure memslot dropping

2020-07-03 Thread Laurent Dufour
When doing memory hotplug on a secure VM, the secure pages are not well cleaned from the secure device when dropping the memslot. This silent error, is then preventing the SVM to reboot properly after the following sequence of commands are run in the Qemu monitor: device_add pc-dimm,id=dimm1,memd

Re: [PATCH v2] ASoC: fsl_asrc: Add an option to select internal ratio mode

2020-07-03 Thread Mark Brown
On Tue, 30 Jun 2020 16:47:56 +0800, Shengjiu Wang wrote: > The ASRC not only supports ideal ratio mode, but also supports > internal ratio mode. > > For internal rato mode, the rate of clock source should be divided > with no remainder by sample rate, otherwise there is sound > distortion. > > [.

Re: [PATCH v2] ASoC: fsl_asrc: Add an option to select internal ratio mode

2020-07-03 Thread Nicolin Chen
Hi Mark, On Fri, Jul 03, 2020 at 06:03:43PM +0100, Mark Brown wrote: > On Tue, 30 Jun 2020 16:47:56 +0800, Shengjiu Wang wrote: > > The ASRC not only supports ideal ratio mode, but also supports > > internal ratio mode. > > > > For internal rato mode, the rate of clock source should be divided >

Re: [PATCH v2] ASoC: fsl_asrc: Add an option to select internal ratio mode

2020-07-03 Thread Mark Brown
On Fri, Jul 03, 2020 at 03:46:58PM -0700, Nicolin Chen wrote: > > [1/1] ASoC: fsl_asrc: Add an option to select internal ratio mode > > commit: d0250cf4f2abfbea64ed247230f08f5ae23979f0 > You already applied v3 of this change: > https://mailman.alsa-project.org/pipermail/alsa-devel/2020-July

Re: [PATCH v2] ASoC: fsl_asrc: Add an option to select internal ratio mode

2020-07-03 Thread Nicolin Chen
On Fri, Jul 03, 2020 at 11:50:20PM +0100, Mark Brown wrote: > On Fri, Jul 03, 2020 at 03:46:58PM -0700, Nicolin Chen wrote: > > > > [1/1] ASoC: fsl_asrc: Add an option to select internal ratio mode > > > commit: d0250cf4f2abfbea64ed247230f08f5ae23979f0 > > > You already applied v3 of this c