Re: [PATCH 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-19 Thread christophe leroy
Le 19/04/2017 à 16:22, Christophe LEROY a écrit : Le 19/04/2017 à 16:01, Michael Ellerman a écrit : Christophe Leroy <christophe.le...@c-s.fr> writes: diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 32509de6ce4c..4af81fb23653 100644 --- a/arch/powerpc/

[PATCH] powerpc/32: Avoid risk of unrecoverable TLBmiss inside entry_32.S

2017-04-20 Thread Christophe Leroy
at the beginning of the file. It regroups them within the first 2kbytes. Then the patch forces an 11 bits (2kbytes) alignment for those functions. This garanties that the functions remain in a single 4k page. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- This patch superseeds previous

[PATCH v2] powerpc/mm: Fix page table dump build on PPC32

2017-04-18 Thread Christophe Leroy
: 'KERN_VIRT_START' undeclared (first use in this function) make[1]: *** [arch/powerpc/mm/dump_linuxpagetables.o] Error 1 make: *** [arch/powerpc/mm] Error 2 Fixes: 8eb07b187000d ("powerpc/mm: Dump linux pagetables") Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --

[PATCH] powerpc/mm: Rename table dump file name

2017-04-18 Thread Christophe Leroy
Page table dump debugfs file is named 'kernel_page_tables' on all other architectures implementing it, while is is named 'kernel_pagetables' on powerpc. This patch renames it. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/dump_linuxpagetables.c | 2 +-

[PATCH 1/5] powerpc/mm: only call store_updates_sp() on stores in do_page_fault()

2017-04-19 Thread Christophe Leroy
h the same microbenchmark app, run with 500 as argument, on an MPC885 we get: Before this patch: 152000 DTLB misses After this patch: 147000 DTLB misses Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[PATCH 0/5] powerpc/mm: some cleanup of do_page_fault()

2017-04-19 Thread Christophe Leroy
This patchset is a split of previous patch called the same way as this summary. Comments from Michael are taken into account. Christophe Leroy (5): powerpc/mm: only call store_updates_sp() on stores in do_page_fault() powerpc/mm: split store_updates_sp() in two parts in do_page_fault

[PATCH 3/5] powerpc/mm: remove a redundant test in do_page_fault()

2017-04-19 Thread Christophe Leroy
The result of (trap == 0x400) is already in is_exec. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 9d21e5fd383d..b56bf472db6d

[PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-04-19 Thread Christophe Leroy
ion. So __get_user() can be used instead of get_user() Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/fault.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 67f

[PATCH 4/5] powerpc/mm: Evaluate user_mode(regs) only once in do_page_fault()

2017-04-19 Thread Christophe Leroy
_fault+0x2a4> 120: 41 b2 00 f8 beq cr4,218 <do_page_fault+0x218> 138: 41 b2 ff a0 beq cr4,d8 <do_page_fault+0xd8> 1d4: 40 92 00 e0 bne cr4,2b4 <do_page_fault+0x2b4> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/pow

[PATCH 5/5] powerpc/mm: The 8xx doesn't call do_page_fault() for breakpoints

2017-04-19 Thread Christophe Leroy
The 8xx has a dedicated exception for breakpoints, that directly calls do_break() Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c

[PATCH 0/3] powerpc/mm: Fix kernel protection and implement CONFIG_DEBUG_RODATA on PPC32

2017-04-19 Thread Christophe Leroy
on function change_page_attr() Christophe Leroy (3): powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32 powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32 arch/powerpc/Kconfig.debug | 11

[PATCH 1/3] powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs

2017-04-19 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/pgtable_32.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index a65c0b4c0669..8e8940fad12f 100644 --- a/arch/powerpc/mm/pgtabl

[PATCH 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-19 Thread Christophe Leroy
by default. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/Kconfig.debug | 11 +++ arch/powerpc/include/asm/pgtable.h | 8 arch/powerpc/kernel/ftrace.c | 2 ++ arch/powerpc/mm/init_32.c | 3 ++- arch/powerpc/mm/pgtabl

[PATCH 2/3] powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32

2017-04-19 Thread Christophe Leroy
() Area ]--- This patch fixes that. The implementation is done by reusing the change_page_attr() function implemented for CONFIG_DEBUG_PAGEALLOC Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/mem.c| 1 + arch/powerpc/mm/mmu_decl.h | 3 +++ arch/powe

Re: [PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-22 Thread christophe leroy
Le 22/04/2017 à 08:08, Michael Ellerman a écrit : "Naveen N. Rao" writes: Excerpts from Christophe Leroy's message of April 21, 2017 18:32: diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 32509de6ce4c..06d2ac53f471 100644 ---

[PATCH] powerpc/8xx: fix mpc8xx_get_irq() return on no irq

2017-03-10 Thread Christophe Leroy
IRQ 0 is a valid HW interrupt. So get_irq() shall return 0 when there is no irq, instead of returning irq_linear_revmap(... ,0) Fixes: f2a0bd3753dad ("[POWERPC] 8xx: powerpc port of core CPM PIC") Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/sysdev/

Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

2017-03-10 Thread Christophe LEROY
Le 10/03/2017 à 09:41, Michael Ellerman a écrit : Christophe Leroy <christophe.le...@c-s.fr> writes: Help a bit the compiler to provide better code: unsigned int f(int i) { return 1 << (31 - i); } unsigned int g(int i) { return 0x8000 >> i; } Disa

[PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

2017-03-09 Thread Christophe Leroy
8: 7d 23 18 30 slw r3,r9,r3 c: 4e 80 00 20 blr 0010 : 10: 3d 20 80 00 lis r9,-32768 14: 7d 23 1c 30 srw r3,r9,r3 18: 4e 80 00 20 blr Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/

[PATCH] powerpc/8xx: Adding support of IRQ in MPC8xx GPIO

2017-03-09 Thread Christophe Leroy
mask' defines which of the 16 GPIOs have the associated interrupts defined in the 'interrupts' property. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/cpm1.h | 2 ++ arch/powerpc/sysdev/cpm1.c | 25 + 2 files changed, 27 insert

Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

2017-03-10 Thread Christophe LEROY
Le 10/03/2017 à 14:06, Segher Boessenkool a écrit : On Fri, Mar 10, 2017 at 11:54:19AM +0100, Christophe LEROY wrote: gpio_get() and gpio_set() are used extensively by some GPIO based drivers like SPI, NAND, so it may be worth it as it doesn't impair readability (if anyone prefers, we could

Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

2017-03-10 Thread Christophe LEROY
Le 10/03/2017 à 15:32, Segher Boessenkool a écrit : On Fri, Mar 10, 2017 at 03:04:48PM +0100, Christophe LEROY wrote: Le 10/03/2017 à 14:06, Segher Boessenkool a écrit : On Fri, Mar 10, 2017 at 11:54:19AM +0100, Christophe LEROY wrote: gpio_get() and gpio_set() are used extensively by some

[RFC] powerpc: handle simultanneous interrupts at once

2017-03-10 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/hw_irq.h | 6 ++ arch/powerpc/kernel/irq.c | 22 +++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/inclu

Re: open list?

2017-03-07 Thread Christophe LEROY
Le 07/03/2017 à 11:02, Tobin C. Harding a écrit : scripts/get_maintainers.pl says this is an open list; linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)) Patches I've sent with this list cc'd have not been getting through. I resent one to check if it was a user

Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

2017-03-21 Thread Christophe LEROY
Le 10/03/2017 à 16:41, Segher Boessenkool a écrit : On Fri, Mar 10, 2017 at 03:41:23PM +0100, Christophe LEROY wrote: gpio_get() and gpio_set() are used extensively by some GPIO based drivers like SPI, NAND, so it may be worth it as it doesn't impair readability (if anyone prefers, we could

[PATCH] powerpc/32: Move entry_32 functions just after HEAD functions.

2017-04-18 Thread Christophe Leroy
just after the .head section (as already done for entry_64 on PPC64), we can more easily ensure the issue doesn't happen. Ex: with this change, all entry_32 functions playing with srr0/srr1 appears between 0xc0002000 and 0xc0002fff on PPC_8xx. Signed-off-by: Christophe Leroy <christophe.le..

Re: [PATCH] powerpc/32: Fix protection of kernel RAM after freeing unused memory

2017-04-18 Thread Christophe LEROY
Le 18/04/2017 à 08:40, Michael Ellerman a écrit : Christophe Leroy <christophe.le...@c-s.fr> writes: diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index a65c0b4c0669..d506bd61b629 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtabl

Re: [PATCH] powerpc/32: Remove redundant test in transfer_to_handler()

2017-04-18 Thread Christophe LEROY
Le 14/04/2017 à 15:31, Christophe Leroy a écrit : As stated in the comment on top of transfer_to_handler(), all callers set cr0.eq if the exception occurred in kernel mode (i.e. MSR:PR = 0) Therefore, it is not needed to do the test again Indeed, all callers set cr0.eq as required

Re: [PATCH 23/24] powerpc/mm: Cleanup check for stack expansion

2017-07-31 Thread Christophe LEROY
Le 25/07/2017 à 13:19, Michael Ellerman a écrit : LEROY Christophe writes: Michael Ellerman a écrit : LEROY Christophe writes: Benjamin Herrenschmidt a écrit : When hitting below a

Re: [PATCH] powerpc/asm/cacheflush: Cleanup cacheflush function params

2017-07-31 Thread Christophe LEROY
Le 20/07/2017 à 08:28, Matt Brown a écrit : The cacheflush prototypes currently use start and stop values and each call requires typecasting the address to an unsigned long. This patch changes the cacheflush prototypes to follow the x86 style of using a base and size values, with base being a

Re: [PATCH v4 2/3] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line

2017-08-02 Thread Christophe LEROY
Used: 0 kB VmallocChunk: 0 kB HugePages_Total: 0 HugePages_Free:0 HugePages_Rsvd:0 HugePages_Surp:0 Hugepagesize:512 kB Christophe Cc: Scott Wood <o...@buserror.net> Cc: Christophe Leroy <christophe.le...@c-s.fr> Signed-off

Question on hugepages_supported()

2017-08-02 Thread Christophe LEROY
In include/linux/hugetlb.h, we find the following statement #ifndef hugepages_supported /* * Some platform decide whether they support huge pages at boot * time. Some of them, such as powerpc, set HPAGE_SHIFT to 0 * when there is no such support */ #define hugepages_supported() (HPAGE_SHIFT

Re: [PATCH v4 2/3] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line

2017-08-02 Thread Christophe LEROY
Le 02/08/2017 à 09:31, Aneesh Kumar K.V a écrit : Christophe LEROY <christophe.le...@c-s.fr> writes: Hi, Le 28/07/2017 à 07:01, Aneesh Kumar K.V a écrit : With commit aa888a74977a8 ("hugetlb: support larger than MAX_ORDER") we added support for allocating gigantic huge

Re: [PATCH v4 2/3] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line

2017-08-02 Thread Christophe LEROY
Le 02/08/2017 à 10:10, Christophe LEROY a écrit : Le 02/08/2017 à 09:31, Aneesh Kumar K.V a écrit : Christophe LEROY <christophe.le...@c-s.fr> writes: Hi, Le 28/07/2017 à 07:01, Aneesh Kumar K.V a écrit : With commit aa888a74977a8 ("hugetlb: support larger than MAX_ORDER&

Re: [PATCH 3/3] powerpc/mm: Mark __init memory no-execute when STRICT_KERNEL_RWX=y

2017-08-02 Thread Christophe LEROY
Le 14/07/2017 à 08:51, Michael Ellerman a écrit : Currently even with STRICT_KERNEL_RWX we leave the __init text marked executable after init, which is bad. Add a hook to mark it NX (no-execute) before we free it, and implement it for radix and hash. Note that we use __init_end as the end

Re: [PATCH] powerpc: Use reg.h values for program check reason codes

2017-08-16 Thread Christophe LEROY
Hi, Le 16/08/2017 à 08:50, Cyril Bur a écrit : Small amount of #define duplication, makes sense for these to be in reg.h. Signed-off-by: Cyril Bur Looks similar to the following applies commit, doesn't it ?

[PATCH] powerpc/8xx: fix two CONFIG_8xx left behind

2017-08-14 Thread Christophe Leroy
Commit 968159c0031ac ("powerpc/8xx: Getting rid of remaining use of CONFIG_8xx") removed all but 2 references to 8xx in Kconfigs. This patch removes the two remaining ones. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/Kconfig | 2

[PATCH 3/7] powerpc/32: Avoid risk of unrecoverable TLBmiss inside entry_32.S

2017-07-12 Thread Christophe Leroy
. This garanties that the functions remain in a single 4k page. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/entry_32.S | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 858705

[PATCH 2/7] powerpc/8xx: Remove macro that checks kernel address

2017-07-12 Thread Christophe Leroy
miss handler, we remove the macros and reintroduce them inside the handler. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/head_8xx.S | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kernel/head

[PATCH 0/7] Prepare 8xx for CONFIG_STRICT_KERNEL_RWX

2017-07-12 Thread Christophe Leroy
This serie makes the PINning of ITLBs optional in the 8xx in order to allow STRICT_KERNEL_RWX to work properly Christophe Leroy (7): powerpc/8xx: Ensures RAM mapped with LTLB is seen as block mapped on 8xx. powerpc/8xx: Remove macro that checks kernel address powerpc/32: Avoid risk

[PATCH 5/7] powerpc/8xx: Do not allow Pinned TLBs with STRICT_KERNEL_RWX or DEBUG_PAGEALLOC

2017-07-12 Thread Christophe Leroy
Pinning TLBs bypasses STRICT_KERNEL_RWX or DEBUG_PAGEALLOC protections so it should only be allowed when those are not selected Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/p

[PATCH 4/7] powerpc/8xx: Make pinning of ITLBs optional

2017-07-12 Thread Christophe Leroy
TA pinning. This patch also makes pinning of IMMR independent of pinning of DATA. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/Kconfig | 10 arch/powerpc/kernel/head_8xx.S | 57 +- arch/powerpc/mm/8xx

[PATCH v2 1/5] powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs

2017-07-07 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/pgtable_32.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index a9e4bfc025bc..991036f818bb 100644 --- a/arch/powerpc/mm/pgtabl

[PATCH v2 5/5] powerpc/mm: Simplify __set_fixmap()

2017-07-07 Thread Christophe Leroy
. This variable is set but has never been used from the beginning (commit 2c419bdeca1d9 ("[POWERPC] Port fixmap from x86 and use for kmap_atomic")) Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/fixmap.h | 10 +++--- arch/powerpc/mm/pgtabl

[PATCH v2 4/5] powerpc/mm: declare some local functions static

2017-07-07 Thread Christophe Leroy
get_pteptr() and __mapin_ram_chunk() are only used locally, so define them static Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/book3s/32/pgtable.h | 3 --- arch/powerpc/include/asm/nohash/32/pgtable.h | 3 --- arch/powerpc/mm/pgtabl

[PATCH v2 0/5] powerpc/mm: Fix kernel protection and implement STRICT_KERNEL_RWX on PPC32

2017-07-07 Thread Christophe Leroy
of STRICT_KERNEL_RWX for PPC64 * Removed from the serie the two patches already applied. Christophe Leroy (5): powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32 powerpc/mm: Implement STRICT_KERNEL_RWX

[PATCH v2 2/5] powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32

2017-07-07 Thread Christophe Leroy
() Area ]--- This patch fixes that. The implementation is done by reusing the change_page_attr() function implemented for CONFIG_DEBUG_PAGEALLOC Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/mem.c| 1 + arch/powerpc/mm/mmu_decl.h | 3 +++ arch/powe

[PATCH v2 3/5] powerpc/mm: Implement STRICT_KERNEL_RWX on PPC32

2017-07-07 Thread Christophe Leroy
This patch implements STRICT_KERNEL_RWX on PPC32. As for CONFIG_DEBUG_PAGEALLOC, it deactivates BAT and LTLB mappings in order to allow page protection setup at the level of each page. As BAT/LTLB mappings are deactivated, there might be a performance impact. Signed-off-by: Christophe Leroy

[PATCH 1/7] powerpc/8xx: Ensures RAM mapped with LTLB is seen as block mapped on 8xx.

2017-07-12 Thread Christophe Leroy
On the 8xx, the RAM mapped with LTLBs must be seen as block mapped, just like areas mapped with BATs on standard PPC32. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/8xx_mmu.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git

[PATCH 6/7] powerpc/8xx: mark init functions with __init

2017-07-12 Thread Christophe Leroy
setup_initial_memory_limit() is only called during init. mmu_patch_cmp_limit() is only called from 8xx_mmu.c Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/8xx_mmu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powe

[PATCH 7/7] powerpc/8xx: Reduce DTLB miss handler by one insn

2017-07-12 Thread Christophe Leroy
This reduces the DTLB miss handler hot path (user address path) by one instruction by preserving r10. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/head_8xx.S | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/p

[PATCH] powerpc/hugetlb: fix page rights verification in gup_hugepte()

2017-07-12 Thread Christophe Leroy
() instead of the raw flags. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/book3s/32/pgtable.h | 1 + arch/powerpc/include/asm/book3s/64/pgtable.h | 5 + arch/powerpc/include/asm/nohash/pgtable.h| 1 + arch/powerpc/mm/hugetlbpage.c

[PATCH] powerpc/mm: Only read faulting instruction when necessary in do_page_fault()

2017-04-24 Thread Christophe Leroy
faults ( +- 0.03% ) 5.728423115 seconds time elapsed ( +- 0.14% ) Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- This patch applies after the serie "powerpc/mm: some cleanup of do_page_fault()" ar

Re: [PATCH] powerpc/mm: Only read faulting instruction when necessary in do_page_fault()

2017-04-24 Thread Christophe LEROY
Le 24/04/2017 à 11:15, Michael Ellerman a écrit : Christophe Leroy <christophe.le...@c-s.fr> writes: diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 400f2d0d42f8..3d506589236c 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -356,8 +348,22

[PATCH v3 0/3] powerpc/mm: Fix kernel protection and implement CONFIG_DEBUG_RODATA on PPC32

2017-04-24 Thread Christophe Leroy
the rights is performed in patch_instruction() instead of being done only in ftrace, so that other functionnalities like jump_label also works. Christophe Leroy (3): powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs powerpc/mm: Fix kernel RAM protection after freeing unused

[PATCH v3 2/3] powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32

2017-04-24 Thread Christophe Leroy
() Area ]--- This patch fixes that. The implementation is done by reusing the change_page_attr() function implemented for CONFIG_DEBUG_PAGEALLOC Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v2: No change v3: No change arch/powerpc/mm/mem.c| 1 + arch/powe

[PATCH v3 1/3] powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs

2017-04-24 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v2: No change v3: No change arch/powerpc/mm/pgtable_32.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index a65c0b4c0669..8e8940fad12f

[PATCH v3 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-24 Thread Christophe Leroy
by default. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v2: For ftrace, only change the attributes of the page to be modified v3: Changing the rights is performed in patch_instruction() instead of being done only in ftrace, so that other functionnalities like jump_labe

Re: [PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-24 Thread Christophe LEROY
Le 23/04/2017 à 12:26, Michael Ellerman a écrit : christophe leroy <christophe.le...@c-s.fr> writes: Le 22/04/2017 à 08:08, Michael Ellerman a écrit : "Naveen N. Rao" <naveen.n@linux.vnet.ibm.com> writes: Excerpts from Christophe Leroy's message of April 21, 2

[PATCH v2] powerpc/mm: Only read faulting instruction when necessary in do_page_fault()

2017-04-28 Thread Christophe Leroy
faults ( +- 0.03% ) 5.728423115 seconds time elapsed ( +- 0.14% ) Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v2: Changes 'if (cond1) if (cond2)' by 'if (cond1 && cond2)' In case the instruc

[PATCH v5] powerpc/mm: Only read faulting instruction when necessary in do_page_fault()

2017-08-08 Thread Christophe Leroy
it(0); } Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- I'm wondering if it really worth it to do something so complex. Is there really a chance that the get_user() faults ? It would mean that an instruction that as just been executed has been in the meantime swapped out. Is

Re: [01/24] powerpc/mm: Move exception_enter/exit to a do_page_fault wrapper

2017-08-08 Thread Christophe LEROY
Le 08/08/2017 à 04:16, Michael Ellerman a écrit : Christophe LEROY <christophe.le...@c-s.fr> writes: Le 07/08/2017 à 12:41, Michael Ellerman a écrit : On Wed, 2017-07-19 at 04:49:23 UTC, Benjamin Herrenschmidt wrote: This will allow simplifying the returns from do_page_fault Sign

[PATCH] powerpc/32: Fix boot failure on non 6xx platforms

2017-08-08 Thread Christophe Leroy
CONFIG_6xx Fixes: d300627c6a536 ("powerpc/6xx: Handle DABR match before calling do_page_fault") Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/entry_32.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/entry_

Re: [PATCH 3/3] powerpc/mm: Mark __init memory no-execute when STRICT_KERNEL_RWX=y

2017-08-09 Thread Christophe LEROY
Le 09/08/2017 à 04:29, Michael Ellerman a écrit : Christophe LEROY <christophe.le...@c-s.fr> writes: Le 14/07/2017 à 08:51, Michael Ellerman a écrit : diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index c0737c86a362..3d562b

[PATCH v3 0/5] powerpc/mm: Fix kernel protection and implement STRICT_KERNEL_RWX on PPC32

2017-08-02 Thread Christophe Leroy
remap_init_ram() renamed mark_initmem_nx() to match new PPC64 implementation Changes from v1 to v2: * Rebased on latest linux-next following including of STRICT_KERNEL_RWX for PPC64 * Removed from the serie the two patches already applied. Christophe Leroy (5): powerpc/mm: Ensure

[PATCH v3 1/5] powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs

2017-08-02 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v3: no change arch/powerpc/mm/pgtable_32.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index a9e4bfc025bc..991036f818bb 100644 --- a/arch/p

[PATCH v3 2/5] powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32

2017-08-02 Thread Christophe Leroy
() Area ]--- This patch fixes that. The implementation is done by reusing the change_page_attr() function implemented for CONFIG_DEBUG_PAGEALLOC Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v3: Function re

[PATCH v3 3/5] powerpc/mm: Implement STRICT_KERNEL_RWX on PPC32

2017-08-02 Thread Christophe Leroy
This patch implements STRICT_KERNEL_RWX on PPC32. As for CONFIG_DEBUG_PAGEALLOC, it deactivates BAT and LTLB mappings in order to allow page protection setup at the level of each page. As BAT/LTLB mappings are deactivated, there might be a performance impact. Signed-off-by: Christophe Leroy

[PATCH v3 5/5] powerpc/mm: Simplify __set_fixmap()

2017-08-02 Thread Christophe Leroy
. This variable is set but has never been used from the beginning (commit 2c419bdeca1d9 ("[POWERPC] Port fixmap from x86 and use for kmap_atomic")) Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v3: no change arch/powerpc/include/asm/fixmap.h | 10 +++---

[PATCH v3 4/5] powerpc/mm: declare some local functions static

2017-08-02 Thread Christophe Leroy
get_pteptr() and __mapin_ram_chunk() are only used locally, so define them static Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- v3: no change arch/powerpc/include/asm/book3s/32/pgtable.h | 3 --- arch/powerpc/include/asm/nohash/32/pgtable.h | 3 --- arch/powerpc/mm/pgtabl

Re: [PATCH v1 1/3] arch/powerpc/set_memory: Implement set_memory_xx routines

2017-08-01 Thread christophe leroy
Le 01/08/2017 à 13:25, Balbir Singh a écrit : Add support for set_memory_xx routines. With the STRICT_KERNEL_RWX feature support we got support for changing the page permissions for pte ranges. This patch adds support for both radix and hash so that we can change their permissions via

[PATCH 01/12] powerpc/8xx: Simplify CONFIG_8xx checks in Makefile

2017-08-08 Thread Christophe Leroy
The entire 8xx directory is omitted if CONFIG_8xx is not enabled, so within the 8xx/Makefile CONFIG_8xx is always y. So convert obj-$(CONFIG_8xx) to the more obvious obj-y. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- This serie applies on top of Michael's serie be

[PATCH 03/12] powerpc/8xx: Remove SoftwareEmulation()

2017-08-08 Thread Christophe Leroy
Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/head_8xx.S | 2 +- arch/powerpc/kernel/traps.c| 18 -- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 07ddced6ba

[PATCH 05/12] powerpc/8xx: Move mpc8xx_pic.c from sysdev to platform/8xx

2017-08-08 Thread Christophe Leroy
mpc8xx_pic.c is dedicated to the 8xx, so move it to platform/8xx Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/platforms/8xx/Makefile | 2 +- arch/powerpc/platforms/8xx/m8xx_setup.c | 2 +- arch/powerpc/{sysdev/mpc8xx

[PATCH 08/12] powerpc/8xx: Getting rid of remaining use of CONFIG_8xx

2017-08-08 Thread Christophe Leroy
aining use of CONFIG_8xx: get rid of them. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/Kconfig | 4 ++-- arch/powerpc/Makefile| 2 +- arch/powerpc/boot/Makefile | 4 ++-- arch/powerpc/inc

[PATCH 09/12] powerpc/8xx: remove CONFIG_8xx

2017-08-08 Thread Christophe Leroy
so remove it. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/platforms/Kconfig.cputype | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 395593ef580c..13663efc1d31 100644 --

[PATCH 11/12] powerpc/8xx: Use symbolic names for DSISR bits in DSI

2017-08-08 Thread Christophe Leroy
Use symbolic names for DSISR bits in DSI Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/head_8xx.S | 2 +- arch/powerpc/mm/fault.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/

[PATCH 04/12] powerpc/cpm1: link to CONFIG_CPM1 instead of CONFIG_8xx

2017-08-08 Thread Christophe Leroy
To remain consistent with what is done with CPM2, let's link CPM1 related parts to CONFIG_CPM1 instead of CONFIG_8xx When something depends on both CPM1 and CPM2 we associate it with CONFIG_CPM Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/sysdev/Makefil

[PATCH 06/12] powerpc/time: refactor MFTB() to limit number of ifdefs

2017-08-08 Thread Christophe Leroy
as possible. In arch/powerpc/include/asm/timex.h, we also remove the ifdef for the asm() operands as the compiler doesn't mind unused operands Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/boot/ppc_asm.h | 8 arch/powerpc/boot/

[PATCH 07/12] powerpc/kconfig: Simplify PCI_QSPAN selection

2017-08-08 Thread Christophe Leroy
4xx, CPM2 and 8xx cannot be selected at the same time, so no need to test 8xx && !4xx && !CPM2. Testing 8xx is enough. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/

[PATCH 10/12] powerpc/8xx: Use symbolic PVR value

2017-08-08 Thread Christophe Leroy
For the 8xx, PVR values defined in arch/powerpc/include/asm/reg.h are nowhere used. Remove all defines and add PVR_8xx Use it in arch/powerpc/kernel/cputable.c Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/reg.h | 6 ++ arch/powerpc/

[PATCH 12/12] powerpc/8xx: Remove cpu dependent macro instructions from head_8xx

2017-08-08 Thread Christophe Leroy
head_8xx is dedicated to 8xx so no need to use macros that depends on the CPU Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/head_8xx.S | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/

[PATCH 00/12] powerpc/8xx: Some cleanup

2017-08-08 Thread Christophe Leroy
Christophe Leroy (12): powerpc/8xx: Simplify CONFIG_8xx checks in Makefile powerpc/8xx: Move 8xx machine check handlers into platforms/8xx powerpc/8xx: Remove SoftwareEmulation() powerpc/cpm1: link to CONFIG_CPM1 instead of CONFIG_8xx powerpc/8xx: Move mpc8xx_pic.c from sysdev to platform/8xx

[PATCH 02/12] powerpc/8xx: Move 8xx machine check handlers into platforms/8xx

2017-08-08 Thread Christophe Leroy
In the same spirit as what was done for 4xx and 44x, move the 8xx machine check into platforms/8xx Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/kernel/traps.c| 25 arch/powerpc/platforms/8xx/Makefile| 2 +- arch/p

Is SPARSE_IRQ really needed for all powerpcs ?

2017-08-04 Thread Christophe LEROY
The help associated with SPARSE_IRQ says: Sparse irq numbering is useful for distro kernels that want to define a high CONFIG_NR_CPUS value but still want to have low kernel memory footprint on smaller machines. ( Sparse irqs can also be beneficial on NUMA boxes, as they spread out

Re: [01/24] powerpc/mm: Move exception_enter/exit to a do_page_fault wrapper

2017-08-07 Thread Christophe LEROY
Le 07/08/2017 à 12:41, Michael Ellerman a écrit : On Wed, 2017-07-19 at 04:49:23 UTC, Benjamin Herrenschmidt wrote: This will allow simplifying the returns from do_page_fault Signed-off-by: Benjamin Herrenschmidt Series applied to powerpc next, thanks.

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

2017-05-11 Thread Christophe LEROY
Le 12/05/2017 à 02:47, Nicholas Piggin a écrit : On Thu, 11 May 2017 20:52:56 +0200 christophe leroy <christophe.le...@c-s.fr> wrote: Le 11/05/2017 à 19:14, christophe leroy a écrit : Le 11/05/2017 à 17:15, Nicholas Piggin a écrit : Cc: Scott Wood <o...@buserror.net> Cc: Chri

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

2017-05-11 Thread christophe leroy
Le 11/05/2017 à 17:15, Nicholas Piggin a écrit : Cc: Scott Wood <o...@buserror.net> Cc: Christophe Leroy <christophe.le...@c-s.fr> Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- arch/powerpc/xmon/xmon.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

2017-05-11 Thread christophe leroy
Le 11/05/2017 à 19:14, christophe leroy a écrit : Le 11/05/2017 à 17:15, Nicholas Piggin a écrit : Cc: Scott Wood <o...@buserror.net> Cc: Christophe Leroy <christophe.le...@c-s.fr> Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- arch/powerpc/xmon/xmon.c | 5 -

[PATCH] powerpc/mm: Simplify _PAGE_RO handling in page table dump

2017-05-09 Thread Christophe Leroy
Commit fd893fe56a130 ("powerpc/mm: Fix missing page attributes in page table dump") added support of _PAGE_RO attribute. This patch makes it more simple Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/dump_linuxpagetables.c | 7 +-- 1 file chan

Re: [PATCH v4 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-27 Thread Christophe LEROY
Le 27/06/2017 à 09:48, Balbir Singh a écrit : With text moving to read-only migrate optprobes to using the patch_instruction infrastructure. Without this optprobes will fail and complain. Signed-off-by: Balbir Singh Didn't Michael picked it up already ? Christophe

Re: [PATCH v4 1/9] powerpc/lib/code-patching: Use alternate map for patch_instruction()

2017-06-27 Thread Christophe LEROY
Le 27/06/2017 à 09:48, Balbir Singh a écrit : This patch creates the window using text_poke_area, allocated via get_vm_area(). text_poke_area is per CPU to avoid locking. text_poke_area for each cpu is setup using late_initcall, prior to setup of these alternate mapping areas, we continue to

Re: [PATCH v4 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

2017-06-27 Thread Christophe LEROY
Le 27/06/2017 à 09:48, Balbir Singh a écrit : arch_arm/disarm_probe use direct assignment for copying instructions, replace them with patch_instruction Signed-off-by: Balbir Singh Didn't Michael picked it up already ? Christophe --- arch/powerpc/kernel/kprobes.c

Re: [PATCH] powerpc/64: Use tick accounting by default

2017-05-22 Thread Christophe LEROY
Le 19/05/2017 à 16:41, Anton Blanchard a écrit : From: Anton Blanchard ppc64 is the only architecture that turns on VIRT_CPU_ACCOUNTING_NATIVE by default. The overhead of this option is extremely high - a context switch microbenchmark using sched_yield() is almost 20%

Re: [PATCH v1 1/8] powerpc/lib/code-patching: Enhance code patching

2017-05-28 Thread christophe leroy
Le 25/05/2017 à 05:36, Balbir Singh a écrit : Today our patching happens via direct copy and patch_instruction. The patching code is well contained in the sense that copying bits are limited. While considering implementation of CONFIG_STRICT_RWX, the first requirement is to a create another

Re: [PATCH v1 1/8] powerpc/lib/code-patching: Enhance code patching

2017-05-28 Thread christophe leroy
Le 25/05/2017 à 05:36, Balbir Singh a écrit : Today our patching happens via direct copy and patch_instruction. The patching code is well contained in the sense that copying bits are limited. While considering implementation of CONFIG_STRICT_RWX, the first requirement is to a create another

Re: [PATCH v1 1/8] powerpc/lib/code-patching: Enhance code patching

2017-05-28 Thread christophe leroy
Le 25/05/2017 à 05:36, Balbir Singh a écrit : Today our patching happens via direct copy and patch_instruction. The patching code is well contained in the sense that copying bits are limited. While considering implementation of CONFIG_STRICT_RWX, the first requirement is to a create another

[PATCH 1/7] powerpc/mm: rename map_page() to map_kernel_page() on PPC32

2017-05-29 Thread Christophe Leroy
Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 ++ arch/powerpc/include/asm/nohash/32/pgtable.h | 2 ++ arch/powerpc/mm/8xx_mmu.c| 2 +- arch/powerpc/mm/dma-noncoherent.c| 2 +- arch/powerpc/mm

[PATCH 2/7] powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs

2017-05-29 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/mm/pgtable_32.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index 9c23c0965566..bdfee8e62a6a 100644 --- a/arch/powerpc/mm/pgtabl

[PATCH 0/7] powerpc/mm: Fix kernel protection and implement STRICT_KERNEL_RWX on PPC32

2017-05-29 Thread Christophe Leroy
...@gmail.com> set identified "Enable STRICT_KERNEL_RWX" and applies on top of it. At the end we take the opportunity to get rid of some unneccessary/outdated fixmap stuff. Christophe Leroy (7): powerpc/mm: rename map_page() to map_kernel_page() on PPC32 powerpc/mm: Ensure

[PATCH 5/7] powerpc/mm: declare some local functions static

2017-05-29 Thread Christophe Leroy
get_pteptr() and __mapin_ram_chunk() are only used locally, so define them static Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- arch/powerpc/include/asm/book3s/32/pgtable.h | 3 --- arch/powerpc/include/asm/nohash/32/pgtable.h | 3 --- arch/powerpc/mm/pgtabl

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