Re: [RFC 00/20] TLB batching consolidation and enhancements

2021-02-02 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of February 1, 2021 10:44 pm: > On Sun, Jan 31, 2021 at 07:57:01AM +, Nadav Amit wrote: >> > On Jan 30, 2021, at 7:30 PM, Nicholas Piggin wrote: > >> > I'll go through the patches a bit more closely when they all come >> > through. Sparc and powerpc of

Re: [RFC 11/20] mm/tlb: remove arch-specific tlb_start/end_vma()

2021-02-02 Thread Nadav Amit
> On Feb 1, 2021, at 10:41 PM, Nicholas Piggin wrote: > > Excerpts from Peter Zijlstra's message of February 1, 2021 10:09 pm: >> I also don't think AGRESSIVE_FLUSH_BATCHING quite captures what it does. >> How about: >> >> CONFIG_MMU_GATHER_NO_PER_VMA_FLUSH > > Yes please, have to have des

Re: [PATCH] powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64 semantics

2021-02-02 Thread Nicholas Piggin
Excerpts from Raoni Fassina Firmino's message of February 2, 2021 6:05 am: > Tested on powerpc64 and powerpc64le, with a glibc build and running the > affected glibc's testcase[2], inspected that glibc's backtrace() now gives > the correct result and gdb backtrace also keeps working as before. > >

[powerpc:merge] BUILD SUCCESS a2311d1e2b5ea0e77dcdd35fffb58b035da202b6

2021-02-02 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge branch HEAD: a2311d1e2b5ea0e77dcdd35fffb58b035da202b6 Automatic merge of 'fixes' into merge (2021-01-31 22:08) elapsed time: 2645m configs tested: 136 configs skipped: 2 The following configs have been built

[powerpc:fixes-test] BUILD SUCCESS 66f0a9e058fad50e569ad752be72e52701991fd5

2021-02-02 Thread kernel test robot
allnoconfig x86_64 randconfig-a001-20210201 x86_64 randconfig-a002-20210201 x86_64 randconfig-a004-20210201 x86_64 randconfig-a003-20210201 i386 randconfig-a001-20210202 i386 randconfig-a005-20210202 i386

[powerpc:next] BUILD SUCCESS 6895c5ba7bdcc55eacad03cf309ab23be63b9cac

2021-02-02 Thread kernel test robot
-20210201 x86_64 randconfig-a003-20210201 i386 randconfig-a001-20210202 i386 randconfig-a005-20210202 i386 randconfig-a003-20210202 i386 randconfig-a006-20210202 i386 randconfig-a002-20210202 i386

[powerpc:next-test] BUILD SUCCESS WITH WARNING 30133c32d19c678dbd9da28ace3aac35eb5dd4c9

2021-02-02 Thread kernel test robot
config-a016-20210131 x86_64 randconfig-a012-20210131 x86_64 randconfig-a013-20210131 x86_64 randconfig-a013-20210202 x86_64 randconfig-a014-20210202 x86_64 randconfig-a015-20210202 x86_64 randconfig-

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

2021-02-02 Thread Aneesh Kumar K.V
pmd/pud_populate is the right interface to be used to set the respective page table entries. Some architectures 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: Aneesh Kumar K.V

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

2021-02-02 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. Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/mremap_test.c | 113 --- 1 file changed, 61 insertions(+), 52 deletions

[RFC PATCH 4/6] mm/mremap: Use mmu gather interface instead of flush_tlb_range

2021-02-02 Thread Aneesh Kumar K.V
Some architectures do have the concept of page walk cache and only mmu gather interface supports flushing them. A fast mremap that involves moving page table pages instead of copying pte entries should flush page walk cache since the old translation cache is no more valid. Hence switch to mm gather

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

2021-02-02 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. Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/mremap_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[RFC PATCH 5/6] mm/mremap: Allow arch runtime override

2021-02-02 Thread Aneesh Kumar K.V
Architectures like ppc64 can only support faster mremap only with radix translation. Hence allow a runtime check w.r.t support for fast mremap. Signed-off-by: Aneesh Kumar K.V --- arch/arm64/include/asm/tlb.h | 6 ++ arch/powerpc/include/asm/tlb.h | 6 ++ arch/x86/include/asm/tlb.h

