[PATCH] powerpc/mm/book3s64: Fix possible build error

2021-06-10 Thread Aneesh Kumar K.V
Update _tlbiel_pid() such that we can avoid build errors like below when using this function in other places. arch/powerpc/mm/book3s64/radix_tlb.c: In function ‘__radix__flush_tlb_range_psize’: arch/powerpc/mm/book3s64/radix_tlb.c:114:2: warning: ‘asm’ operand 3 probably does not match

[PATCH 6/6] mm/mremap: hold the rmap lock in write mode when moving page table entries.

2021-06-10 Thread Aneesh Kumar K.V
To avoid a race between rmap walk and mremap, mremap does take_rmap_locks(). The lock was taken to ensure that rmap walk don't miss a page table entry due to PTE moves via move_pagetables(). The kernel does further optimization of this lock such that if we are going to find the newly added vma

[PATCH 3/5] cpufreq: powerenv: Migrate to ->exit() callback instead of ->stop_cpu()

2021-06-10 Thread Viresh Kumar
commit 367dc4aa932b ("cpufreq: Add stop CPU callback to cpufreq_driver interface") added the stop_cpu() callback to allow the drivers to do clean up before the CPU is completely down and its state cannot be modified. At that time the CPU hotplug framework used to call the cpufreq core's

[PATCH 0/5] cpufreq: cppc: Fix suspend/resume specific races with FIE code

2021-06-10 Thread Viresh Kumar
Hi Qian, It would be helpful if you can test this patchset and confirm if the races you mentioned went away or not and that the FIE code works as we wanted it to. I don't have a real setup and so it won't be easy for me to test this out. I have already sent a temporary fix for 5.13 and this

[PATCH 1/6] selftest/mremap_test: Update the test to handle pagesize other than 4K

2021-06-10 Thread Aneesh Kumar K.V
Instead of hardcoding 4K page size fetch it using sysconf(). For the performance measurements test still assume 2M and 1G are hugepage sizes. Reviewed-by: Kalesh Singh Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/mremap_test.c | 113 --- 1 file changed, 61

[PATCH 0/6] mremap fixes

