[PATCH v10 11/18] powerpc/32: Add KASAN support

2019-03-12 Thread Christophe Leroy
in a previous patch. An early mapping is set as soon as the kernel code has been relocated at its definitive place. Then the definitive mapping is set once paging is initialised. For modules, the shadow area is allocated at module_alloc(). Signed-off-by: Christophe Leroy --- arch/powerpc

[PATCH v10 12/18] powerpc/32s: move hash code patching out of MMU_init_hw()

2019-03-12 Thread Christophe Leroy
final hash table. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 3 +++ arch/powerpc/mm/mmu_decl.h| 1 + arch/powerpc/mm/ppc_mmu_32.c | 36 ++-- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/head_32.S

[PATCH v10 13/18] powerpc/32s: set up an early static hash table for KASAN.

2019-03-12 Thread Christophe Leroy
entry because of the _PAGE_HASHPTE flag which can't be common to several virt pages. This is done after memblock get available but before switching to the final hash table, otherwise there are issues with TLB flushing due to the shared entries. Signed-off-by: Christophe Leroy --- arch/po

[PATCH v10 14/18] powerpc/32s: map kasan zero shadow with PAGE_READONLY instead of PAGE_KERNEL_RO

2019-03-12 Thread Christophe Leroy
tains only zeroes. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/kasan/kasan_init_32.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/kasan/kasan_init_32.c b/arch/powerpc/mm/kasan/kasan_init_32.c index ba8361487075..0d62be3cba47 100644 --- a

[PATCH RFC v3 15/18] kasan: do not open-code addr_has_shadow

2019-03-12 Thread Christophe Leroy
of the shadow mapping. Reviewed-by: Andrew Donnellan Reviewed-by: Dmitry Vyukov Signed-off-by: Daniel Axtens Signed-off-by: Christophe Leroy --- mm/kasan/generic.c | 3 +-- mm/kasan/tags.c| 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/kasan/generic.c b/mm/kasan

[PATCH RFC v3 17/18] kasan: allow architectures to provide an outline readiness check

2019-03-12 Thread Christophe Leroy
ady()] Signed-off-by: Christophe Leroy --- include/linux/kasan.h | 4 mm/kasan/generic.c| 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/linux/kasan.h b/include/linux/kasan.h index f6261840f94c..a630d53f1a36 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -1

[PATCH RFC v3 16/18] kasan: allow architectures to manage the memory-to-shadow mapping

2019-03-12 Thread Christophe Leroy
Axtens Signed-off-by: Christophe Leroy --- include/linux/kasan.h | 2 ++ mm/kasan/generic.c| 2 +- mm/kasan/generic_report.c | 2 +- mm/kasan/kasan.h | 6 +- mm/kasan/report.c | 6 +++--- mm/kasan/tags.c | 2 +- 6 files changed, 13 insertions(+), 7 del

[PATCH RFC v3 18/18] powerpc: KASAN for 64bit Book3E

2019-03-12 Thread Christophe Leroy
ps://lwn.net/Articles/655642/ - Balbir's Book3S radix series: https://patchwork.ozlabs.org/patch/795211/ Cc: Christophe Leroy Cc: Aneesh Kumar K.V Cc: Balbir Singh Signed-off-by: Daniel Axtens [- Removed EXPORT_SYMBOL of the static key - Fixed most checkpatch problems - Rep