[RFC PATCH 6/6] powerpc/mm: Enable move pmd/pud

2021-02-02 Thread Aneesh Kumar K.V
mremap HAVE_MOVE_PMD/PUD optimization time comparison for 1GB region: 1GB mremap - Source PTE-aligned, Destination PTE-aligned mremap time: 1114318ns 1GB mremap - Source PMD-aligned, Destination PMD-aligned mremap time: 1097715ns 1GB mremap - Source PUD-aligned, Destinatio

[PATCH kernel] powerpc/uaccess: Skip might_fault() when user access is enabled

2021-02-02 Thread Alexey Kardashevskiy
The amount of code executed with enabled user space access (unlocked KUAP) should be minimal. However with CONFIG_PROVE_LOCKING or CONFIG_DEBUG_ATOMIC_SLEEP enabled, might_fault() may end up replaying interrupts which in turn may access the user space and forget to restore the KUAP state. The prob

[PATCH kernel] powerpc/kuap: Restore AMR after replaying soft interrupts

2021-02-02 Thread Alexey Kardashevskiy
Since de78a9c "powerpc: Add a framework for Kernel Userspace Access Protection", user access helpers call user_{read|write}_access_{begin|end} when user space access is allowed. 890274c "powerpc/64s: Implement KUAP for Radix MMU" made the mentioned helpers program a AMR special register to allow s

Re: [RFC 11/20] mm/tlb: remove arch-specific tlb_start/end_vma()

2021-02-02 Thread Peter Zijlstra
On Tue, Feb 02, 2021 at 07:20:55AM +, Nadav Amit wrote: > Arm does not define tlb_end_vma, and consequently it flushes the TLB after > each VMA. I suspect it is not intentional. ARM is one of those that look at the VM_EXEC bit to explicitly flush ITLB IIRC, so it has to.

Re: [PATCH] powerpc/fault: fix wrong KUAP fault for IO_URING

2021-02-02 Thread Nicholas Piggin
Excerpts from Aneesh Kumar K.V's message of February 2, 2021 4:30 pm: > On 2/2/21 11:50 AM, Christophe Leroy wrote: >> >> >> Le 02/02/2021 à 07:16, Aneesh Kumar K.V a écrit : >>> On 2/2/21 11:32 AM, Christophe Leroy wrote: Le 02/02/2021 à 06:55, Aneesh Kumar K.V a écrit : > Ane

Re: [RFC 11/20] mm/tlb: remove arch-specific tlb_start/end_vma()

2021-02-02 Thread Nadav Amit
> On Feb 2, 2021, at 1:31 AM, Peter Zijlstra wrote: > > On Tue, Feb 02, 2021 at 07:20:55AM +, Nadav Amit wrote: >> Arm does not define tlb_end_vma, and consequently it flushes the TLB after >> each VMA. I suspect it is not intentional. > > ARM is one of those that look at the VM_EXEC bit to

Re: [PATCH v11 01/13] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-02-02 Thread Nicholas Piggin
Excerpts from Ding Tianhong's message of January 28, 2021 1:13 pm: > On 2021/1/26 12:44, Nicholas Piggin wrote: >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture details, >> alignments, boot options, etc., which the

Re: [PATCH v7 42/42] powerpc/64s: power4 nap fixup in C