2021-06-10 Thread Aneesh Kumar K.V
This patch series is split out series from [PATCH v7 00/11] Speedup mremap on ppc64 (https://lore.kernel.org/linux-mm/20210607055131.156184-1-aneesh.ku...@linux.ibm.com) dropping ppc64 specific changes. I will send the ppc64 specific changes separately once we agree on how to handle the TLB

[PATCH 2/6] selftest/mremap_test: Avoid crash with static build

2021-06-10 Thread Aneesh Kumar K.V
With a large mmap map size, we can overlap with the text area and using MAP_FIXED results in unmapping that area. Switch to MAP_FIXED_NOREPLACE and handle the EEXIST error. Reviewed-by: Kalesh Singh Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/mremap_test.c | 5 +++-- 1 file

[PATCH 3/6] mm/mremap: Convert huge PUD move to separate helper

2021-06-10 Thread Aneesh Kumar K.V
With TRANSPARENT_HUGEPAGE_PUD enabled the kernel can find huge PUD entries. Add a helper to move huge PUD entries on mremap(). This will be used by a later patch to optimize mremap of PUD_SIZE aligned level 4 PTE mapped address This also make sure we support mremap on huge PUD entries even with

[PATCH 4/6] mm/mremap: Don't enable optimized PUD move if page table levels is 2

2021-06-10 Thread Aneesh Kumar K.V
With two level page table don't enable move_normal_pud. Signed-off-by: Aneesh Kumar K.V --- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mremap.c b/mm/mremap.c index 92ab7d24a587..795a7d628b53 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -276,7 +276,7 @@

[PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-10 Thread Aneesh Kumar K.V
pmd/pud_populate is the right interface to be used to set the respective page table entries. Some architectures like ppc64 do assume that set_pmd/pud_at can only be used to set a hugepage PTE. Since we are not setting up a hugepage PTE here, use the pmd/pud_populate interface. Signed-off-by:

Re: [PATCH net-next] ibmvnic: Use list_for_each_entry() to simplify code in ibmvnic.c

2021-06-10 Thread Lijun Pan
On Thu, Jun 10, 2021 at 7:56 AM Wang Hai wrote: > > Convert list_for_each() to list_for_each_entry() where > applicable. This simplifies the code. > > Reported-by: Hulk Robot > Signed-off-by: Wang Hai > --- Acked-by: Lijun Pan

[PATCH] powerpc/signal64: Don't read sigaction arguments back from user memory

2021-06-10 Thread Michael Ellerman
When delivering a signal to a sigaction style handler (SA_SIGINFO), we pass pointers to the siginfo and ucontext via r4 and r5. Currently we populate the values in those registers by reading the pointers out of the sigframe in user memory, even though the values in user memory were written by the

Re: [RFC] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-06-10 Thread Pratik Sampat
On 10/06/21 5:33 am, Fabiano Rosas wrote: Pratik Sampat writes: 3. version info - 1 byte 4. A data array of size num attributes, which contains the following: a. attribute ID - 8 bytes b. attribute value in number - 8 bytes c. attribute name in

Re: [PATCH] btrfs: Disable BTRFS on platforms having 256K pages

2021-06-10 Thread Christophe Leroy
Le 10/06/2021 à 15:54, Chris Mason a écrit : On Jun 10, 2021, at 1:23 AM, Christophe Leroy wrote: With a config having PAGE_SIZE set to 256K, BTRFS build fails with the following message include/linux/compiler_types.h:326:38: error: call to '__compiletime_assert_791' declared with

[PATCH] powerpc/signal32: Remove impossible #ifdef combinations

2021-06-10 Thread Christophe Leroy
PPC_TRANSACTIONAL_MEM is only on book3s/64 SPE is only on booke PPC_TRANSACTIONAL_MEM selects ALTIVEC and VSX Therefore, within PPC_TRANSACTIONAL_MEM sections, ALTIVEC and VSX are always defined while SPE never is. Remove all SPE code and all #ifdef ALTIVEC and VSX in tm functions.

Re: [PATCH] btrfs: Disable BTRFS on platforms having 256K pages

2021-06-10 Thread David Sterba
On Thu, Jun 10, 2021 at 04:50:09PM +0200, Christophe Leroy wrote: > > > Le 10/06/2021 à 15:54, Chris Mason a écrit : > > > >> On Jun 10, 2021, at 1:23 AM, Christophe Leroy > >> wrote: > >> > >> With a config having PAGE_SIZE set to 256K, BTRFS build fails > >> with the following message > >>

Re: [PATCH net-next] ibmvnic: Use list_for_each_entry() to simplify code in ibmvnic.c

2021-06-10 Thread Dany Madden
On 2021-06-10 07:52, Lijun Pan wrote: On Thu, Jun 10, 2021 at 7:56 AM Wang Hai wrote: Convert list_for_each() to list_for_each_entry() where applicable. This simplifies the code. Reported-by: Hulk Robot Signed-off-by: Wang Hai --- Acked-by: Lijun Pan Reviewed-by: Dany Madden

[PATCH v3 08/11] powerpc/64: allow alternate return locations for soft-masked interrupts

2021-06-10 Thread Nicholas Piggin
The exception table fixup adjusts a failed page fault's interrupt return location if it was taken at an address specified in the exception table, to a corresponding fixup handler address. Introduce a variation of that idea which adds a fixup table for NMIs and soft-masked asynchronous interrupts.

[PATCH v3 09/11] powerpc/64: interrupt soft-enable race fix

2021-06-10 Thread Nicholas Piggin
Prevent interrupt restore from allowing racing hard interrupts going ahead of previous soft-pending ones, by using the soft-masked restart handler to allow a store to clear the soft-mask while knowing nothing is soft-pending. This probably doesn't matter much in practice, but it's a simple

[next] [powerpc] tau_6xx.c:204:30: error: too many arguments for format [-Werror=format-extra-args]

2021-06-10 Thread Naresh Kamboju
While building Linux next-20210610 following builds failed due to these warnings / errors. - powerpc (ppc6xx_defconfig) with gcc-8 - powerpc (ppc6xx_defconfig) with gcc-9 - powerpc (ppc6xx_defconfig) with gcc-10 arch/powerpc/kernel/tau_6xx.c: In function 'TAU_init': arch/powerpc/kernel

[PATCH v3 03/11] powerpc/64s: avoid reloading (H)SRR registers if they are still valid

2021-06-10 Thread Nicholas Piggin
When an interrupt is taken, the SRR registers are set to return to where it left off. Unless they are modified in the meantime, or the return address or MSR are modified, there is no need to reload these registers when returning from interrupt. Introduce per-CPU flags that track the validity of

[PATCH v3 04/11] powerpc/64: handle MSR EE and RI in interrupt entry wrapper

2021-06-10 Thread Nicholas Piggin
Similarly to the system call change in the previous patch, the mtmsrd to enable RI can be combined with the mtmsrd to enable EE for interrupts which enable the latter, which tends to be the important synchronous interrupts (i.e., page faults). Do this by enabling EE and RI together at the

[PATCH v3 05/11] powerpc/64: move interrupt return asm to interrupt_64.S

2021-06-10 Thread Nicholas Piggin
The next patch would like to move interrupt return assembly code to a low location before general text, so move it into its own file and include via head_64.S Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/head-64.h | 2 +- arch/powerpc/kernel/entry_64.S | 623

[PATCH v3 06/11] powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE]

2021-06-10 Thread Nicholas Piggin
This extends the MSR[RI]=0 window a little further into the system call in order to pair RI and EE enabling with a single mtmsrd. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2 -- arch/powerpc/kernel/interrupt_64.S | 4 ++-- 2 files changed, 2 insertions(+), 4

[PATCH v3 07/11] powerpc/64s: save one more register in the masked interrupt handler

2021-06-10 Thread Nicholas Piggin
This frees up one more register (and takes advantage of that to clean things up a little bit). This register will be used in the following patch. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 34 1 file changed, 20 insertions(+), 14

[PATCH v3 02/11] powerpc/64s: introduce different functions to return from SRR vs HSRR interrupts

2021-06-10 Thread Nicholas Piggin
This makes no real difference yet except that HSRR type interrupts will use hrfid to return. This is important for the next patch. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_64.S | 65 +--- arch/powerpc/kernel/exceptions-64e.S | 4 ++

[PATCH] ASoC:fsl_easrc:Remove superfluous error message around platform_get_irq()

2021-06-10 Thread  Zhongjun Tan
From: Tan Zhongjun Clean up the check for irq.dev_err is superfluous as platform_get_irq() already prints an error.Remove curly braces to confirm to styling requirements. Signed-off-by: Tan Zhongjun --- sound/soc/fsl/fsl_easrc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH v3 11/11] powerpc/64: use interrupt restart table to speed up return from interrupt

