[Bug 215217] Kernel fails to boot at an early stage when built with GCC_PLUGIN_LATENT_ENTROPY=y (PowerMac G4 3,6)

2021-12-17 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215217 --- Comment #14 from Erhard F. (erhar...@mailbox.org) --- (In reply to Christophe Leroy from comment #13) > arch/powerpc/lib/feature-fixups.o also need DISABLE_LATENT_ENTROPY_PLUGIN, > see extract from you vmlinux below I can confirm this works,

[PATCH] powerpc: use swap() to make code cleaner

2021-12-17 Thread davidcomponentone
From: Yang Guang Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: David Yang Signed-off-by: Yang Guang --- arch/powerpc/platforms/powermac/pic.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

Re: [PATCH/RFC] mm: add and use batched version of __tlb_remove_table()

2021-12-17 Thread Peter Zijlstra
On Fri, Dec 17, 2021 at 11:19:10AM +0300, Nikita Yushchenko wrote: > When batched page table freeing via struct mmu_table_batch is used, the > final freeing in __tlb_remove_table_free() executes a loop, calling > arch hook __tlb_remove_table() to free each table individually. > > Shift that loop

Re: [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity()

2021-12-17 Thread Nathan Chancellor
Hi Thomas, On Fri, Dec 10, 2021 at 11:19:26PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > Replace open coded MSI descriptor chasing and use the proper accessor > functions instead. > > Signed-off-by: Thomas Gleixner > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Jason

[PATCH] powerpc: dts: Remove "spidev" nodes

2021-12-17 Thread Rob Herring
"spidev" is not a real device, but a Linux implementation detail. It has never been documented either. The kernel has WARNed on the use of it for over 6 years. Time to remove its usage from the tree. Cc: Mark Brown Signed-off-by: Rob Herring --- arch/powerpc/boot/dts/digsy_mtc.dts | 8

[PATCH] powerpc/mpic: Use bitmap_zalloc() when applicable

2021-12-17 Thread Christophe JAILLET
'mpic->protected' is a bitmap. So use 'bitmap_zalloc()' to simplify code and improve the semantic, instead of hand writing it. Signed-off-by: Christophe JAILLET --- arch/powerpc/sysdev/mpic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/mpic.c

Re: [PATCH/RFC] mm: add and use batched version of __tlb_remove_table()

2021-12-17 Thread Sam Ravnborg
Hi Nikita, How about adding the following to tlb.h: #ifndef __tlb_remove_tables static void __tlb_remove_tables(...) { } #endif And then the few archs that want to override __tlb_remove_tables needs to do a #define __tlb_remove_tables __tlb_remove_tables static void

Re: [PATCH/RFC] mm: add and use batched version of __tlb_remove_table()

2021-12-17 Thread Dave Hansen
On 12/17/21 12:19 AM, Nikita Yushchenko wrote: > When batched page table freeing via struct mmu_table_batch is used, the > final freeing in __tlb_remove_table_free() executes a loop, calling > arch hook __tlb_remove_table() to free each table individually. > > Shift that loop down to archs. This

Re: [PATCH v3 11/12] lkdtm: Fix execute_[user]_location()

2021-12-17 Thread Helge Deller
On 12/17/21 12:49, Christophe Leroy wrote: > Hi Kees, > > Le 17/10/2021 à 14:38, Christophe Leroy a écrit : >> execute_location() and execute_user_location() intent >> to copy do_nothing() text and execute it at a new location. >> However, at the time being it doesn't copy do_nothing() function >>

Re: linux-next: manual merge of the audit tree with the powerpc tree

2021-12-17 Thread Christophe Leroy
Le 17/12/2021 à 00:04, Paul Moore a écrit : > On Thu, Dec 16, 2021 at 4:08 AM Christophe Leroy > wrote: >> Thanks Cédric, I've now been able to install debian PPC32 port of DEBIAN >> 11 on QEMU and run the tests. >> >> I followed instructions in file README.md provided in the test suite. >> I

Re: [PATCH v2 00/13] Unify asm/unaligned.h around struct helper

2021-12-17 Thread Segher Boessenkool
On Fri, Dec 17, 2021 at 12:34:53PM +, David Laight wrote: > From: Segher Boessenkool > > Sent: 16 December 2021 18:56 > ... > > > The only remaining problem here is reinterpreting a char* pointer to a > > > u32*, e.g., for accessing the IP address in an Ethernet frame when > > > NET_IP_ALIGN

RE: [PATCH v2 00/13] Unify asm/unaligned.h around struct helper

2021-12-17 Thread David Laight
From: Segher Boessenkool > Sent: 16 December 2021 18:56 ... > > The only remaining problem here is reinterpreting a char* pointer to a > > u32*, e.g., for accessing the IP address in an Ethernet frame when > > NET_IP_ALIGN == 2, which could suffer from the same UB problem again, > > as I

Re: [PATCH v3 11/12] lkdtm: Fix execute_[user]_location()

2021-12-17 Thread Christophe Leroy
Hi Kees, Le 17/10/2021 à 14:38, Christophe Leroy a écrit : > execute_location() and execute_user_location() intent > to copy do_nothing() text and execute it at a new location. > However, at the time being it doesn't copy do_nothing() function > but do_nothing() function descriptor which still

[PATCH/RFC] mm: add and use batched version of __tlb_remove_table()

2021-12-17 Thread Nikita Yushchenko
When batched page table freeing via struct mmu_table_batch is used, the final freeing in __tlb_remove_table_free() executes a loop, calling arch hook __tlb_remove_table() to free each table individually. Shift that loop down to archs. This allows archs to optimize it, by freeing multiple tables

[PATCH v6 14/14] powerpc: Simplify and move arch_randomize_brk()

2021-12-17 Thread Christophe Leroy
arch_randomize_brk() is only needed for hash on book3s/64, for other platforms the one provided by the default mmap layout is good enough. Move it to hash_utils.c and use randomize_page() like the generic one. And properly opt out the radix case instead of making an assumption on

[PATCH v6 13/14] powerpc/mm: Convert to default topdown mmap layout

2021-12-17 Thread Christophe Leroy
Select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT and remove arch/powerpc/mm/mmap.c This change reuses the generic framework added by commit 67f3977f805b ("arm64, mm: move generic mmap layout functions to mm") without any functional change. Comparison between powerpc implementation and the

[PATCH v6 12/14] powerpc/mm: Enable full randomisation of memory mappings

2021-12-17 Thread Christophe Leroy
Do like most other architectures and provide randomisation also to "legacy" memory mappings, by adding the random factor to mm->mmap_base in arch_pick_mmap_layout(). See commit 8b8addf891de ("x86/mm/32: Enable full randomization on i386 and X86_32") for all explanations and benefits of that mmap

[PATCH v6 10/14] powerpc/mm: Use generic_hugetlb_get_unmapped_area()

2021-12-17 Thread Christophe Leroy
Use the generic version of arch_hugetlb_get_unmapped_area() which is now available at all time. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 4 -- arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 55 arch/powerpc/mm/hugetlbpage.c

[PATCH v6 09/14] powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area()

2021-12-17 Thread Christophe Leroy
Use the generic version of arch_get_unmapped_area() which is now available at all time instead of its copy radix__arch_get_unmapped_area() To allow that for PPC64, add arch_get_mmap_base() and arch_get_mmap_end() macros. Instead of setting mm->get_unmapped_area() to either

[PATCH v6 11/14] powerpc/mm: Move get_unmapped_area functions to slice.c

2021-12-17 Thread Christophe Leroy
hugetlb_get_unmapped_area() is now identical to the generic version if only RADIX is enabled, so move it to slice.c and let it fallback on the generic one when HASH MMU is not compiled in. Do the same with arch_get_unmapped_area() and arch_get_unmapped_area_topdown(). Signed-off-by: Christophe

[PATCH v6 08/14] powerpc/mm: Remove CONFIG_PPC_MM_SLICES

2021-12-17 Thread Christophe Leroy
CONFIG_PPC_MM_SLICES is always selected by hash book3s/64. CONFIG_PPC_MM_SLICES is never selected by other platforms. Remove it. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin --- arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/paca.h| 7 ---

[PATCH v6 07/14] powerpc/mm: Make slice specific to book3s/64

2021-12-17 Thread Christophe Leroy
Since commit 555904d07eef ("powerpc/8xx: MM_SLICE is not needed anymore") only book3s/64 selects CONFIG_PPC_MM_SLICES. Move slice.c into mm/book3s64/ Move necessary stuff in asm/book3s/64/slice.h and remove asm/slice.h Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin ---

[PATCH v6 06/14] powerpc/mm: Move vma_mmu_pagesize()

2021-12-17 Thread Christophe Leroy
vma_mmu_pagesize() is only required for slices, otherwise there is a generic weak version doing the exact same thing. Move it to slice.c Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin --- arch/powerpc/mm/hugetlbpage.c | 11 --- arch/powerpc/mm/slice.c | 9

[PATCH v6 05/14] sizes.h: Add SZ_1T macro

2021-12-17 Thread Christophe Leroy
Today drivers/pci/controller/pci-xgene.c defines SZ_1T Move it into linux/sizes.h so that it can be re-used elsewhere. Cc: Toan Le Cc: linux-...@vger.kernel.org Signed-off-by: Christophe Leroy Reviewed-by: Krzysztof Wilczyński Acked-by: Bjorn Helgaas --- drivers/pci/controller/pci-xgene.c |

[PATCH v6 04/14] mm, hugetlbfs: Allow for "high" userspace addresses

2021-12-17 Thread Christophe Leroy
This is a complement of f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") for hugetlb. This patch adds support for "high" userspace addresses that are optionally supported on the system and have to be requested via a hint mechanism ("high" addr parameter to mmap). Architectures

[PATCH v6 03/14] mm: Add len and flags parameters to arch_get_mmap_end()

2021-12-17 Thread Christophe Leroy
Powerpc needs flags and len to make decision on arch_get_mmap_end(). So add them as parameters to arch_get_mmap_end(). Signed-off-by: Christophe Leroy Cc: Steve Capper Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/processor.h | 4 ++-- mm/mmap.c | 6

[PATCH v6 02/14] mm, hugetlbfs: Allow an arch to always use generic versions of get_unmapped_area functions

2021-12-17 Thread Christophe Leroy
Unlike most architectures, powerpc can only define at runtime if it is going to use the generic arch_get_unmapped_area() or not. Today, powerpc has a copy of the generic arch_get_unmapped_area() because when selection HAVE_ARCH_UNMAPPED_AREA the generic arch_get_unmapped_area() is not available.

[PATCH v6 01/14] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT

2021-12-17 Thread Christophe Leroy
Commit e7142bf5d231 ("arm64, mm: make randomization selected by generic topdown mmap layout") introduced a default version of arch_randomize_brk() provided when CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT is selected. powerpc could select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT but needs to

[PATCH v6 00/14] Convert powerpc to default topdown mmap layout

2021-12-17 Thread Christophe Leroy
Rebased on top of powerpc/next branch This series converts powerpc to default topdown mmap layout. powerpc requires its own arch_get_unmapped_area() only when slices are needed, which is only for book3s/64. First part of the series moves slices into book3s/64 specific directories and cleans up

Re: [PATCH v2 1/2] powerpc/set_memory: Avoid spinlock recursion in change_page_attr()

2021-12-17 Thread Maxime Bizon
On Thu, 2021-12-16 at 17:47 +, Christophe Leroy wrote: Tested-by: Maxime Bizon Now running fine with every CONFIG_DEBUG_xxx enabled, thanks! -- Maxime