2021-02-02 Thread Michael Ellerman
Nicholas Piggin writes: > There is no need for this to be in asm, use the new intrrupt entry wrapper. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/include/asm/interrupt.h | 15 + > arch/powerpc/include/asm/processor.h | 1 + > arch/powerpc/include/asm/thread_info.h | 6 +

Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-02 Thread Miroslav Benes
On Mon, 1 Feb 2021, Christoph Hellwig wrote: > On Mon, Feb 01, 2021 at 02:37:12PM +0100, Miroslav Benes wrote: > > > > This change is not needed. (objname == NULL) means that we are > > > > interested only in symbols in "vmlinux". > > > > > > > > module_kallsyms_on_each_symbol(klp_find_callback,

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

2021-02-02 Thread Peter Zijlstra
On Tue, Feb 02, 2021 at 02:41:13PM +0530, Aneesh Kumar K.V wrote: > pmd/pud_populate is the right interface to be used to set the respective > page table entries. Some architectures 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

Re: [RFC 11/20] mm/tlb: remove arch-specific tlb_start/end_vma()

2021-02-02 Thread Peter Zijlstra
On Tue, Feb 02, 2021 at 09:54:36AM +, Nadav Amit wrote: > > On Feb 2, 2021, at 1:31 AM, Peter Zijlstra wrote: > > > > On Tue, Feb 02, 2021 at 07:20:55AM +, Nadav Amit wrote: > >> Arm does not define tlb_end_vma, and consequently it flushes the TLB after > >> each VMA. I suspect it is not

[PATCH v12 00/14] huge vmalloc mappings

2021-02-02 Thread Nicholas Piggin
Should be getting close now. No doubt there will be a few more things but I can do incremental fixes for small things if this gets into -mm. Thanks, Nick Since v11: - ARM compile fix (patch 1) - debug_vm_pgtable compile fix Since v10: - Fixed code style, most > 80 colums, tweak patch titles, etc

[PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Nicholas Piggin
ARM uses its own PMD folding scheme which is missing pud_page which should just pass through to pmd_page. Move this from the 3-level page table to common header. Cc: Russell King Cc: Ding Tianhong Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm/include/asm/

[PATCH v12 02/14] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-02-02 Thread Nicholas Piggin
vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. Whether or not a vmap is huge depends on the architecture details, alignments, boot options, etc., which the caller can not be expected to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. This change teaches vmallo

[PATCH v12 03/14] mm: apply_to_pte_range warn and fail if a large pte is encountered

2021-02-02 Thread Nicholas Piggin
apply_to_pte_range might mistake a large pte for bad, or treat it as a page table, resulting in a crash or corruption. Add a test to warn and return error if large entries are found. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/memory.c | 66

[PATCH v12 04/14] mm/vmalloc: rename vmap_*_range vmap_pages_*_range

2021-02-02 Thread Nicholas Piggin
The vmalloc mapper operates on a struct page * array rather than a linear physical address, re-name it to make this distinction clear. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 1 file changed, 8 insertions(+),

[PATCH v12 05/14] mm/ioremap: rename ioremap_*_range to vmap_*_range

2021-02-02 Thread Nicholas Piggin
This will be used as a generic kernel virtual mapping function, so re-name it in preparation. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/ioremap.c | 64 +++- 1 file changed, 33 insertions(+), 31 d

[PATCH v12 06/14] mm: HUGE_VMAP arch support cleanup

2021-02-02 Thread Nicholas Piggin
This changes the awkward approach where architectures provide init functions to determine which levels they can provide large mappings for, to one where the arch is queried for each call. This removes code and indirection, and allows constant-folding of dead code for unsupported levels. This also

[PATCH v12 07/14] powerpc: inline huge vmap supported functions

2021-02-02 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h | 19 ---

[PATCH v12 08/14] arm64: inline huge vmap supported functions

2021-02-02 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm

[PATCH v12 09/14] x86: inline huge vmap supported functions

2021-02-02 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/x86/include/asm/vmallo

[PATCH v12 10/14] mm/vmalloc: provide fallback arch huge vmap support functions

2021-02-02 Thread Nicholas Piggin
If an architecture doesn't support a particular page table level as a huge vmap page size then allow it to skip defining the support query function. Suggested-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 7 +++ arch/powerpc/include/asm/vmall

[PATCH v12 11/14] mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c

2021-02-02 Thread Nicholas Piggin
This is a generic kernel virtual memory mapper, not specific to ioremap. Code is unchanged other than making vmap_range non-static. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- include/linux/vmalloc.h | 3 + mm/ioremap.c| 203 -

[PATCH v12 12/14] mm/vmalloc: add vmap_range_noflush variant

2021-02-02 Thread Nicholas Piggin
As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 +--- 1 file changed, 13 insertions(+), 3 de

[PATCH v12 13/14] mm/vmalloc: Hugepage vmalloc mappings

2021-02-02 Thread Nicholas Piggin
Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC enables support on architectures that define HAVE_ARCH_HUGE_VMAP and supports PMD sized vmap mappings. vmalloc will attempt to allocate PMD-sized pages if allocating PMD size or larger, and fall back to small pages if that wa

[PATCH v12 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-02-02 Thread Nicholas Piggin
This reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%, due to vfs hashes being allocated with 2MB pages. Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- .../admin-guide/

Re: [PATCH] powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64 semantics

2021-02-02 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from Raoni Fassina Firmino's message of February 2, 2021 6:05 am: >> Tested on powerpc64 and powerpc64le, with a glibc build and running the >> affected glibc's testcase[2], inspected that glibc's backtrace() now gives >> the correct result and gdb backtrace also

Re: [PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Russell King - ARM Linux admin
On Tue, Feb 02, 2021 at 09:05:02PM +1000, Nicholas Piggin wrote: > diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h > index c02f24400369..d63a5bb6bd0c 100644 > --- a/arch/arm/include/asm/pgtable.h > +++ b/arch/arm/include/asm/pgtable.h > @@ -166,6 +166,9 @@ extern struct

Re: [PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Ding Tianhong
On 2021/2/2 19:13, Russell King - ARM Linux admin wrote: > On Tue, Feb 02, 2021 at 09:05:02PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h >> index c02f24400369..d63a5bb6bd0c 100644 >> --- a/arch/arm/include/asm/pgtable.h >> +++ b/arc

Re: [PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Ding Tianhong
On 2021/2/2 19:47, Ding Tianhong wrote: > On 2021/2/2 19:13, Russell King - ARM Linux admin wrote: >> On Tue, Feb 02, 2021 at 09:05:02PM +1000, Nicholas Piggin wrote: >>> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h >>> index c02f24400369..d63a5bb6bd0c 100644 >>> ---

Re: [PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Russell King - ARM Linux admin
On Tue, Feb 02, 2021 at 07:47:04PM +0800, Ding Tianhong wrote: > On 2021/2/2 19:13, Russell King - ARM Linux admin wrote: > > On Tue, Feb 02, 2021 at 09:05:02PM +1000, Nicholas Piggin wrote: > >> diff --git a/arch/arm/include/asm/pgtable.h > >> b/arch/arm/include/asm/pgtable.h > >> index c02f24400

[PATCH 03/13] module: unexport find_module and module_mutex

2021-02-02 Thread Christoph Hellwig
find_module is not used by modular code any more, and random driver code has no business calling it to start with. Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes --- kernel/module.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 4bf30e

module loader dead code removal and cleanups v3

2021-02-02 Thread Christoph Hellwig
Hi all, this series removes support for long term unused export types and cleans up various loose ends in the module loader. Changes since v2: - clean up klp_find_object_symbol a bit - remove the now unused module_assert_mutex helper Changes since v1: - move struct symsearch to module.c - r

[PATCH 02/13] drm: remove drm_fb_helper_modinit

2021-02-02 Thread Christoph Hellwig
drm_fb_helper_modinit has a lot of boilerplate for what is not very simple functionality. Just open code it in the only caller using IS_ENABLED and IS_MODULE, and skip the find_module check as a request_module is harmless if the module is already loaded (and not other caller has this find_module c

[PATCH 01/13] powerpc/powernv: remove get_cxl_module

2021-02-02 Thread Christoph Hellwig
The static inline get_cxl_module function is entirely unused since commit 8bf6b91a5125a ("Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"), so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Andrew Donnellan --- arch/powerpc/platforms/powernv/pci-cxl.c | 22

[PATCH 04/13] module: use RCU to synchronize find_module

2021-02-02 Thread Christoph Hellwig
Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead of module_mutex. Signed-off-by: Christoph Hellwig Reviewed-by: Petr Mladek Acked-by: Mirosl

[PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-02 Thread Christoph Hellwig
Require an explicit call to module_kallsyms_on_each_symbol to look for symbols in modules instead of the call from kallsyms_on_each_symbol, and acquire module_mutex inside of module_kallsyms_on_each_symbol instead of leaving that up to the caller. Note that this slightly changes the behavior for t

[PATCH 06/13] kallsyms: only build {, module_}kallsyms_on_each_symbol when required

2021-02-02 Thread Christoph Hellwig
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used by the livepatching code, so don't build them if livepatching is not enabled. Signed-off-by: Christoph Hellwig --- include/linux/kallsyms.h | 17 - include/linux/module.h | 16 kernel/kall

[PATCH 07/13] module: mark module_mutex static

2021-02-02 Thread Christoph Hellwig
Except for two lockdep asserts module_mutex is only used in module.c. Remove the two asserts given that the functions they are in are not exported and just called from the module code, and mark module_mutex static. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 2 -- kernel/module

[PATCH 08/13] module: remove each_symbol_in_section

2021-02-02 Thread Christoph Hellwig
each_symbol_in_section just contains a trivial loop over its arguments. Just open code the loop in the two callers. Signed-off-by: Christoph Hellwig --- kernel/module.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/module.c b/kernel/mod

[PATCH 09/13] module: merge each_symbol_section into find_symbol

2021-02-02 Thread Christoph Hellwig
each_symbol_section is only called by find_symbol, so merge the two functions. Signed-off-by: Christoph Hellwig --- kernel/module.c | 148 ++-- 1 file changed, 69 insertions(+), 79 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index b050

[PATCH 11/13] module: move struct symsearch to module.c

2021-02-02 Thread Christoph Hellwig
struct symsearch is only used inside of module.h, so move the definition out of module.h. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 11 --- kernel/module.c| 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/module.h

[PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-02 Thread Christoph Hellwig
Simplify the calling convention by passing the find_symbol_args structure to find_symbol instead of initializing it inside the function. Signed-off-by: Christoph Hellwig --- kernel/module.c | 113 ++-- 1 file changed, 52 insertions(+), 61 deletions(-)

[PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE

2021-02-02 Thread Christoph Hellwig
As far as I can tell this has never been used at all, and certainly not any time recently. Signed-off-by: Christoph Hellwig --- arch/x86/tools/relocs.c | 4 ++-- include/asm-generic/vmlinux.lds.h | 14 -- include/linux/export.h| 1 - include/linux/module.h

[PATCH 13/13] module: remove EXPORT_UNUSED_SYMBOL*

2021-02-02 Thread Christoph Hellwig
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the unused functionality as we generally just remove unused code anyway. Signed-off-by: Christoph Hellwig --- arch/arm/configs/bcm2835_defconfig | 1 - arch/arm/configs/mxs_defconfig | 1 - arch/mips/configs/nlm

[PATCH 1/2] powerpc/64: Make stack tracing work during very early boot

2021-02-02 Thread Michael Ellerman
If we try to stack trace very early during boot, either due to a WARN/BUG or manual dump_stack(), we will oops in valid_emergency_stack() when we try to dereference the paca_ptrs array. The fix is simple, we just return false if paca_ptrs isn't allocated yet. The stack pointer definitely isn't par

[PATCH 2/2] powerpc/64s: Handle program checks in wrong endian during early boot

2021-02-02 Thread Michael Ellerman
There's a short window during boot where although the kernel is running little endian, any exceptions will cause the CPU to switch back to big endian. This situation persists until we call configure_exceptions(), which calls either the hypervisor or OPAL to configure the CPU so that exceptions will

Re: [PATCH v12 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-02-02 Thread kernel test robot
submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/huge-vmalloc-mappings/20210202-190833 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next confi

Re: [PATCH 06/13] kallsyms: only build {, module_}kallsyms_on_each_symbol when required

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used > by the livepatching code, so don't build them if livepatching is not > enabled. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 07/13] module: mark module_mutex static

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > Except for two lockdep asserts module_mutex is only used in module.c. > Remove the two asserts given that the functions they are in are not > exported and just called from the module code, and mark module_mutex > static. > > Signed-off-by: Christoph

Re: [PATCH 08/13] module: remove each_symbol_in_section

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > each_symbol_in_section just contains a trivial loop over its arguments. > Just open code the loop in the two callers. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 09/13] module: merge each_symbol_section into find_symbol

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > each_symbol_section is only called by find_symbol, so merge the two > functions. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 11/13] module: move struct symsearch to module.c

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > struct symsearch is only used inside of module.h, so move the definition > out of module.h. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > As far as I can tell this has never been used at all, and certainly > not any time recently. Right, I've always wondered about this one. > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 13/13] module: remove EXPORT_UNUSED_SYMBOL*

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the > unused functionality as we generally just remove unused code anyway. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH] powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64 semantics

2021-02-02 Thread Raoni Fassina Firmino
On Tue, Feb 02, 2021 at 05:41:35PM +1000, Nicholas Piggin wrote: > Are you planning to update glibc to cope with this as well? Any idea > about musl? If so, including version numbers would be good (not that > it's really a problem to carry this patch around). For glibc from the beginning I planne

Re: module loader dead code removal and cleanups v3

2021-02-02 Thread Jessica Yu
+++ Christoph Hellwig [02/02/21 13:13 +0100]: Hi all, this series removes support for long term unused export types and cleans up various loose ends in the module loader. Changes since v2: - clean up klp_find_object_symbol a bit - remove the now unused module_assert_mutex helper Changes since

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

2021-02-02 Thread Aneesh Kumar K.V
On 2/2/21 4:17 PM, Peter Zijlstra wrote: On Tue, Feb 02, 2021 at 02:41:13PM +0530, Aneesh Kumar K.V wrote: pmd/pud_populate is the right interface to be used to set the respective page table entries. Some architectures do assume that set_pmd/pud_at can only be used to set a hugepage PTE. Since w

Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-02 Thread Miroslav Benes
> void *__symbol_get(const char *symbol) > { > - struct module *owner; > - const struct kernel_symbol *sym; > + struct find_symbol_arg fsa = { > + .name = symbol, > + .gplok = true, > + .warn = true, > + }; > > preempt_disable(); >

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

2021-02-02 Thread Aneesh Kumar K.V
On 2/2/21 6:59 PM, Li Xinhai wrote: what is the overall purpose of this patch set? maybe need a cover letter? The goal of the patch series was to enable MOVE_PMD/PUD on ppc64. But the series itself achieves that by fixing the existing code rather than adding changes to arch/ppc64. With that

[PATCH] powerpc/pkeys: Remove unused code

2021-02-02 Thread Sandipan Das
This removes arch_supports_pkeys(), arch_usable_pkeys() and thread_pkey_regs_*() which are remnants from the following: commit 06bb53b33804 ("powerpc: store and restore the pkey state across context switches") commit 2cd4bd192ee9 ("powerpc/pkeys: Fix handling of pkey state across fork()") commit

Re: module loader dead code removal and cleanups v3

2021-02-02 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 03:37:04PM +0100, Jessica Yu wrote: > The patchset looks good so far. After Miroslav's comments are > addressed, I'll wait an extra day or two in case there are more > comments before queueing them onto modules-next. I can take the first > two patches as well provided the ac

Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-02 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 03:07:51PM +0100, Miroslav Benes wrote: > > preempt_disable(); > > - sym = find_symbol(symbol, &owner, NULL, NULL, true, true); > > - if (sym && strong_try_module_get(owner)) > > - sym = NULL; > > + if (!find_symbol(&fsa) || !strong_try_module_get(fsa.own

Re: [PATCH] ASoC: fsl_spdif: Utilize the defined parameter to clear code

2021-02-02 Thread Mark Brown
On Thu, 28 Jan 2021 19:27:14 +0800, Tang Bin wrote: > Utilize the defined parameter 'dev' to make the code cleaner. Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: fsl_spdif: Utilize the defined parameter to clear code commit: 6

Re: module loader dead code removal and cleanups v3

2021-02-02 Thread Emil Velikov
Hi Jessica, On Tue, 2 Feb 2021 at 14:37, Jessica Yu wrote: > > +++ Christoph Hellwig [02/02/21 13:13 +0100]: > >Hi all, > > > >this series removes support for long term unused export types and > >cleans up various loose ends in the module loader. > > > >Changes since v2: > > - clean up klp_find_o

Re: [PATCH] arch: powerpc: kernel: Fix the spelling mismach to mismatch in head.44x.S

2021-02-02 Thread Randy Dunlap
On 2/2/21 1:37 AM, Bhaskar Chowdhury wrote: > > s/mismach/mismatch/ > > Signed-off-by: Bhaskar Chowdhury > --- > arch/powerpc/kernel/head_44x.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Randy Dunlap thanks. -- ~Randy

Re: [PATCH v12 06/14] mm: HUGE_VMAP arch support cleanup

2021-02-02 Thread kernel test robot
submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/huge-vmalloc-mappings/20210202-190833 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next conf

Re: [PATCH v4 11/23] powerpc/syscall: Rename syscall_64.c into syscall.c

2021-02-02 Thread Segher Boessenkool
On Tue, Feb 02, 2021 at 04:38:31PM +1000, Nicholas Piggin wrote: > > So to avoid confusion, I'll rename it. But I think "interrupt" is maybe not > > the right name. An > > interrupt most of the time refers to IRQ. > > That depends what you mean by interrupt and IRQ. In the PowerPC architecture,

Re: [PATCH v12 10/14] mm/vmalloc: provide fallback arch huge vmap support functions

2021-02-02 Thread kernel test robot
submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/huge-vmalloc-mappings/20210202-190833 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next con

[powerpc:next-test 102/117] arch/powerpc/kernel/tau_6xx.c:103:31: error: this old-style function definition is not preceded by a prototype

2021-02-02 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: a4d002e384ba1909c1c03799603f00c5909d6097 commit: f779391282ff7a95222000321b41823d86cf9aa1 [102/117] powerpc: convert interrupt handlers to use wrappers config: powerpc-randconfig-r003-20210202 (attached

Re: [PATCH v7 42/42] powerpc/64s: power4 nap fixup in C

2021-02-02 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of February 2, 2021 8:31 pm: > Nicholas Piggin writes: >> There is no need for this to be in asm, use the new intrrupt entry wrapper. >> >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/include/asm/interrupt.h | 15 + >> arch/powerpc/inc

Re: [PATCH kernel] powerpc/uaccess: Skip might_fault() when user access is enabled

2021-02-02 Thread Alexey Kardashevskiy
On 02/02/2021 20:14, Alexey Kardashevskiy wrote: The amount of code executed with enabled user space access (unlocked KUAP) should be minimal. However with CONFIG_PROVE_LOCKING or CONFIG_DEBUG_ATOMIC_SLEEP enabled, might_fault() may end up replaying interrupts which in turn may access the user

[PATCH] soc: fsl: guts: remove unneeded semicolon

2021-02-02 Thread Yang Li
Eliminate the following coccicheck warning: ./drivers/soc/fsl/guts.c:120:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/soc/fsl/guts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 3

Re: [PATCH v7 28/42] powerpc: convert interrupt handlers to use wrappers

2021-02-02 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of January 30, 2021 11:08 pm: > Signed-off-by: Nicholas Piggin powerpc: fix tau6xxx compile error in convert interrupt handlers to use wrappers This should fix the missing declaration compile error although it doesn't show up with my toolchain. --- arch

[PATCH kernel v2] powerpc/uaccess: Skip might_fault() when user access is enabled

2021-02-02 Thread Alexey Kardashevskiy
The amount of code executed with enabled user space access (unlocked KUAP) should be minimal. However with CONFIG_PROVE_LOCKING or CONFIG_DEBUG_ATOMIC_SLEEP enabled, might_fault() may end up replaying interrupts which in turn may access the user space and forget to restore the KUAP state. The prob

[powerpc:next-test 59/117] arch/powerpc/kernel/pci-common.c:1704:12: error: no previous prototype for function 'discover_phbs'

2021-02-02 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: a4d002e384ba1909c1c03799603f00c5909d6097 commit: 1f4165b859f7a32b147fe4cac2d558001ed7e1ee [59/117] powerpc/pci: Add ppc_md.discover_phbs() config: powerpc64-randconfig-r035-20210202 (attached as .config

Re: [PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Nicholas Piggin
Excerpts from Russell King - ARM Linux admin's message of February 2, 2021 9:13 pm: > On Tue, Feb 02, 2021 at 09:05:02PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h >> index c02f24400369..d63a5bb6bd0c 100644 >> --- a/arch/arm/includ

Re: [PATCH] tools/perf: Fix powerpc gap between kernel end and module start

2021-02-02 Thread Athira Rajeev
On 18-Jan-2021, at 3:51 PM, kajoljain wrote:On 1/12/21 3:08 PM, Jiri Olsa wrote:On Mon, Dec 28, 2020 at 09:14:14PM -0500, Athira Rajeev wrote:SNIPc2799370 b backtrace_flagc2799378 B radix_tree_node_cachepc2799380 B __bss_stopc27a B _endc0080389 t icmp_ch

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

2021-02-02 Thread Li Xinhai
what is the overall purpose of this patch set? maybe need a cover letter? On 2/2/21 5:11 PM, Aneesh Kumar K.V wrote: Instead of hardcoding 4K page size fetch it using sysconf(). For the performance measurements test still assume 2M and 1G are hugepage sizes. Signed-off-by: Aneesh Kumar K.V ---

[PATCH] arch: powerpc: kernel: Fix the spelling mismach to mismatch in head.44x.S

2021-02-02 Thread Bhaskar Chowdhury
s/mismach/mismatch/ Signed-off-by: Bhaskar Chowdhury --- arch/powerpc/kernel/head_44x.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S index 8e36718f3167..813fa305c33b 100644 --- a/arch/powerpc/kernel/head

[powerpc:next-test 102/117] arch/powerpc/kernel/tau_6xx.c:103:1: error: no previous prototype for function 'DEFINE_INTERRUPT_HANDLER_ASYNC'

2021-02-02 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: a4d002e384ba1909c1c03799603f00c5909d6097 commit: f779391282ff7a95222000321b41823d86cf9aa1 [102/117] powerpc: convert interrupt handlers to use wrappers config: powerpc64-randconfig-r035-20210202 (attached

[PATCH 1/3] powerpc/mm: Enable compound page check for both THP and HugeTLB

2021-02-02 Thread Aneesh Kumar K.V
THP config results in compound pages. Make sure the kernel enables the PageCompound() check with CONFIG_HUGETLB_PAGE disabled and CONFIG_TRANSPARENT_HUGEPAGE enabled. This makes sure we correctly flush the icache with THP pages. flush_dcache_icache_page only matter for platforms that don't support

[PATCH 2/3] powerpc/mm: Add PG_dcache_clean to indicate dcache clean state

2021-02-02 Thread Aneesh Kumar K.V
This just add a better name for PG_arch_1. No functional change in this patch. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/cacheflush.h | 6 ++ arch/powerpc/include/asm/kvm_ppc.h| 4 ++-- arch/powerpc/mm/book3s64/hash_utils.c | 4 ++-- arch/powerpc/mm/mem.c

[PATCH 3/3] powerpc/mm: Remove dcache flush from memory remove.

2021-02-02 Thread Aneesh Kumar K.V
We added dcache flush on memory add/remove in commit fb5924fddf9e ("powerpc/mm: Flush cache on memory hot(un)plug") to handle crashes on GPU hotplug. Instead of adding dcache flush in generic memory add/remove routine which is used even for regular memory, we should handle these devices specific fl

[PATCH 1/2] powerpc/64s: Fix pte update for kernel memory on radix

2021-02-02 Thread Jordan Niethe
The recommended sequence for updating a PTE from ISA Book III 6.10 Translation Update Synchronization Requirements is: *ptep = pte eieio tlbsync ptesync This needs to be done to order the update of the pte with subsequent accesses otherwise a spurious fault may be raised. radix__set_pte_at() doe

[PATCH 2/2] Revert "powerpc/64s: Disable STRICT_KERNEL_RWX"

2021-02-02 Thread Jordan Niethe
This reverts commit 8659a0e0efdd975c73355dbc033f79ba3b31e82c. Signed-off-by: Jordan Niethe --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 294108e0e5c6..a7113ee85994 100644 --- a/arch/powerpc/Kconfig +

[PATCH v2 1/3] powerpc: sstep: Fix load and update emulation

2021-02-02 Thread Sandipan Das
The Power ISA says that the fixed-point load and update instructions must neither use R0 for the base address (RA) nor have the destination (RT) and the base address (RA) as the same register. In these cases, the instruction is invalid. This applies to the following instructions. * Load Byte and

[PATCH v2 2/3] powerpc: sstep: Fix store and update emulation

2021-02-02 Thread Sandipan Das
The Power ISA says that the fixed-point store and update instructions must not use R0 for the base address (RA). In this case, the instruction is invalid. This applies to the following instructions. * Store Byte with Update (stbu) * Store Byte with Update Indexed (stbux) * Store Halfword with

  1   2   >