2021-06-10 Thread Nicholas Piggin
Use the restart table facility to return from interrupt or system calls without disabling MSR[EE] or MSR[RI]. Interrupt return asm is put into the low soft-masked region, to prevent interrupts being processed here, although they are still taken as masked interrupts which causes SRRs to be

[PATCH v3 10/11] powerpc/64: treat low kernel text as irqs soft-masked

2021-06-10 Thread Nicholas Piggin
Treat code below __end_soft_masked as soft-masked for the purpose of alternate return. 64s already mostly does this for scv entry. This will be used to exit from interrupts without disabling MSR[EE]. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/interrupt.h | 11 ---

[PATCH net-next] ibmvnic: Use list_for_each_entry() to simplify code in ibmvnic.c

2021-06-10 Thread Wang Hai
Convert list_for_each() to list_for_each_entry() where applicable. This simplifies the code. Reported-by: Hulk Robot Signed-off-by: Wang Hai --- drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c

Re: [PATCH] powerpc/vdso: Fix multiple issues with sys_call_table

2021-06-10 Thread Christophe Leroy
Le 19/03/2020 à 02:10, Michael Ellerman a écrit : Anton Blanchard writes: The VDSO exports a bitmap of valid syscalls. vdso_setup_syscall_map() sets this up, but there are both little and big endian bugs. The issue is with: if (sys_call_table[i] != sys_ni_syscall) On little

[PATCH v3 01/11] powerpc: remove interrupt exit helpers unused argument

2021-06-10 Thread Nicholas Piggin
The msr argument is not used, remove it. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 4 ++-- arch/powerpc/kernel/interrupt.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/asm-prototypes.h

[PATCH v3 00/11] powerpc/64: fast interrupt exits