Re: [PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-12 Thread Christophe Leroy
Le 08/03/2019 à 11:54, Laurent Vivier a écrit : resize_hpt_for_hotplug() reports a warning when it cannot resize the hash page table ("Unable to resize hash page table to target order") but in some cases it's not a problem and can make user thinks something has not worked properly. This patch

Re: [PATCH RFC v3 18/18] powerpc: KASAN for 64bit Book3E

2019-03-13 Thread Christophe Leroy
from Daniel's RFC v2 ? Christophe Le 12/03/2019 à 23:16, Christophe Leroy a écrit : From: Daniel Axtens Wire up KASAN. Only outline instrumentation is supported. The KASAN shadow area is mapped into vmemmap space: 0x8000 0400 to 0x8000 0600 . To do this we require that vmemmap

Re: [PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-13 Thread Christophe Leroy
Le 13/03/2019 à 09:01, Laurent Vivier a écrit : On 13/03/2019 07:03, Christophe Leroy wrote: Le 08/03/2019 à 11:54, Laurent Vivier a écrit : resize_hpt_for_hotplug() reports a warning when it cannot resize the hash page table ("Unable to resize hash page table to target order&quo

Re: [PATCH RFC v3 18/18] powerpc: KASAN for 64bit Book3E

2019-03-13 Thread Christophe Leroy
Any, the build is clean, see http://kisskb.ellerman.id.au/kisskb/head/3e97aba429c769bd99ccd8d6f16eda98f7d378a7/ Only s390 defconfig and powerpc randconfig failed for unrelated reasons. Christophe Le 13/03/2019 à 08:02, Christophe Leroy a écrit : Why does snowpatch reports not being able to

Re: [PATCH 1/1] arch/powerpc: Rework local_paca to avoid LTO warnings

2019-03-13 Thread Christophe Leroy
Hello, Le 13/03/2019 à 04:42, Alastair D'Silva a écrit : From: Alastair D'Silva When building an LTO kernel, the existing code generates warnings: ./arch/powerpc/include/asm/paca.h:37:30: warning: register of ‘local_paca’ used for multiple global register variables register

Re: [PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-13 Thread Christophe Leroy
Le 13/03/2019 à 09:50, Laurent Vivier a écrit : On 13/03/2019 09:28, Christophe Leroy wrote: Le 13/03/2019 à 09:01, Laurent Vivier a écrit : On 13/03/2019 07:03, Christophe Leroy wrote: Le 08/03/2019 à 11:54, Laurent Vivier a écrit : resize_hpt_for_hotplug() reports a warning when it

Re: [PATCH v3] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-13 Thread Christophe Leroy
properly. This patch moves the warning to arch_remove_memory() to only report the problem when it is needed. Reviewed-by: David Gibson Signed-off-by: Laurent Vivier Reviewed-by: Christophe Leroy --- Notes: v3: move "||" to above line and remove parenthesis v2: add warning

Re: [PATCH v2] arch/powerpc: Rework local_paca to avoid LTO warnings

2019-03-13 Thread Christophe Leroy
angelog: V2 - Address whitespace issues - keep new implementation close to where the old implementation was Signed-off-by: Alastair D'Silva Reviewed-by: Christophe Leroy --- arch/powerpc/include/asm/paca.h | 37 + arch/powerpc/kernel/paca.c

Re: [PATCH] powerpc/6xx: fix setup and use of SPRN_PGDIR for hash32

2019-03-15 Thread Christophe Leroy
Michael, Are you able to get this merged before 5.1-rc1 comes out ? Thanks Christophe Le 08/03/2019 à 17:06, Christophe Leroy a écrit : Le 08/03/2019 à 17:03, Segher Boessenkool a écrit : On Fri, Mar 08, 2019 at 07:05:22AM +, Christophe Leroy wrote: Not only the 603 but all 6xx need

Re: [RFC/WIP] powerpc: Fix 32-bit handling of MSR_EE on exceptions

2019-03-15 Thread Christophe Leroy
On 02/05/2019 10:10 AM, Michael Ellerman wrote: Christophe Leroy writes: Le 20/12/2018 à 23:35, Benjamin Herrenschmidt a écrit : /* * MSR_KERNEL is > 0x1 on 4xx/Book-E since it include MSR_CE. @@ -205,20 +208,46 @@ transfer_to_handler_cont: mflrr9

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.1-2 tag

2019-03-17 Thread christophe leroy
added KCOV support to exempt some more code from being instrumented. Plus a few minor build fixes, a small dead code removal and a defconfig update. Thanks to: Alexey Kardashevskiy, Aneesh Kumar K.V, Christophe Leroy, Jason Yan, Joel Stanley, Mahesh Salgaonkar, Mathieu Malaterre. Looks like th

Re: Mac Mini G4 hang on boot with git master

2019-03-17 Thread christophe leroy
in it down to this commit: 7a0d6955f3f7a4250da63d528bfff7a9c91b5725 is the first bad commit commit 7a0d6955f3f7a4250da63d528bfff7a9c91b5725 Author: Christophe Leroy Date: Thu Feb 21 10:37:55 2019 + powerpc/6xx: Store PGDIR physical address in a SPRG Use SPRN_SPRG2 to store the

Re: [PATCH v7 4/4] hugetlb: allow to free gigantic pages regardless of the configuration

2019-03-17 Thread christophe leroy
Le 17/03/2019 à 17:28, Alexandre Ghiti a écrit : On systems without CONTIG_ALLOC activated but that support gigantic pages, boottime reserved gigantic pages can not be freed at all. This patch simply enables the possibility to hand back those pages to memory allocator. Signed-off-by: Alexandr

Re: Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds

2019-03-19 Thread Christophe Leroy
Hi, Le 19/03/2019 à 08:10, Mark Cave-Ayland a écrit : Hi all, Whilst building the latest git master on my G4 I noticed the following shift overflow warnings in the build log for arch/powerpc/boot/addnote.c: I guess the problem must have been there for some time. I get the exact same on 4.14

Re: [RESEND PATCH v2] powerpc: mute unused-but-set-variable warnings

2019-03-19 Thread Christophe Leroy
ate.c: In function 'swap_ra_info': mm/swap_state.c:634:15: warning: variable 'orig_pte' set but not used [-Wunused-but-set-variable] Suggested-by: Christophe Leroy Reviewed-by:: Christophe Leroy Signed-off-by: Qian Cai --- v2: make it a static inline function. arch/powe

Re: [PULL REQUEST] powerpc generic command line

2019-03-19 Thread Christophe Leroy
Hi Daniel, Le 19/03/2019 à 16:38, Daniel Walker a écrit : On Tue, Mar 19, 2019 at 12:18:03PM +1100, Michael Ellerman wrote: Hi Daniel, Daniel Walker writes: Here are the generic command line changes for powerpc. These changes have been in linux-next for two cycles, with few problems report

[PATCH 1/3] powerpc/32s: drop Hash_end

2019-03-20 Thread Christophe Leroy
Hash_end has never been used, drop it. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/mmu_decl.h | 2 +- arch/powerpc/mm/ppc_mmu_32.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index 74ff61dabcb1

[PATCH 2/3] powerpc/32s: don't try to print hash table address.

2019-03-20 Thread Christophe Leroy
Due to %p, (ptrval) is printed in lieu of the hash table address. showing the hash table address isn't an operationnal need so just don't print it. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ppc_mmu_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

[PATCH 3/3] powerpc/mm: print hash info in a helper

2019-03-20 Thread Christophe Leroy
Reduce #ifdef mess by defining a helper to print hash info at startup. In the meantime, remove the display of hash table address to reduce leak of non necessary information. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 19 +-- arch/powerpc/mm

[PATCH v1 03/27] powerpc/mm: don't BUG() in slice_mask_for_size()

2019-03-20 Thread Christophe Leroy
When no mask is found for the page size, WARN() and return NULL instead of BUG()ing. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index aec91dbcdc0b

[PATCH v1 04/27] powerpc/book3e: drop mmu_get_tsize()

2019-03-20 Thread Christophe Leroy
This function is not used anymore, drop it. Fixes: b42279f0165c ("powerpc/mm/nohash: MM_SLICE is only used by book3s 64") Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage-book3e.c | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage-book3e

[PATCH v1 01/27] powerpc/mm: Don't BUG() in hugepd_page()

2019-03-20 Thread Christophe Leroy
Don't BUG(), just warn and return NULL. If the NULL value is not handled, it will get catched anyway. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/hugetlb.h b

[PATCH v1 00/27] Reduce ifdef mess in hugetlbpage.c and slice.c

2019-03-20 Thread Christophe Leroy
book3s/64 Christophe Leroy (27): powerpc/mm: Don't BUG() in hugepd_page() powerpc/mm: don't BUG in add_huge_page_size() powerpc/mm: don't BUG() in slice_mask_for_size() powerpc/book3e: drop mmu_get_tsize() powerpc/mm: drop slice_set_user_psize() powerpc/64: only boo

[PATCH v1 02/27] powerpc/mm: don't BUG in add_huge_page_size()

2019-03-20 Thread Christophe Leroy
No reason to BUG() in add_huge_page_size(). Just WARN and reject the add. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 9e732bb2c84a

[PATCH v1 05/27] powerpc/mm: drop slice_set_user_psize()

2019-03-20 Thread Christophe Leroy
slice_set_user_psize() is not used anymore, drop it. Fixes: 1753dd183036 ("powerpc/mm/slice: Simplify and optimise slice context initialisation") Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/slice.h | 5 - arch/powerpc/include/asm/nohash/64/slice.h | 1

[PATCH v1 06/27] powerpc/64: only book3s/64 supports CONFIG_PPC_64K_PAGES

2019-03-20 Thread Christophe Leroy
CONFIG_PPC_64K_PAGES cannot be selected by nohash/64 Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 1 - arch/powerpc/include/asm/nohash/64/pgalloc.h | 3 --- arch/powerpc/include/asm/nohash/64/pgtable.h | 4 arch/powerpc/include/asm/nohash/64/slice.h

[PATCH v1 07/27] powerpc/book3e: hugetlbpage is only for CONFIG_PPC_FSL_BOOK3E

2019-03-20 Thread Christophe Leroy
As per Kconfig.cputype, only CONFIG_PPC_FSL_BOOK3E gets to select SYS_SUPPORTS_HUGETLBFS so simplify accordingly. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/hugetlbpage-book3e.c | 47 +++- 2 files changed, 20

[PATCH v1 08/27] powerpc/mm: move __find_linux_pte() out of hugetlbpage.c

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is the only function in hugetlbpage.c which is compiled in regardless on CONFIG_HUGETLBPAGE This patch moves it in pgtable.c. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 103 - arch/powerpc/mm/pgtable.c

[PATCH v1 09/27] powerpc/mm: make hugetlbpage.c depend on CONFIG_HUGETLB_PAGE

2019-03-20 Thread Christophe Leroy
only compile hugetlbpage.c when CONFIG_HUGETLB_PAGE is set. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/hugetlbpage.c | 5 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index 2c23d1e

[PATCH v1 10/27] powerpc/mm: make gup_hugepte() static

2019-03-20 Thread Christophe Leroy
gup_huge_pd() is the only user of gup_hugepte() and it is located in the same file. This patch moves gup_huge_pd() after gup_hugepte() and makes gup_hugepte() static. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable.h | 3 --- arch/powerpc/mm/hugetlbpage.c | 38

[PATCH v1 12/27] powerpc/mm: add a helper to populate hugepd

2019-03-20 Thread Christophe Leroy
This patchs adds a subarch helper to populate hugepd. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 5 + arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h | 8 arch/powerpc/include/asm/nohash/hugetlb-book3e.h | 6 ++ arch/powerpc/mm

[PATCH v1 11/27] powerpc/mm: split asm/hugetlb.h into dedicated subarch files

2019-03-20 Thread Christophe Leroy
Three subarches support hugepages: - fsl book3e - book3s/64 - 8xx This patch splits asm/hugetlb.h to reduce the #ifdef mess. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 41 +++ arch/powerpc/include/asm/hugetlb.h | 89

[PATCH v1 13/27] powerpc/mm: define get_slice_psize() all the time

2019-03-20 Thread Christophe Leroy
get_slice_psize() can be defined regardless of CONFIG_PPC_MM_SLICES to avoid ifdefs Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/slice.h | 4 arch/powerpc/mm/hugetlbpage.c| 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH v1 14/27] powerpc/mm: no slice for nohash/64

2019-03-20 Thread Christophe Leroy
Only nohash/32 and book3s/64 support mm slices. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/slice.h | 7 --- arch/powerpc/include/asm/slice.h | 4 +--- arch/powerpc/platforms/Kconfig.cputype | 4 3 files changed, 5 insertions(+), 10 deletions

[PATCH v1 15/27] powerpc/mm: cleanup ifdef mess in add_huge_page_size()

2019-03-20 Thread Christophe Leroy
Introduce a subarch specific helper check_and_get_huge_psize() to check the huge page sizes and cleanup the ifdef mess in add_huge_page_size() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 27 + arch/powerpc/include/asm/nohash/32/hugetlb

[PATCH v1 16/27] powerpc/mm: move hugetlb_disabled into asm/hugetlb.h

2019-03-20 Thread Christophe Leroy
No need to have this in asm/page.h, move it into asm/hugetlb.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 2 ++ arch/powerpc/include/asm/page.h| 1 - arch/powerpc/kernel/fadump.c | 1 + arch/powerpc/mm/hash_utils_64.c| 1 + 4 files changed, 4

[PATCH v1 17/27] powerpc/mm: cleanup HPAGE_SHIFT setup

2019-03-20 Thread Christophe Leroy
Only book3s/64 may select default among several HPAGE_SHIFT at runtime. 8xx always defines 512K pages as default FSL_BOOK3E always defines 4M pages as default This patch limits HUGETLB_PAGE_SIZE_VARIABLE to book3s/64 moves the definitions in subarches files. Signed-off-by: Christophe Leroy

[PATCH v1 18/27] powerpc/mm: cleanup remaining ifdef mess in hugetlbpage.c

2019-03-20 Thread Christophe Leroy
Only 3 subarches support huge pages. So when it either 2 of them, it is not the third one. And mmu_has_feature() is known by all subarches so IS_ENABLED() can be used instead of #ifdef Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 12 +--- 1 file changed, 5

[PATCH v1 20/27] powerpc/mm: remove unnecessary #ifdef CONFIG_PPC64

2019-03-20 Thread Christophe Leroy
For PPC32 that's a noop, but gcc is smart enough ignore it. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index 99983dc4e484..f98b9e812c62 100644 --- a

[PATCH v1 19/27] powerpc/mm: drop slice DEBUG

2019-03-20 Thread Christophe Leroy
slice is now an improved functionnality. Drop the DEBUG stuff. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 62 - 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c

[PATCH v1 21/27] powerpc/mm: hand a context_t over to slice_mask_for_size() instead of mm_struct

2019-03-20 Thread Christophe Leroy
slice_mask_for_size() only uses mm->context, so hand directly a pointer to the context. This will help moving the function in subarch mmu.h in the next patch by avoiding having to include the definition of struct mm_struct Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c |

[PATCH v1 22/27] powerpc/mm: move slice_mask_for_size() into mmu.h

2019-03-20 Thread Christophe Leroy
Move slice_mask_for_size() into subarch mmu.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/mmu.h | 22 + arch/powerpc/include/asm/nohash/32/mmu-8xx.h | 18 ++ arch/powerpc/mm/slice.c | 36

[PATCH v1 23/27] powerpc/mm: remove a couple of #ifdef CONFIG_PPC_64K_PAGES in mm/slice.c

2019-03-20 Thread Christophe Leroy
This patch replaces a couple of #ifdef CONFIG_PPC_64K_PAGES by IS_ENABLED(CONFIG_PPC_64K_PAGES) to improve code maintainability. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/mm/slice.c b

[PATCH v1 24/27] powerpc: define subarch SLB_ADDR_LIMIT_DEFAULT

2019-03-20 Thread Christophe Leroy
This patch defines a subarch specific SLB_ADDR_LIMIT_DEFAULT to remove the #ifdefs around the setup of mm->context.slb_addr_limit Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/slice.h | 2 ++ arch/powerpc/include/asm/nohash/32/slice.h | 2 ++ arch/powerpc/kernel/se

[PATCH v1 25/27] powerpc/mm: flatten function __find_linux_pte()

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is full of if/else which is hard to follow allthough the handling is pretty simple. This patch flattens the function by getting rid of as much if/else as possible. In order to ease the review, this is done in two steps. Signed-off-by: Christophe Leroy --- arch/powerpc/mm

[PATCH v1 26/27] powerpc/mm: flatten function __find_linux_pte() step 2

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is full of if/else which is hard to follow allthough the handling is pretty simple. Previous patch left { } blocks. This patch removes the first one by shifting its content to the left. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable.c | 62

[PATCH v1 27/27] powerpc/mm: flatten function __find_linux_pte() step 3

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is full of if/else which is hard to follow allthough the handling is pretty simple. Previous patches left a { } block. This patch removes it. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable.c | 98 +++ 1 file changed

Re: [PATCH v5 05/10] powerpc: Add a framework for Kernel Userspace Access Protection

2019-03-20 Thread Christophe Leroy
Le 20/03/2019 à 13:57, Michael Ellerman a écrit : Christophe Leroy writes: Le 08/03/2019 à 02:16, Michael Ellerman a écrit : From: Christophe Leroy This patch implements a framework for Kernel Userspace Access Protection. Then subarches will have the possibility to provide their own

Re: [PATCH] powerpc/highmem: change BUG_ON() to WARN_ON()

2019-03-20 Thread Christophe Leroy
Le 21/03/2019 à 06:29, Michael Ellerman a écrit : Christophe Leroy writes: In arch/powerpc/mm/highmem.c, BUG_ON() is called only when CONFIG_DEBUG_HIGHMEM is selected, this means the BUG_ON() is not vital and can be replaced by a a WARN_ON At the sametime, use IS_ENABLED() instead of

Re: [PATCH] powerpc/highmem: change BUG_ON() to WARN_ON()

2019-03-21 Thread Christophe Leroy
Le 21/03/2019 à 11:07, Michael Ellerman a écrit : Christophe Leroy writes: Le 21/03/2019 à 06:29, Michael Ellerman a écrit : Christophe Leroy writes: In arch/powerpc/mm/highmem.c, BUG_ON() is called only when CONFIG_DEBUG_HIGHMEM is selected, this means the BUG_ON() is not vital and can

Re: [PATCH v5 05/10] powerpc: Add a framework for Kernel Userspace Access Protection

2019-03-21 Thread Christophe Leroy
Le 20/03/2019 à 14:04, Christophe Leroy a écrit : Le 20/03/2019 à 13:57, Michael Ellerman a écrit : Christophe Leroy writes: Le 08/03/2019 à 02:16, Michael Ellerman a écrit : From: Christophe Leroy This patch implements a framework for Kernel Userspace Access Protection. Then

Re: [PATCH v1 11/27] powerpc/mm: split asm/hugetlb.h into dedicated subarch files

2019-03-21 Thread Christophe Leroy
snowpatch fails applying this. I usually base my patches on branch merge. Shouldn't snowpatch use merge branch as well instead of next branch ? Christophe Le 20/03/2019 à 11:06, Christophe Leroy a écrit : Three subarches support hugepages: - fsl book3e - book3s/64 - 8xx This patch s

Re: [PATCH v1 00/27] Reduce ifdef mess in hugetlbpage.c and slice.c

2019-03-21 Thread Christophe Leroy
This series went through a successfull build test on kisskb: http://kisskb.ellerman.id.au/kisskb/branch/chleroy/head/f9dc3b2203af4356e9eac2d901126a0dfc5b51f6/ Christophe Le 20/03/2019 à 11:06, Christophe Leroy a écrit : The main purpose of this series is to reduce the amount of #ifdefs in

Re: [PATCH 5/5] powerpc/8xx: fix possible object reference leak

2019-03-22 Thread Christophe Leroy
On 03/22/2019 03:05 AM, Wen Yang wrote: The call to of_find_compatible_node returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. irq_domain_add_linear also calls of_node_get to increase refcount, so irq_domain will not be affected when i

[PATCH 2/7] powerpc/mm: define an empty mm_iommu_init()

2019-03-22 Thread Christophe Leroy
To avoid ifdefs, define a empty static inline mm_iommu_init() function when CONFIG_SPAPR_TCE_IOMMU is not selected. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu_context.h | 1 + arch/powerpc/kernel/setup-common.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions

[PATCH 3/7] powerpc/setup: define cpu_pvr at all time

2019-03-22 Thread Christophe Leroy
To avoid ifdefs, define cpu_pvr at all time. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index a90e8367ccde

[PATCH 1/7] powerpc/fadump: define an empty fadump_cleanup()

2019-03-22 Thread Christophe Leroy
To avoid #ifdefs, define an static inline fadump_cleanup() function when CONFIG_FADUMP is not selected Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/fadump.h | 1 + arch/powerpc/kernel/setup-common.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch

[PATCH 4/7] powerpc/setup: Remove unnecessary #ifdef CONFIG_ALTIVEC

2019-03-22 Thread Christophe Leroy
CPU_FTR_ALTIVEC is only set when CONFIG_ALTIVEC is selected, so the ifdef is unnecessary. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index

[PATCH 5/7] powerpc/setup: cleanup ifdef mess in check_cache_coherency()

2019-03-22 Thread Christophe Leroy
Use IS_ENABLED() instead of #ifdefs Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index fa90585760c0..95d545e94c28

[PATCH 6/7] powerpc/setup: cleanup the #ifdef CONFIG_TAU block

2019-03-22 Thread Christophe Leroy
Use cpu_has_feature() instead of opencoding Use IS_ENABLED() instead of #ifdef for CONFIG_TAU_AVERAGE Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kernel/setup

[PATCH 7/7] powerpc/setup: replace ifdefs by IS_ENABLED() wherever possible.

2019-03-22 Thread Christophe Leroy
Compared to ifdefs, IS_ENABLED() provide a cleaner code and allows to detect compilation failure regardless of the selected options. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 39 ++ 1 file changed, 18 insertions(+), 21 deletions

[RFC PATCH v1 2/3] lib/string: move sysfs string functions out of string.c

2019-03-22 Thread Christophe Leroy
In order to implement interceptors for string functions, move higher level sysfs related string functions out of string.c This patch creates a new file named string_sysfs.c Signed-off-by: Christophe Leroy --- lib/Makefile | 3 ++- lib/string.c | 79

[RFC PATCH v1 1/3] kasan: move memset/memmove/memcpy interceptors in a dedicated file

2019-03-22 Thread Christophe Leroy
In preparation of the addition of interceptors for other string functions, this patch moves memset/memmove/memcpy interceptions in string.c Signed-off-by: Christophe Leroy --- mm/kasan/Makefile | 5 - mm/kasan/common.c | 26 -- mm/kasan/string.c | 35

[RFC PATCH v1 3/3] kasan: add interceptors for all string functions

2019-03-22 Thread Christophe Leroy
rom places where kasan has to be disabled. Signed-off-by: Christophe Leroy --- This is the generic part. If we agree on the principle, then I'll go through the arches and see if adaptations need to be done there. include/linux/string.h | 79 lib/Makefile | 2 + mm

Re: Regression in 5.1.0-rc2: PowerBook G4 Aluminum fails to boot - bisected to commit 0df977eafc792

2019-03-24 Thread Christophe Leroy
e following: commit 0df977eafc792a5365a7f81d8d5920132e03afad Author: Christophe Leroy Date:   Thu Feb 21 10:37:54 2019 +     powerpc/6xx: Don't use SPRN_SPRG2 for storing stack pointer while in RTAS     When calling RTAS, the stack pointer is stored in SPRN_SPRG2     in order to be able

[PATCH] powerpc/rtas: fix early boot failure.

2019-03-25 Thread Christophe Leroy
field should be used instead, but in the meantime, thread struct has already been zeroised and initialised so we can just drop this initialisation. Reported-by: Larry Finger Fixes: 0df977eafc79 ("powerpc/6xx: Don't use SPRN_SPRG2 for storing stack pointer while in RTAS") Signed-

Re: Regression in 5.1.0-rc2: PowerBook G4 Aluminum fails to boot - bisected to commit 0df977eafc792

2019-03-25 Thread Christophe Leroy
PPC32 processor type. This machine has a 7447A according to /proc/cpuinfo. The problem was bisected to the following: commit 0df977eafc792a5365a7f81d8d5920132e03afad Author: Christophe Leroy Date:   Thu Feb 21 10:37:54 2019 +     powerpc/6xx: Don't use SPRN_SPRG2 for storing stack po

Re: [PATCH v2] powerpc/8xx: fix possible object reference leak

2019-03-25 Thread Christophe Leroy
: a8db8cf0d894 ("irq_domain: Replace irq_alloc_host() with revmap-specific initializers") Signed-off-by: Wen Yang Suggested-by: Christophe Leroy Reviewed-by: Peng Hao Reviewed-by: Christophe Leroy Cc: Vitaly Bordug Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael El

Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

2019-03-25 Thread Christophe Leroy
Le 25/03/2019 à 12:35, Michael Ellerman a écrit : Ben Hutchings writes: On Mon, 2019-03-25 at 01:03 +0100, Andreas Schwab wrote: On Mär 24 2019, Ben Hutchings wrote: Presumably you have CONFIG_PPC_BOOK3S_64 enabled and CONFIG_SPARSEMEM disabled? Was this configuration actually usable?

Re: [PATCH v5 3/3] locking/rwsem: Optimize down_read_trylock()

2019-03-25 Thread Christophe Leroy
Hi, Could you share the microbenchmark you are using ? I'd like to test the series on powerpc. Thanks Christophe Le 22/03/2019 à 15:30, Waiman Long a écrit : Modify __down_read_trylock() to optimize for an unlocked rwsem and make it generate slightly better code. Before this patch, down_read

Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

2019-03-25 Thread Christophe Leroy
Hi Masahiro, Le 25/03/2019 à 07:44, Masahiro Yamada a écrit : Hi Christophe, On Sat, Mar 23, 2019 at 5:27 PM LEROY Christophe wrote: Arnd Bergmann a écrit : On Wed, Mar 20, 2019 at 10:41 AM Arnd Bergmann wrote: I've added your patch to my randconfig test setup and will let you know if

Re: [PATCH v3] powerpc/8xx: fix possible object reference leak

2019-03-25 Thread Christophe Leroy
Suggested-by: Christophe Leroy Suggested-by: Michael Ellerman Reviewed-by: Peng Hao Reviewed-by: Christophe Leroy Cc: Vitaly Bordug Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ker...@vger.kernel.org --- v3->v2: se

Re: [PATCH 3/7] powerpc/setup: define cpu_pvr at all time

2019-03-25 Thread Christophe Leroy
Le 22/03/2019 à 09:08, Christophe Leroy a écrit : To avoid ifdefs, define cpu_pvr at all time. Signed-off-by: Christophe Leroy This patch introduces a sparse warning. I guess we can skip it for now and rework more deeply the use of cpu_pvr versus SPRN_PVR which is re-read in many places

[PATCH v2 1/3] powerpc/32s: drop Hash_end

2019-03-25 Thread Christophe Leroy
Hash_end has never been used, drop it. Signed-off-by: Christophe Leroy --- v2: no change arch/powerpc/mm/mmu_decl.h | 2 +- arch/powerpc/mm/ppc_mmu_32.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index

[PATCH v2 2/3] powerpc/32s: don't try to print hash table address.

2019-03-25 Thread Christophe Leroy
Due to %p, (ptrval) is printed in lieu of the hash table address. showing the hash table address isn't an operationnal need so just don't print it. Signed-off-by: Christophe Leroy --- v2: no change arch/powerpc/mm/ppc_mmu_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

[PATCH v2 3/3] powerpc/mm: print hash info in a helper

2019-03-25 Thread Christophe Leroy
Reduce #ifdef mess by defining a helper to print hash info at startup. In the meantime, remove the display of hash table address to reduce leak of non necessary information. Signed-off-by: Christophe Leroy --- v2: added header to avoid sparse warning arch/powerpc/kernel/setup-common.c | 19

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-26 Thread Christophe Leroy
On 03/26/2019 12:55 AM, Michael Ellerman wrote: Joel Stanley writes: Segher added some workarounds for GCC 4.2 and bintuils 2.18. We now set 4.6 and 2.20 as the minimum, so they can be dropped. This is mostly a revert of c6995fe4 ("powerpc: Fix build bug with binutils < 2.18 and GCC < 4

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-26 Thread Christophe Leroy
Le 26/03/2019 à 01:55, Michael Ellerman a écrit : Joel Stanley writes: Segher added some workarounds for GCC 4.2 and bintuils 2.18. We now set 4.6 and 2.20 as the minimum, so they can be dropped. This is mostly a revert of c6995fe4 ("powerpc: Fix build bug with binutils < 2.18 and GCC <

Re: Reading `/sys/kernel/debug/kmemleak` takes 3 s and content not shown

2019-03-26 Thread Christophe Leroy
Le 26/03/2019 à 13:49, Paul Menzel a écrit : Dear Linux folks, On 19.02.19 10:44, Paul Menzel wrote: On a the IBM S822LC (8335-GTA) with Ubuntu 18.10, and Linux 5.0-rc5+ accessing `/sys/kernel/debug/kmemleak` takes a long time. According to strace it takes three seconds. $ dmesg | grep le

Re: [PATCH v6 04/19] powerpc: mm: Add p?d_large() definitions

2019-03-26 Thread Christophe Leroy
Le 26/03/2019 à 17:26, Steven Price a écrit : walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information is provided by the p?d_large() functions/macros. For pow

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-26 Thread Christophe Leroy
Le 26/03/2019 à 19:19, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 07:55:33AM +, Christophe Leroy wrote: STACK off0x vaddr 0x paddr 0x align 2**4 filesz 0x memsz 0x flags rwx You need to prevent this one somehow. What

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-26 Thread Christophe Leroy
Le 26/03/2019 à 23:29, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 03:12:31PM -0500, Segher Boessenkool wrote: On Tue, Mar 26, 2019 at 08:28:58PM +0100, Christophe Leroy wrote: Le 26/03/2019 à 19:19, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 07:55:33AM +

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-27 Thread Christophe Leroy
Le 26/03/2019 à 21:12, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 08:28:58PM +0100, Christophe Leroy wrote: Le 26/03/2019 à 19:19, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 07:55:33AM +, Christophe Leroy wrote: STACK off0x vaddr 0x paddr

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-27 Thread Christophe Leroy
Le 27/03/2019 à 09:56, Christophe Leroy a écrit : Le 26/03/2019 à 21:12, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 08:28:58PM +0100, Christophe Leroy wrote: Le 26/03/2019 à 19:19, Segher Boessenkool a écrit : On Tue, Mar 26, 2019 at 07:55:33AM +, Christophe Leroy wrote

Re: [PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-27 Thread Christophe Leroy
Le 27/03/2019 à 19:21, Segher Boessenkool a écrit : On Wed, Mar 27, 2019 at 07:47:55AM -0500, Segher Boessenkool wrote: On Wed, Mar 27, 2019 at 07:40:32AM +0100, Christophe Leroy wrote: Le 26/03/2019 à 23:29, Segher Boessenkool a écrit : I tried to reproduce this. It does not fail with a

[PATCH] powerpc/book3e: drop BUG_ON() in map_kernel_page()

2019-03-28 Thread Christophe Leroy
early_alloc_pgtable() never returns NULL as it panics on failure. This patch drops the three BUG_ON() which check the non nullity of early_alloc_pgtable() returned value. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable-book3e.c | 3 --- 1 file changed, 3 deletions(-) diff --git a

[PATCH] powerpc/nohash64: clean pgtable.h

2019-03-28 Thread Christophe Leroy
TRANSPARENT_HUGEPAGE is only supported by book3s VMEMMAP_REGION_ID is never used Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgtable.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm

[RFC PATCH] powerpc/book3e: KASAN Full support for 64bit

2019-03-28 Thread Christophe Leroy
The KASAN shadow area is mapped into vmemmap space: 0x8000 0400 to 0x8000 0600 . For this vmemmap has to be disabled. Cc: Daniel Axtens Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 1 + arch/powerpc/Kconfig.debug| 3 +- arch

Re: [RFC PATCH] powerpc/book3e: KASAN Full support for 64bit

2019-03-28 Thread Christophe Leroy
ng VMEMMAP space, allthough I don't have a clean view of how it would cooperate with VMEMMMAP if we keep it enabled. I've not been able to identify what is the largest size of the linear mapping (ie the 0xc000 region). Christophe Le 28/03/2019 à 15:21, Christophe Leroy

[RFC PATCH v2 1/3] kasan: move memset/memmove/memcpy interceptors in a dedicated file

2019-03-28 Thread Christophe Leroy
In preparation of the addition of interceptors for other string functions, this patch moves memset/memmove/memcpy interceptions in string.c Signed-off-by: Christophe Leroy --- v2: added missing includes mm/kasan/Makefile | 5 - mm/kasan/common.c | 26 -- mm/kasan

[RFC PATCH v2 2/3] lib/string: move sysfs string functions out of string.c

2019-03-28 Thread Christophe Leroy
In order to implement interceptors for string functions, move higher level sysfs related string functions out of string.c This patch creates a new file named string_sysfs.c Signed-off-by: Christophe Leroy --- v2: restored sysfs_streq() which had been lost in the move. lib/Makefile | 3

[RFC PATCH v2 3/3] kasan: add interceptors for all string functions

2019-03-28 Thread Christophe Leroy
rom places where kasan has to be disabled. Signed-off-by: Christophe Leroy --- v2: Fixed a few checkpatch stuff and added missing EXPORT_SYMBOL() and missing #undefs include/linux/string.h | 79 ++ lib/Makefile | 2 + lib/string.c | 8 + mm/kasan/string.c

<    3   4   5   6   7   8   9   10   11   12   >