2021-06-10 Thread Nicholas Piggin
This series attempts to improve the speed of interrupts and system calls in three major ways. Firstly, the SRR/HSRR registers do not need to be reloaded if they were clobbered for the duration of the interrupt and the return NIP and MSR did not changed. 64e does not implement this part, but it

Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-10 Thread Linus Torvalds
On Thu, Jun 10, 2021 at 1:36 AM Aneesh Kumar K.V wrote: > > @@ -306,8 +306,7 @@ static bool move_normal_pud(struct vm_area_struct *vma, > unsigned long old_addr, > > VM_BUG_ON(!pud_none(*new_pud)); > > - /* Set the new pud */ > - set_pud_at(mm, new_addr, new_pud, pud); > +

Re: [PATCH net-next] ibmvnic: Use list_for_each_entry() to simplify code in ibmvnic.c

2021-06-10 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Thu, 10 Jun 2021 20:54:17 +0800 you wrote: > Convert list_for_each() to list_for_each_entry() where > applicable. This simplifies the code. > > Reported-by: Hulk Robot > Signed-off-by: Wang Hai > --- >

Re: [PATCH AUTOSEL 5.12 42/43] powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P2041 i2c controllers

2021-06-10 Thread Sasha Levin
On Fri, Jun 04, 2021 at 12:58:54AM +, Chris Packham wrote: On 4/06/21 12:42 pm, Michael Ellerman wrote: Sasha Levin writes: From: Chris Packham [ Upstream commit 7adc7b225cddcfd0f346d10144fd7a3d3d9f9ea7 ] The i2c controllers on the P2040/P2041 have an erratum where the documented

Re: [PATCH 3/6] mm/mremap: Convert huge PUD move to separate helper

2021-06-10 Thread Hugh Dickins
On Thu, 10 Jun 2021, Aneesh Kumar K.V wrote: > With TRANSPARENT_HUGEPAGE_PUD enabled the kernel can find huge PUD entries. > Add a helper to move huge PUD entries on mremap(). > > This will be used by a later patch to optimize mremap of PUD_SIZE aligned > level 4 PTE mapped address > > This

Re: [PATCH] ASoC:fsl_spdif:Remove superfluous error message around platform_get_irq()

2021-06-10 Thread Shengjiu Wang
On Thu, Jun 10, 2021 at 12:02 PM Zhongjun Tan wrote: > > From: Tan Zhongjun > > The platform_get_irq() prints error message telling that interrupt is > missing, hence there is no need to duplicated that message. > > Signed-off-by: Tan Zhongjun Acked-by: Shengjiu Wang > --- >

Re: [FSL P50x0] KVM HV doesn't work anymore

2021-06-10 Thread Nicholas Piggin
Excerpts from Christian Zigotzky's message of June 7, 2021 5:21 pm: > On 02 June 2021 at 01:26pm, Christian Zigotzky wrote: >> On 20 May 2021 at 01:07am, Nicholas Piggin wrote: >>> Hmm, okay that probably rules out those notifier changes then. >>> Can you remind me were you able to rule these out

Re: [PATCH] ASoC:fsl_easrc:Remove superfluous error message around platform_get_irq()

2021-06-10 Thread Shengjiu Wang
On Thu, Jun 10, 2021 at 8:52 PM Zhongjun Tan wrote: > > From: Tan Zhongjun > > Clean up the check for irq.dev_err is superfluous as platform_get_irq() > already prints an error.Remove curly braces to confirm to styling > requirements. > > Signed-off-by: Tan Zhongjun Acked-by: Shengjiu Wang >

Re: [PATCH v2 3/4] powerpc/interrupt: Rename and lightly change syscall_exit_prepare_main()

2021-06-10 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of June 5, 2021 12:56 am: > Rename syscall_exit_prepare_main() into interrupt_exit_prepare_main() > > Make it static as it is not used anywhere else. > > Pass it the 'ret' so that it can 'or' it directly instead of > oring twice, once inside the function

Re: [PATCH v2 2/4] powerpc/interrupt: Refactor prep_irq_for_user_exit()

2021-06-10 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of June 5, 2021 12:56 am: > prep_irq_for_user_exit() is a superset of > prep_irq_for_kernel_enabled_exit(). > > Refactor it. I like the refactoring, but now prep_irq_for_user_exit() is calling prep_irq_for_kernel_enabled_exit(), which seems like the

Re: [PATCH v2 1/4] powerpc/interrupt: Interchange prep_irq_for_{kernel_enabled/user}_exit()

2021-06-10 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of June 5, 2021 12:56 am: > prep_irq_for_user_exit() is a superset of > prep_irq_for_kernel_enabled_exit(). In order to allow refactoring in > following patch, interchange the two as prep_irq_for_user_exit() will > call prep_irq_for_kernel_enabled_exit(). >

Re: [PATCH] btrfs: Disable BTRFS on platforms having 256K pages

2021-06-10 Thread Chris Mason
> On Jun 10, 2021, at 1:23 AM, Christophe Leroy > wrote: > > With a config having PAGE_SIZE set to 256K, BTRFS build fails > with the following message > > include/linux/compiler_types.h:326:38: error: call to > '__compiletime_assert_791' declared with attribute error: BUILD_BUG_ON >

[PATCH] powerpc/tau: Remove redundant parameter in alloc_workqueue() call

2021-06-10 Thread Finn Thain
This avoids an (optional) compiler warning: arch/powerpc/kernel/tau_6xx.c: In function 'TAU_init': arch/powerpc/kernel/tau_6xx.c:204:30: error: too many arguments for format [-Werror=format-extra-args] tau_workq = alloc_workqueue("tau", WQ_UNBOUND, 1, 0); Reported-by: Naresh Kamboju Fixes: